-
Notifications
You must be signed in to change notification settings - Fork 14.3k
[BOLT] Don't terminate on trap instruction for Linux kernel #87021
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -211,13 +211,6 @@ class X86MCPlusBuilder : public MCPlusBuilder { | |
return false; | ||
} | ||
|
||
// FIXME: For compatibility with old LLVM only! | ||
bool isTerminator(const MCInst &Inst) const override { | ||
unsigned Opcode = Inst.getOpcode(); | ||
return Info->get(Opcode).isTerminator() || X86::isUD1(Opcode) || | ||
X86::isUD2(Opcode); | ||
Comment on lines
-217
to
-218
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Assuming you tested that it's safe to drop ud1/ud2 from terminators. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I'm dropping them only for the Linux kernel. For the rest, by default they will still terminate, but the condition check is modified with |
||
} | ||
|
||
bool isIndirectCall(const MCInst &Inst) const override { | ||
return isCall(Inst) && | ||
((getMemoryOperandNo(Inst) != -1) || Inst.getOperand(0).isReg()); | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@yota9 The new code makes
brk 0x3e8
Arm instruction a basic block terminator. If it's not the desired behavior, we can turn off--terminal-trap
on Arm.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@maksfb Hi! Currently I don't think it is a huge problem