File tree 2 files changed +22
-1
lines changed
2 files changed +22
-1
lines changed Original file line number Diff line number Diff line change @@ -156,7 +156,7 @@ struct llvm::GVNPass::Expression {
156
156
return false ;
157
157
if (varargs != other.varargs )
158
158
return false ;
159
- if (!attrs.isEmpty () && !other.attrs .isEmpty () &&
159
+ if (( !attrs.isEmpty () || !other.attrs .isEmpty () ) &&
160
160
!attrs.intersectWith (type->getContext (), other.attrs ).has_value ())
161
161
return false ;
162
162
return true ;
Original file line number Diff line number Diff line change
1
+ ; NOTE: Assertions have been autogenerated by utils/update_test_checks.py UTC_ARGS: --version 5
2
+ ; RUN: opt -S -passes=gvn < %s | FileCheck %s
3
+
4
+ declare i32 @bar () #0
5
+
6
+ define i32 @foo () {
7
+ ; CHECK-LABEL: define i32 @foo() {
8
+ ; CHECK-NEXT: [[ENTRY:.*:]]
9
+ ; CHECK-NEXT: [[TMP0:%.*]] = tail call i32 @bar() #[[ATTR1:[0-9]+]]
10
+ ; CHECK-NEXT: [[TMP1:%.*]] = tail call i32 @bar()
11
+ ; CHECK-NEXT: ret i32 1
12
+ ;
13
+ entry:
14
+ %0 = tail call i32 @bar () #1
15
+ %1 = tail call i32 @bar ()
16
+ ret i32 1
17
+ }
18
+
19
+
20
+ attributes #0 = { memory(none) }
21
+ attributes #1 = { "llvm.assume" ="ompx_no_call_asm" }
You can’t perform that action at this time.
0 commit comments