[llvm] [BOLT][AArch64] Implement PLTCall optimization (PR #93584)
Pavel Samolysov via llvm-commits
llvm-commits at lists.llvm.org
Wed May 29 20:36:39 PDT 2024
================
@@ -1412,9 +1413,15 @@ class MCPlusBuilder {
return false;
}
- /// Modify a direct call instruction \p Inst with an indirect call taking
- /// a destination from a memory location pointed by \p TargetLocation symbol.
- virtual bool convertCallToIndirectCall(MCInst &Inst,
+ /// Modify a direct call instruction pointed by the iterator \p It, with an
+ /// indirect call taking a destination from a memory location pointed by \p
+ /// TargetLocation symbol. If additional instructions need to be prepended
+ /// before \p It, then the iterator must be updated to point to the indirect
+ /// call instruction.
+ ///
+ /// \return true on success
+ virtual bool convertCallToIndirectCall(BinaryBasicBlock &BB,
----------------
samolisov wrote:
@paschalis-mpeis There is a polymorphic iterator `InstructionIterator`, which is defined in `MCPlusBuilder.h` and there is a pattern to pass every required instruction sequence to `MCPlusBuilder`'s methods by this iterator (but, as I see, it is used to pass a chain of instruction with no modifications of the iterator itself). Also there is the `InstructionListType` and, please have a look at the [`createLoadImmediate`](https://github.com/llvm/llvm-project/blob/main/bolt/lib/Target/AArch64/AArch64MCPlusBuilder.cpp#L1453) for example, the generated in `MCPlusBuilder` instruction list should be returned by value.
https://github.com/llvm/llvm-project/pull/93584
More information about the llvm-commits
mailing list