[llvm] [BOLT][AArch64] Enabling Inlining for Memcpy for AArch64 in BOLT (PR #154929)

Sjoerd Meijer via llvm-commits llvm-commits at lists.llvm.org
Tue Aug 26 13:23:35 PDT 2025


================
@@ -2597,6 +2597,132 @@ class AArch64MCPlusBuilder : public MCPlusBuilder {
   getInstructionSize(const MCInst &Inst) const override {
     return 4;
   }
+
+  InstructionListType createInlineMemcpy(bool ReturnEnd) const override {
+    // Fallback
+    return createInlineMemcpy(ReturnEnd, std::nullopt);
+  }
+
+  std::optional<uint64_t>
+  extractMoveImmediate(const MCInst &Inst, MCPhysReg TargetReg) const override {
+    if (Inst.getOpcode() == AArch64::MOVZXi && Inst.getNumOperands() >= 3) {
----------------
sjoerdmeijer wrote:

Code style nit: you can drop the brackets for if-statements that have only 1 statement, see also:

https://llvm.org/docs/CodingStandards.html#don-t-use-braces-on-simple-single-statement-bodies-of-if-else-loop-statements

So you can clean that up here, and in a couple of others places below too.

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


More information about the llvm-commits mailing list