[Mips] Correctly report sizes for PATCHABLE_* - #188229
Merged
Merged
Conversation
Member
|
@llvm/pr-subscribers-backend-mips Author: Nikita Popov (nikic) ChangesReport the size of the xray sled. See for the corresponding lowering.This came up while working on #187703. Full diff: https://github.com/llvm/llvm-project/pull/188229.diff 1 Files Affected:
diff --git a/llvm/lib/Target/Mips/MipsInstrInfo.cpp b/llvm/lib/Target/Mips/MipsInstrInfo.cpp
index c879c46e49dd4..a02340fdce973 100644
--- a/llvm/lib/Target/Mips/MipsInstrInfo.cpp
+++ b/llvm/lib/Target/Mips/MipsInstrInfo.cpp
@@ -714,6 +714,14 @@ unsigned MipsInstrInfo::getInstSizeInBytes(const MachineInstr &MI) const {
const char *AsmStr = MI.getOperand(0).getSymbolName();
return getInlineAsmLength(AsmStr, *MF->getTarget().getMCAsmInfo());
}
+ case TargetOpcode::PATCHABLE_FUNCTION_ENTER:
+ case TargetOpcode::PATCHABLE_FUNCTION_EXIT:
+ case TargetOpcode::PATCHABLE_TAIL_CALL:
+ // Size of xray sled
+ if (Subtarget.isGP64bit())
+ return 16 * 4;
+ else
+ return 13 * 4;
case Mips::CONSTPOOL_ENTRY:
// If this machine instr is a constant pool entry, its size is recorded as
// operand #2.
|
🪟 Windows x64 Test Results
✅ The build succeeded and all tests passed. |
Contributor
Author
|
Ping |
yingopq
reviewed
Apr 1, 2026
| if (Subtarget.isGP64bit()) | ||
| return 16 * 4; | ||
| else | ||
| return 13 * 4; |
Contributor
There was a problem hiding this comment.
Could you add some comments regarding the numbers?
Report the size of the xray sled.
Contributor
|
LGTM. |
joaovam
pushed a commit
to joaovam/llvm-project
that referenced
this pull request
Apr 2, 2026
Report the size of the xray sled. This came up while working on llvm#187703.
zwu-2025
pushed a commit
to zwu-2025/llvm-project
that referenced
this pull request
May 17, 2026
Report the size of the xray sled. This came up while working on llvm#187703.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Report the size of the xray sled.
See
llvm-project/llvm/lib/Target/Mips/MipsAsmPrinter.cpp
Line 1123 in 7d39664
This came up while working on #187703.