mirror of
https://github.com/RPCS3/llvm.git
synced 2026-07-19 23:23:38 -04:00
[InstSimplify] fold fma/fmuladd with a NaN or undef operand
This is intended to be similar to the constant folding results from D67446 and earlier, but not all operands are constant in these tests, so the responsibility for folding is left to InstSimplify. Differential Revision: https://reviews.llvm.org/D67721 git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@373455 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
@@ -5186,6 +5186,15 @@ static Value *simplifyIntrinsic(CallBase *Call, const SimplifyQuery &Q) {
|
||||
}
|
||||
return nullptr;
|
||||
}
|
||||
case Intrinsic::fma:
|
||||
case Intrinsic::fmuladd: {
|
||||
Value *Op0 = Call->getArgOperand(0);
|
||||
Value *Op1 = Call->getArgOperand(1);
|
||||
Value *Op2 = Call->getArgOperand(2);
|
||||
if (Value *V = simplifyFPOp({ Op0, Op1, Op2 }))
|
||||
return V;
|
||||
return nullptr;
|
||||
}
|
||||
default:
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user