Limit Store Forwarding Block only to cases where we can prove that the memcpy does not overlap in memory, otherwise breaking the memcpy could result in overwriting the correct value.
This limits the optimization only to cases where AA can prove that the memory locations don't alias.
Details
Diff Detail
Event Timeline
lib/Target/X86/X86FixupSFB.cpp | ||
---|---|---|
460 | It looks like you're only using this to compare two operands so there's no reason to expose the internal reg/index value. Pull the comparison into this function, e.g: equalBaseOperands(MachineOperand &B1, MachineOperand &B2) { if (B1.isReg() != B2.isReg()) return false; if (B1.isReg()) return B1.getReg() == B2.getReg(); return B1.getIndex() == B2.getIndex(); } | |
491 | nit: The getParent check should probably be first. | |
495 | Can MI/StoreMI have more than one memoperand? We should add an assert for a singleton list or check the crossproduct. |
lib/Target/X86/X86FixupSFB.cpp | ||
---|---|---|
64 | Can you please commit the class rename change and rebase this patch on top? | |
460 | Can this be committed and then rebase the patch on top? | |
lib/Target/X86/X86TargetMachine.cpp | ||
65 | Can you please commit the initialize-related changes and rebase? | |
test/CodeGen/X86/fixup-sfb.ll | ||
7 | Why were these cases removed? |
@zvi the changes in this commit were added to https://reviews.llvm.org/D41330 and committed already. I will close this patch
Can you please commit the class rename change and rebase this patch on top?