[llvm] b5a2627 - [DSE] Fix DSE test to use non-extern global (NFC)

Nikita Popov via llvm-commits llvm-commits at lists.llvm.org
Mon Jan 3 00:39:38 PST 2022


Author: Nikita Popov
Date: 2022-01-03T09:38:04+01:00
New Revision: b5a2627423f3e03cd82a1ec92b43c7573eb4d64a

URL: https://github.com/llvm/llvm-project/commit/b5a2627423f3e03cd82a1ec92b43c7573eb4d64a
DIFF: https://github.com/llvm/llvm-project/commit/b5a2627423f3e03cd82a1ec92b43c7573eb4d64a.diff

LOG: [DSE] Fix DSE test to use non-extern global (NFC)

The intended transform is not legal with an extern global, because
the actual global defined in a different TU might have larger
size. Make it non-extern to show that the desired transform already
works.

Added: 
    

Modified: 
    llvm/test/Transforms/DeadStoreElimination/trivial-dse-calls.ll

Removed: 
    


################################################################################
diff  --git a/llvm/test/Transforms/DeadStoreElimination/trivial-dse-calls.ll b/llvm/test/Transforms/DeadStoreElimination/trivial-dse-calls.ll
index 6c4db3385513..1966559f5d39 100644
--- a/llvm/test/Transforms/DeadStoreElimination/trivial-dse-calls.ll
+++ b/llvm/test/Transforms/DeadStoreElimination/trivial-dse-calls.ll
@@ -305,14 +305,11 @@ define i32 @test_neg_dse_unsized(i32* %a) {
   ret i32 %v
 }
 
+ at G = global i8 0
 
- at G = external global i8
-
-; TODO: Should be able to kill call in analogous manner to test_dse_overwrite.
-; Difference is non-alloca object.
+; Same as test_dse_overwrite, but with a non-alloca object.
 define void @test_dse_non_alloca() {
 ; CHECK-LABEL: @test_dse_non_alloca(
-; CHECK-NEXT:    call void @f(i8* nocapture writeonly @G) #[[ATTR1]]
 ; CHECK-NEXT:    store i8 0, i8* @G, align 1
 ; CHECK-NEXT:    ret void
 ;


        


More information about the llvm-commits mailing list