Skip to content

Commit 2b4c590

Browse files
committed
Use bundle guard
1 parent db5757a commit 2b4c590

File tree

1 file changed

+9
-1
lines changed

1 file changed

+9
-1
lines changed

llvm/lib/Target/AMDGPU/AMDGPUInstCombineIntrinsic.cpp

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1134,7 +1134,15 @@ 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-
SmallVector<Value *, 2> Args(II.args());
1137+
// Make sure convergence tokens are preserved.
1138+
// TODO: CreateIntrinsic should allow directly copying bundles
1139+
SmallVector<OperandBundleDef, 2> OpBundles;
1140+
II.getOperandBundlesAsDefs(OpBundles);
1141+
1142+
IRBuilderBase::OperandBundlesGuard Guard(IC.Builder);
1143+
IC.Builder.setDefaultOperandBundles(OpBundles);
1144+
1145+
SmallVector<Value *, 3> Args(II.args());
11381146
Args[0] = BCSrc;
11391147
CallInst *NewCall = IC.Builder.CreateIntrinsic(
11401148
II.getIntrinsicID(), {BCSrc->getType()}, Args);

0 commit comments

Comments
 (0)