File tree 2 files changed +21
-2
lines changed 2 files changed +21
-2
lines changed Original file line number Diff line number Diff line change @@ -1908,8 +1908,10 @@ bool GVNPass::processAssumeIntrinsic(AssumeInst *IntrinsicI) {
1908
1908
MSSAU->insertDef (cast<MemoryDef>(NewDef), /* RenameUses=*/ false );
1909
1909
}
1910
1910
}
1911
- if (isAssumeWithEmptyBundle (*IntrinsicI))
1911
+ if (isAssumeWithEmptyBundle (*IntrinsicI)) {
1912
1912
markInstructionForDeletion (IntrinsicI);
1913
+ return true ;
1914
+ }
1913
1915
return false ;
1914
1916
} else if (isa<Constant>(V)) {
1915
1917
// If it's not false, and constant, it must evaluate to true. This means our
Original file line number Diff line number Diff line change 1
1
; NOTE: Assertions have been autogenerated by utils/update_test_checks.py
2
- ; RUN: opt < %s -passes=gvn -S | FileCheck %s
2
+ ; RUN: opt < %s -passes=gvn -verify-analysis-invalidation - S | FileCheck %s
3
3
4
4
declare void @llvm.assume (i1 )
5
5
declare void @use (i1 )
6
6
7
+ define void @assume_true () {
8
+ ; CHECK-LABEL: @assume_true(
9
+ ; CHECK-NEXT: ret void
10
+ ;
11
+ call void @llvm.assume (i1 true )
12
+ ret void
13
+ }
14
+
15
+ define void @assume_false () {
16
+ ; CHECK-LABEL: @assume_false(
17
+ ; CHECK-NEXT: store i8 poison, ptr null, align 1
18
+ ; CHECK-NEXT: ret void
19
+ ;
20
+ call void @llvm.assume (i1 false )
21
+ ret void
22
+ }
23
+
7
24
define void @assume_arg (i1 %x ) {
8
25
; CHECK-LABEL: @assume_arg(
9
26
; CHECK-NEXT: call void @llvm.assume(i1 [[X:%.*]])
You can’t perform that action at this time.
0 commit comments