File tree Expand file tree Collapse file tree 2 files changed +20
-1
lines changed Expand file tree Collapse file tree 2 files changed +20
-1
lines changed Original file line number Diff line number Diff line change @@ -156,7 +156,7 @@ struct llvm::GVNPass::Expression {
156156 return false ;
157157 if (varargs != other.varargs )
158158 return false ;
159- if (!attrs.isEmpty () && !other.attrs .isEmpty () &&
159+ if (( !attrs.isEmpty () || !other.attrs .isEmpty () ) &&
160160 !attrs.intersectWith (type->getContext (), other.attrs ).has_value ())
161161 return false ;
162162 return true ;
Original file line number Diff line number Diff line change 1+ ; RUN: opt -S -passes=gvn < %s | FileCheck %s
2+
3+ declare i32 @bar () #0
4+
5+ define i32 @foo () {
6+ entry:
7+ %0 = tail call i32 @bar () #1
8+ %1 = tail call i32 @bar ()
9+ ret i32 1
10+ }
11+
12+ ; CHECK-LABEL: define i32 @foo(
13+ ; CHECK: %0 = tail call i32 @bar() #1
14+ ; CHECK-NEXT: %1 = tail call i32 @bar()
15+ ; CHECK-NEXT: ret i32 1
16+ ; CHECK-NEXT: }
17+
18+ attributes #0 = { memory(none) }
19+ attributes #1 = { "llvm.assume" ="ompx_no_call_asm" }
You can’t perform that action at this time.
0 commit comments