[llvm] [X86] Fix store MMO offset in breakBlockedCopies (PR #202904)
via llvm-commits
llvm-commits at lists.llvm.org
Wed Jun 10 02:39:58 PDT 2026
llvmorg-github-actions[bot] wrote:
<!--LLVM PR SUMMARY COMMENT-->
@llvm/pr-subscribers-backend-x86
Author: adalal-2441
<details>
<summary>Changes</summary>
The final buildCopies call in breakBlockedCopies passed LMMOffset for both the load and store MachineMemOperand offsets. The store argument should be SMMOffset. This is NFC today since LMMOffset and SMMOffset values were anyways equal before, but the duplication was a latent bug.
Found via @<!-- -->jlebar's X86 LLVM bug hunt / FuzzX effort: https://github.com/SemiAnalysisAI/FuzzX/blob/master/x86/bugs/042-sfb-buildcopies-wrong-mmo-offset/NOTES.md
cc @<!-- -->jlebar
---
Full diff: https://github.com/llvm/llvm-project/pull/202904.diff
1 Files Affected:
- (modified) llvm/lib/Target/X86/X86AvoidStoreForwardingBlocks.cpp (+1-1)
``````````diff
diff --git a/llvm/lib/Target/X86/X86AvoidStoreForwardingBlocks.cpp b/llvm/lib/Target/X86/X86AvoidStoreForwardingBlocks.cpp
index 044a951bc7c3e..e3b3066747a84 100644
--- a/llvm/lib/Target/X86/X86AvoidStoreForwardingBlocks.cpp
+++ b/llvm/lib/Target/X86/X86AvoidStoreForwardingBlocks.cpp
@@ -612,7 +612,7 @@ void X86AvoidSFBImpl::breakBlockedCopies(
}
unsigned Size3 = (LdDispImm + getRegSizeInBytes(LoadInst)) - LdDisp1;
buildCopies(Size3, LoadInst, LdDisp1, StoreInst, StDisp1, LMMOffset,
- LMMOffset);
+ SMMOffset);
}
static bool hasSameBaseOpValue(MachineInstr *LoadInst,
``````````
</details>
https://github.com/llvm/llvm-project/pull/202904
More information about the llvm-commits
mailing list