mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-06-14 14:24:05 +00:00
tidy up
1. remove duplicate local variable 2. add local variable with name to match comment 3. remove useless comment git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@237715 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
@ -8286,15 +8286,15 @@ SDValue DAGCombiner::visitFDIV(SDNode *N) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (TLI.combineRepeatedFPDivisors(Users.size())) {
|
if (TLI.combineRepeatedFPDivisors(Users.size())) {
|
||||||
SDLoc DL(N);
|
SDValue FPOne = DAG.getConstantFP(1.0, DL, VT);
|
||||||
SDValue FPOne = DAG.getConstantFP(1.0, DL, VT); // floating point 1.0
|
|
||||||
SDValue Reciprocal = DAG.getNode(ISD::FDIV, DL, VT, FPOne, N1);
|
SDValue Reciprocal = DAG.getNode(ISD::FDIV, DL, VT, FPOne, N1);
|
||||||
|
|
||||||
// Dividend / Divisor -> Dividend * Reciprocal
|
// Dividend / Divisor -> Dividend * Reciprocal
|
||||||
for (auto U : Users) {
|
for (auto U : Users) {
|
||||||
if (U->getOperand(0) != FPOne) {
|
SDValue Dividend = U->getOperand(0);
|
||||||
SDValue NewNode = DAG.getNode(ISD::FMUL, SDLoc(U), VT,
|
if (Dividend != FPOne) {
|
||||||
U->getOperand(0), Reciprocal);
|
SDValue NewNode = DAG.getNode(ISD::FMUL, SDLoc(U), VT, Dividend,
|
||||||
|
Reciprocal);
|
||||||
DAG.ReplaceAllUsesWith(U, NewNode.getNode());
|
DAG.ReplaceAllUsesWith(U, NewNode.getNode());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user