[llvm] [BOLT][BTI] Refactor: move applyBTIFixup under MCPlusBuilder (PR #177164)

Alexey Moksyakov via llvm-commits llvm-commits at lists.llvm.org
Thu Jan 22 07:59:53 PST 2026


yavtuk wrote:

Hello folks, @bgergely0 @paschalis-mpeis, what do you think, should we move UsesBTI under the MCPlusBuilder class?
I'm reading the MR and see that every time we create instructions, we need to check the BinaryContext attribute to apply fixes in case of BTI.

Instead, I suggest using the SubtargetFeatures API, adding +bti as a function based on the information from.note.gnu.property.
LLVM_ABI void AddFeature(StringRef String, bool Enable = true);
MIB->STI.isEnabled("+bti")
MCPlusBuilder is initialized with MCSubtargetInfo functions that can be used by AArch64MCPlusBuilder to check for BTI support.

or another one way which can move the checking to MIB

https://github.com/llvm/llvm-project/pull/177164


More information about the llvm-commits mailing list