Use SDValue bool check. NFCI.

llvm-svn: 243837
This commit is contained in:
Simon Pilgrim 2015-08-01 17:05:50 +00:00
parent eb35a7b797
commit b447dc5aaa
1 changed files with 10 additions and 20 deletions

View File

@ -4732,8 +4732,7 @@ SDValue DAGCombiner::visitSRL(SDNode *N) {
// fold (srl x, (trunc (and y, c))) -> (srl x, (and (trunc y), (trunc c))). // fold (srl x, (trunc (and y, c))) -> (srl x, (and (trunc y), (trunc c))).
if (N1.getOpcode() == ISD::TRUNCATE && if (N1.getOpcode() == ISD::TRUNCATE &&
N1.getOperand(0).getOpcode() == ISD::AND) { N1.getOperand(0).getOpcode() == ISD::AND) {
SDValue NewOp1 = distributeTruncateThroughAnd(N1.getNode()); if (SDValue NewOp1 = distributeTruncateThroughAnd(N1.getNode()))
if (NewOp1.getNode())
return DAG.getNode(ISD::SRL, SDLoc(N), VT, N0, NewOp1); return DAG.getNode(ISD::SRL, SDLoc(N), VT, N0, NewOp1);
} }
@ -4742,15 +4741,12 @@ SDValue DAGCombiner::visitSRL(SDNode *N) {
if (N1C && SimplifyDemandedBits(SDValue(N, 0))) if (N1C && SimplifyDemandedBits(SDValue(N, 0)))
return SDValue(N, 0); return SDValue(N, 0);
if (N1C && !N1C->isOpaque()) { if (N1C && !N1C->isOpaque())
SDValue NewSRL = visitShiftByConstant(N, N1C); if (SDValue NewSRL = visitShiftByConstant(N, N1C))
if (NewSRL.getNode())
return NewSRL; return NewSRL;
}
// Attempt to convert a srl of a load into a narrower zero-extending load. // Attempt to convert a srl of a load into a narrower zero-extending load.
SDValue NarrowLoad = ReduceLoadWidth(N); if (SDValue NarrowLoad = ReduceLoadWidth(N))
if (NarrowLoad.getNode())
return NarrowLoad; return NarrowLoad;
// Here is a common situation. We want to optimize: // Here is a common situation. We want to optimize:
@ -5511,8 +5507,7 @@ SDValue DAGCombiner::visitVSELECT(SDNode *N) {
if (N1.getOpcode() == ISD::CONCAT_VECTORS && if (N1.getOpcode() == ISD::CONCAT_VECTORS &&
N2.getOpcode() == ISD::CONCAT_VECTORS && N2.getOpcode() == ISD::CONCAT_VECTORS &&
ISD::isBuildVectorOfConstantSDNodes(N0.getNode())) { ISD::isBuildVectorOfConstantSDNodes(N0.getNode())) {
SDValue CV = ConvertSelectToConcatVector(N, DAG); if (SDValue CV = ConvertSelectToConcatVector(N, DAG))
if (CV.getNode())
return CV; return CV;
} }
@ -6363,8 +6358,7 @@ SDValue DAGCombiner::visitANY_EXTEND(SDNode *N) {
// fold (aext (truncate (load x))) -> (aext (smaller load x)) // fold (aext (truncate (load x))) -> (aext (smaller load x))
// fold (aext (truncate (srl (load x), c))) -> (aext (small load (x+c/n))) // fold (aext (truncate (srl (load x), c))) -> (aext (small load (x+c/n)))
if (N0.getOpcode() == ISD::TRUNCATE) { if (N0.getOpcode() == ISD::TRUNCATE) {
SDValue NarrowLoad = ReduceLoadWidth(N0.getNode()); if (SDValue NarrowLoad = ReduceLoadWidth(N0.getNode())) {
if (NarrowLoad.getNode()) {
SDNode* oye = N0.getNode()->getOperand(0).getNode(); SDNode* oye = N0.getNode()->getOperand(0).getNode();
if (NarrowLoad.getNode() != N0.getNode()) { if (NarrowLoad.getNode() != N0.getNode()) {
CombineTo(N0.getNode(), NarrowLoad); CombineTo(N0.getNode(), NarrowLoad);
@ -7984,8 +7978,7 @@ SDValue DAGCombiner::visitFADD(SDNode *N) {
} // enable-unsafe-fp-math } // enable-unsafe-fp-math
// FADD -> FMA combines: // FADD -> FMA combines:
SDValue Fused = visitFADDForFMACombine(N); if (SDValue Fused = visitFADDForFMACombine(N)) {
if (Fused) {
AddToWorklist(Fused.getNode()); AddToWorklist(Fused.getNode());
return Fused; return Fused;
} }
@ -8049,8 +8042,7 @@ SDValue DAGCombiner::visitFSUB(SDNode *N) {
} }
// FSUB -> FMA combines: // FSUB -> FMA combines:
SDValue Fused = visitFSUBForFMACombine(N); if (SDValue Fused = visitFSUBForFMACombine(N)) {
if (Fused) {
AddToWorklist(Fused.getNode()); AddToWorklist(Fused.getNode());
return Fused; return Fused;
} }
@ -9037,8 +9029,7 @@ SDValue DAGCombiner::visitBRCOND(SDNode *N) {
SDValue Op1 = TheXor->getOperand(1); SDValue Op1 = TheXor->getOperand(1);
if (Op0.getOpcode() == Op1.getOpcode()) { if (Op0.getOpcode() == Op1.getOpcode()) {
// Avoid missing important xor optimizations. // Avoid missing important xor optimizations.
SDValue Tmp = visitXOR(TheXor); if (SDValue Tmp = visitXOR(TheXor)) {
if (Tmp.getNode()) {
if (Tmp.getNode() != TheXor) { if (Tmp.getNode() != TheXor) {
DEBUG(dbgs() << "\nReplacing.8 "; DEBUG(dbgs() << "\nReplacing.8 ";
TheXor->dump(&DAG); TheXor->dump(&DAG);
@ -11319,8 +11310,7 @@ SDValue DAGCombiner::visitSTORE(SDNode *N) {
// Try transforming a pair floating point load / store ops to integer // Try transforming a pair floating point load / store ops to integer
// load / store ops. // load / store ops.
SDValue NewST = TransformFPLoadStorePair(N); if (SDValue NewST = TransformFPLoadStorePair(N))
if (NewST.getNode())
return NewST; return NewST;
bool UseAA = CombinerAA.getNumOccurrences() > 0 ? CombinerAA bool UseAA = CombinerAA.getNumOccurrences() > 0 ? CombinerAA