[llvm] [IRBuilder] Refactor FMF interface (PR #121657)
Nikita Popov via llvm-commits
llvm-commits at lists.llvm.org
Sat Jan 4 12:06:52 PST 2025
================
@@ -869,28 +869,28 @@ CallInst *IRBuilderBase::CreateGCGetPointerOffset(Value *DerivedPtr,
}
CallInst *IRBuilderBase::CreateUnaryIntrinsic(Intrinsic::ID ID, Value *V,
- Instruction *FMFSource,
+ FMFSource FMFSource,
const Twine &Name) {
Module *M = BB->getModule();
Function *Fn = Intrinsic::getOrInsertDeclaration(M, ID, {V->getType()});
return createCallHelper(Fn, {V}, Name, FMFSource);
}
Value *IRBuilderBase::CreateBinaryIntrinsic(Intrinsic::ID ID, Value *LHS,
- Value *RHS, Instruction *FMFSource,
+ Value *RHS, FMFSource FMFSource,
const Twine &Name) {
Module *M = BB->getModule();
Function *Fn = Intrinsic::getOrInsertDeclaration(M, ID, {LHS->getType()});
if (Value *V = Folder.FoldBinaryIntrinsic(ID, LHS, RHS, Fn->getReturnType(),
- FMFSource))
+ FMFSource.Source))
----------------
nikic wrote:
It looks like this is the only direct usage of `Source`. Can we change FoldBinaryIntrinsic to accept FMF instead? simplifyBinaryIntrinsic only inspects Call for FMF and ConstantFoldIntrinsicCall2 uses it to access additional information from constrainted intrinsics. Using FMFSource for that is very questionable, so we can just not pass the parameter for that IRBuilderFold implementation.
https://github.com/llvm/llvm-project/pull/121657
More information about the llvm-commits
mailing list