When splitting up one store into several in splitStoreSplat we have to make sure we get the MachinePointerInfo right, otherwise alias analysis thinks they all store to the same location. This can then cause invalid scheduling later on.
Details
- Reviewers
t.p.northover gberry jmolloy MatzeB - Commits
- rG95582bf245db: Merging r294203: --------------------------------------------------------------…
rG3a9c842a9ddf: [AArch64] Fix incorrect MachinePointerInfo in splitStoreSplat
rL294242: Merging r294203:
rL294203: [AArch64] Fix incorrect MachinePointerInfo in splitStoreSplat
Diff Detail
- Repository
- rL LLVM
Event Timeline
Nice catch. Coincidentally I'm currently working on a patch that fixes a different bug related to this same transform.
Would you consider adding test cases that cover the other caller of splitStoreSplat, namely splitStores when it sees a store of a splat vector?
It also might be worth considering whether the tests should check the scheduler dependency debug output, since otherwise this bug is only exposed if the scheduler happens to pick a bad schedule.
Also, this seems like it probably should be considered for the release branch.
lib/Target/AArch64/AArch64ISelLowering.cpp | ||
---|---|---|
8926 ↗ | (On Diff #86793) | This should probably be const MachinePointerInfo &PtrInfo |
test/CodeGen/AArch64/ldst-zero.ll | ||
3 ↗ | (On Diff #86793) | typo "generates" -> "generated" |
11 ↗ | (On Diff #86793) | All of the CHECK-LABELS should probably include a ':' at the end to make the matching tighter: |
Also, this seems like it probably should be considered for the release branch.
cc'ing myself
Looks good with a few minor nits.
test/CodeGen/AArch64/ldst-zero.ll | ||
---|---|---|
13 ↗ | (On Diff #86972) | These first two checks can be CHECK-DAG since they can be scheduled independently. The same applies to all of these tests I believe. |
test/CodeGen/AArch64/misched-stp.ll | ||
10 ↗ | (On Diff #86972) | You might want to make the %vreg matching a little less brittle (i.e. match %vreg{{[0-9]+}} instead of %vreg3 since you aren't really checking anything related to the registers). The same probably goes for the Latency, which can probably just be dropped entirely. And the SU numbers. |
test/CodeGen/AArch64/ldst-zero.ll | ||
---|---|---|
13 ↗ | (On Diff #86972) | Ah yes, sorry. I misread the second store as an 'str' |