mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2024-12-14 11:32:34 +00:00
use range-based for-loop
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@237711 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
61386a4fe3
commit
f75a247286
@ -8280,12 +8280,9 @@ SDValue DAGCombiner::visitFDIV(SDNode *N) {
|
|||||||
|
|
||||||
SmallVector<SDNode *, 4> Users;
|
SmallVector<SDNode *, 4> Users;
|
||||||
// Find all FDIV users of the same divisor.
|
// Find all FDIV users of the same divisor.
|
||||||
for (SDNode::use_iterator UI = N1.getNode()->use_begin(),
|
for (auto U : N1->uses()) {
|
||||||
UE = N1.getNode()->use_end();
|
if (U->getOpcode() == ISD::FDIV && U->getOperand(1) == N1)
|
||||||
UI != UE; ++UI) {
|
Users.push_back(U);
|
||||||
SDNode *User = UI.getUse().getUser();
|
|
||||||
if (User->getOpcode() == ISD::FDIV && User->getOperand(1) == N1)
|
|
||||||
Users.push_back(User);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if (TLI.combineRepeatedFPDivisors(Users.size())) {
|
if (TLI.combineRepeatedFPDivisors(Users.size())) {
|
||||||
@ -8294,7 +8291,7 @@ SDValue DAGCombiner::visitFDIV(SDNode *N) {
|
|||||||
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) {
|
if (U->getOperand(0) != FPOne) {
|
||||||
SDValue NewNode = DAG.getNode(ISD::FMUL, SDLoc(U), VT,
|
SDValue NewNode = DAG.getNode(ISD::FMUL, SDLoc(U), VT,
|
||||||
U->getOperand(0), Reciprocal);
|
U->getOperand(0), Reciprocal);
|
||||||
|
Loading…
Reference in New Issue
Block a user