Please use GitHub pull requests for new patches. Phabricator shutdown timeline
Changeset View
Changeset View
Standalone View
Standalone View
llvm/trunk/lib/Transforms/InstCombine/InstCombineMulDivRem.cpp
Show First 20 Lines • Show All 525 Lines • ▼ Show 20 Lines | if (AllowReassociate && isFiniteNonZeroFp(C)) { | ||||
RI->copyFastMathFlags(&I); | RI->copyFastMathFlags(&I); | ||||
return RI; | return RI; | ||||
} | } | ||||
} | } | ||||
} | } | ||||
} | } | ||||
} | } | ||||
// sqrt(X) * sqrt(X) -> X | |||||
if (AllowReassociate && (Op0 == Op1)) | |||||
if (IntrinsicInst *II = dyn_cast<IntrinsicInst>(Op0)) | |||||
if (II->getIntrinsicID() == Intrinsic::sqrt) | |||||
return ReplaceInstUsesWith(I, II->getOperand(0)); | |||||
// Under unsafe algebra do: | // Under unsafe algebra do: | ||||
// X * log2(0.5*Y) = X*log2(Y) - X | // X * log2(0.5*Y) = X*log2(Y) - X | ||||
if (AllowReassociate) { | if (AllowReassociate) { | ||||
Value *OpX = nullptr; | Value *OpX = nullptr; | ||||
Value *OpY = nullptr; | Value *OpY = nullptr; | ||||
IntrinsicInst *Log2; | IntrinsicInst *Log2; | ||||
detectLog2OfHalf(Op0, OpY, Log2); | detectLog2OfHalf(Op0, OpY, Log2); | ||||
▲ Show 20 Lines • Show All 858 Lines • Show Last 20 Lines |