[PATCH] D115808: [DAGCombiner] Avoid combining adjacent stores at -O0 to improve debug experience
Jessica Clarke via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Fri Dec 17 22:42:26 PST 2021
jrtc27 added inline comments.
================
Comment at: llvm/test/CodeGen/RISCV/optnone-store-no-combine.ll:5
+; This test case makes sure that the same store will not get optimize out by DAGCombiner
+; and verify that codegen has the those stores in it. It will help to improve debug experience.
+
----------------
"the those"
================
Comment at: llvm/test/CodeGen/RISCV/optnone-store-no-combine.ll:7-22
+ at size = dso_local global i32 0, align 4
+
+define dso_local void @foo() noinline nounwind optnone {
+; CHECK-LABEL: foo:
+; CHECK: # %bb.0:
+; CHECK-NEXT: lui a0, %hi(size)
+; CHECK-NEXT: li a1, 8
----------------
Like I said, it's `@foo(i32* %p)`, then you just use `%p` everywhere.
I imagine it'll give the following:
```
; CHECK-LABEL: foo:
; CHECK: # %bb.0:
; CHECK-NEXT: li a1, 8
; CHECK-NEXT: sw a1, 0(a0)
; CHECK-NEXT: sw a1, 0(a0)
; CHECK-NEXT: ret
```
I've also deleted one of the stores, you don't need three, you only need two to show that they don't get turned into a single one
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D115808/new/
https://reviews.llvm.org/D115808
More information about the llvm-commits
mailing list