================
@@ -5153,6 +5158,23 @@ static Value *upgradeAMDGCNIntrinsicCall(StringRef Name,
CallBase *CI,
}
}
+ if (Name.starts_with("fcmp.") || Name.starts_with("icmp.")) {
+ Value *LHS = CI->getArgOperand(0);
+ Value *RHS = CI->getArgOperand(1);
+ CmpInst::Predicate Pred = static_cast<CmpInst::Predicate>(
+ cast<ConstantInt>(CI->getArgOperand(2))->getZExtValue());
+ Value *Cmp = Builder.CreateCmp(Pred, LHS, RHS);
+ CallInst *NewCall = Builder.CreateIntrinsicWithoutFolding(
+ CI->getType(), Intrinsic::amdgcn_ballot, Cmp);
+ NewCall->setTailCallKind(cast<CallInst>(CI)->getTailCallKind());
+ NewCall->setCallingConv(CI->getCallingConv());
+ NewCall->setDebugLoc(CI->getDebugLoc());
----------------
arsenm wrote:
I think the setDebugLoc is redundant with the copyMetadata
https://github.com/llvm/llvm-project/pull/208183
_______________________________________________
cfe-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits