llvm.org GIT mirror llvm / 7b316c9
Fix SimplifySelectCC to add newly created nodes to the DAGCombiner worklist, as it may be possible to perform further optimization on them. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@140349 91177308-0d34-0410-b5e6-96231b3b80d8 Dan Gohman 8 years ago
2 changed file(s) with 9 addition(s) and 6 deletion(s). Raw diff Collapse all Expand all
74997499 SDValue Cond = DAG.getSetCC(DL,
75007500 TLI.getSetCCResultType(N0.getValueType()),
75017501 N0, N1, CC);
7502 AddToWorkList(Cond.getNode());
75027503 SDValue CstOffset = DAG.getNode(ISD::SELECT, DL, Zero.getValueType(),
75037504 Cond, One, Zero);
7505 AddToWorkList(CstOffset.getNode());
75047506 CPIdx = DAG.getNode(ISD::ADD, DL, TLI.getPointerTy(), CPIdx,
75057507 CstOffset);
7508 AddToWorkList(CPIdx.getNode());
75067509 return DAG.getLoad(TV->getValueType(0), DL, DAG.getEntryNode(), CPIdx,
75077510 MachinePointerInfo::getConstantPool(), false,
75087511 false, Alignment);
7575 ; block generated, odds are good that we have close to the ideal code for this:
7676 ;
7777 ; CHECK-NEON: _f8:
78 ; CHECK-NEON: movw [[REGISTER_1:r[0-9]+]], #1123
79 ; CHECK-NEON-NEXT: movs [[REGISTER_2:r[0-9]+]], #0
80 ; CHECK-NEON-NEXT: cmp r0, [[REGISTER_1]]
81 ; CHECK-NEON-NEXT: it eq
82 ; CHECK-NEON-NEXT: moveq [[REGISTER_2]], #4
83 ; CHECK-NEON-NEXT: adr [[REGISTER_3:r[0-9]+]], LCPI
78 ; CHECK-NEON: adr r2, LCPI7_0
79 ; CHECK-NEON-NEXT: movw r3, #1123
80 ; CHECK-NEON-NEXT: adds r1, r2, #4
81 ; CHECK-NEON-NEXT: cmp r0, r3
82 ; CHECK-NEON-NEXT: it ne
83 ; CHECK-NEON-NEXT: movne r1, r2
8484 ; CHECK-NEON-NEXT: ldr
8585 ; CHECK-NEON: bx
8686