[PATCH] D118355: Add -mmanual-endbr switch to allow manual selection of control-flow protection

2022-05-06 Thread Xiang Zhang via Phabricator via cfe-commits
xiangzhangllvm added inline comments. Comment at: llvm/lib/Target/X86/X86IndirectBranchTracking.cpp:156-161 if (needsPrologueENDBR(MF, M)) { -auto MBB = MF.begin(); -Changed |= addENDBR(*MBB, MBB->begin()); +if (!ManualENDBR || MF.getFunction().doesCfCheck()) { +

[PATCH] D118355: Add -mmanual-endbr switch to allow manual selection of control-flow protection

2022-05-06 Thread Joao Moreira via Phabricator via cfe-commits
joaomoreira added inline comments. Comment at: llvm/lib/Target/X86/X86IndirectBranchTracking.cpp:156-161 if (needsPrologueENDBR(MF, M)) { -auto MBB = MF.begin(); -Changed |= addENDBR(*MBB, MBB->begin()); +if (!ManualENDBR || MF.getFunction().doesCfCheck()) { +

[PATCH] D118355: Add -mmanual-endbr switch to allow manual selection of control-flow protection

2022-05-05 Thread Xiang Zhang via Phabricator via cfe-commits
xiangzhangllvm added inline comments. Comment at: llvm/lib/Target/X86/X86IndirectBranchTracking.cpp:156-161 if (needsPrologueENDBR(MF, M)) { -auto MBB = MF.begin(); -Changed |= addENDBR(*MBB, MBB->begin()); +if (!ManualENDBR || MF.getFunction().doesCfCheck()) { +

[PATCH] D118355: Add -mmanual-endbr switch to allow manual selection of control-flow protection

2022-01-27 Thread Gabriel F. T. Gomes via Phabricator via cfe-commits
gftg added a comment. This patch as-is doesn't build. To build it needs another change that I know is wrong, so I'm posting it below to ask for your help: [RFC] How to add more bits to the Type class? After reading https://reviews.llvm.org/D50630, I learned that keeping the

[PATCH] D118355: Add -mmanual-endbr switch to allow manual selection of control-flow protection

2022-01-27 Thread Gabriel F. T. Gomes via Phabricator via cfe-commits
gftg created this revision. gftg added reviewers: xiangzhangllvm, pengfei, erichkeane, joaomoreira. Herald added subscribers: ormris, dexonsmith, dang, jdoerfert, steven_wu, martong, hiraditya. Herald added a reviewer: aaron.ballman. gftg requested review of this revision. Herald added projects: