forked from OSchip/llvm-project
[InstCombine] Create new log2 intrinsic; NFCI
Rather than mixing creation of new instructions and in-place modification here, create a new log2 intrinsic. This should be NFC apart from worklist order changes.
This commit is contained in:
parent
6cdc36afb2
commit
893c630fbe
|
@ -563,8 +563,7 @@ Instruction *InstCombiner::visitFMul(BinaryOperator &I) {
|
|||
Y = Op0;
|
||||
}
|
||||
if (Log2) {
|
||||
Log2->setArgOperand(0, X);
|
||||
Log2->copyFastMathFlags(&I);
|
||||
Value *Log2 = Builder.CreateUnaryIntrinsic(Intrinsic::log2, X, &I);
|
||||
Value *LogXTimesY = Builder.CreateFMulFMF(Log2, Y, &I);
|
||||
return BinaryOperator::CreateFSubFMF(LogXTimesY, Y, &I);
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue