Skip to content

Commit db5757a

Browse files
committed
Revert "Make sure convergence tokens are preserved"
This reverts commit bf17987.
1 parent 7bd0159 commit db5757a

File tree

1 file changed

+6
-8
lines changed

1 file changed

+6
-8
lines changed

llvm/lib/Target/AMDGPU/AMDGPUInstCombineIntrinsic.cpp

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1134,14 +1134,12 @@ GCNTTIImpl::instCombineIntrinsic(InstCombiner &IC, IntrinsicInst &II) const {
11341134

11351135
// TODO: Handle this for update_dpp, mov_ddp8, and all permlane variants.
11361136
if (isTypeLegal(BCSrc->getType())) {
1137-
Module *M = IC.Builder.GetInsertBlock()->getModule();
1138-
// Mutate the call in place to ensure operand bundles are preserved.
1139-
Function *Remangled =
1140-
Intrinsic::getOrInsertDeclaration(M, IID, {BCSrc->getType()});
1141-
1142-
II.setCalledFunction(Remangled);
1143-
IC.replaceOperand(II, 0, BCSrc);
1144-
return new BitCastInst(&II, II.getType());
1137+
SmallVector<Value *, 2> Args(II.args());
1138+
Args[0] = BCSrc;
1139+
CallInst *NewCall = IC.Builder.CreateIntrinsic(
1140+
II.getIntrinsicID(), {BCSrc->getType()}, Args);
1141+
NewCall->takeName(&II);
1142+
return new BitCastInst(NewCall, II.getType());
11451143
}
11461144
}
11471145

0 commit comments

Comments
 (0)