Skip to content

Commit a88458c

Browse files
committed
[IR] Return correct memory effects for convergencectrl
1 parent 0bfbdbb commit a88458c

File tree

2 files changed

+5
-5
lines changed

2 files changed

+5
-5
lines changed

llvm/lib/IR/Instructions.cpp

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -609,15 +609,17 @@ bool CallBase::hasReadingOperandBundles() const {
609609
// Implementation note: this is a conservative implementation of operand
610610
// bundle semantics, where *any* non-assume operand bundle (other than
611611
// ptrauth) forces a callsite to be at least readonly.
612-
return hasOperandBundlesOtherThan(
613-
{LLVMContext::OB_ptrauth, LLVMContext::OB_kcfi}) &&
612+
return hasOperandBundlesOtherThan({LLVMContext::OB_ptrauth,
613+
LLVMContext::OB_kcfi,
614+
LLVMContext::OB_convergencectrl}) &&
614615
getIntrinsicID() != Intrinsic::assume;
615616
}
616617

617618
bool CallBase::hasClobberingOperandBundles() const {
618619
return hasOperandBundlesOtherThan(
619620
{LLVMContext::OB_deopt, LLVMContext::OB_funclet,
620-
LLVMContext::OB_ptrauth, LLVMContext::OB_kcfi}) &&
621+
LLVMContext::OB_ptrauth, LLVMContext::OB_kcfi,
622+
LLVMContext::OB_convergencectrl}) &&
621623
getIntrinsicID() != Intrinsic::assume;
622624
}
623625

llvm/test/Transforms/DCE/op_bundles.ll

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,6 @@
44
define void @dead_readfirstlane_convergencetoken(<2 x i32> %src) convergent {
55
; CHECK-LABEL: define void @dead_readfirstlane_convergencetoken(
66
; CHECK-SAME: <2 x i32> [[SRC:%.*]]) #[[ATTR0:[0-9]+]] {
7-
; CHECK-NEXT: [[T:%.*]] = tail call token @llvm.experimental.convergence.entry()
8-
; CHECK-NEXT: [[VEC:%.*]] = call <2 x i32> @llvm.amdgcn.readfirstlane.v2i32(<2 x i32> [[SRC]]) [ "convergencectrl"(token [[T]]) ]
97
; CHECK-NEXT: ret void
108
;
119
%t = tail call token @llvm.experimental.convergence.entry()

0 commit comments

Comments
 (0)