[PATCH] D34642: Restore original intent of memset instcombine test
Daniel Neilson via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Mon Jun 26 13:32:46 PDT 2017
dneilson updated this revision to Diff 104013.
dneilson added a comment.
Add CHECK-NOT to ensure that the memset calls have been removed.
https://reviews.llvm.org/D34642
Files:
test/Transforms/InstCombine/memset.ll
Index: test/Transforms/InstCombine/memset.ll
===================================================================
--- test/Transforms/InstCombine/memset.ll
+++ test/Transforms/InstCombine/memset.ll
@@ -1,7 +1,16 @@
-; RUN: opt < %s -instcombine -S | not grep "call.*llvm.memset"
+; RUN: opt < %s -instcombine -S | FileCheck %s
-define i32 @main() {
- %target = alloca [1024 x i8]
+define i32 @test([1024 x i8]* %target) {
+ ;; CHECK-LABEL: test
+ ;; CHECK: [[P1:%[^\s]+]] = getelementptr inbounds [1024 x i8], [1024 x i8]* %target, i64 0, i64 0
+ ;; CHECK: store i8 1, i8* [[P1]], align 1
+ ;; CHECK: [[P2:%[^\s]+]] = bitcast [1024 x i8]* %target to i16*
+ ;; CHECK: store i16 257, i16* [[P2]], align 2
+ ;; CHECK: [[P3:%[^\s]+]] = bitcast [1024 x i8]* %target to i32*
+ ;; CHECK: store i32 16843009, i32* [[P3]], align 4
+ ;; CHECK: [[P4:%[^\s]+]] = bitcast [1024 x i8]* %target to i64*
+ ;; CHECK: store i64 72340172838076673, i64* [[P4]], align 8
+ ;; CHECK-NOT: call void @llvm.memset
%target_p = getelementptr [1024 x i8], [1024 x i8]* %target, i32 0, i32 0
call void @llvm.memset.p0i8.i32(i8* %target_p, i8 1, i32 0, i32 1, i1 false)
call void @llvm.memset.p0i8.i32(i8* %target_p, i8 1, i32 1, i32 1, i1 false)
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D34642.104013.patch
Type: text/x-patch
Size: 1238 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20170626/9a1c9353/attachment.bin>
More information about the llvm-commits
mailing list