Fix a powerpc crash on CodeGen/Generic/llvm-ct-intrinsics.ll

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@23694 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Chris Lattner 2005-10-11 17:56:34 +00:00
parent 05b57433e6
commit a179ab3016

View File

@ -724,7 +724,7 @@ SDOperand DAGCombiner::visitAND(SDNode *N) {
return DAG.getNode(ISD::AND, VT, N0.getOperand(0), N1);
}
// fold (and (or x, 0xFFFF), 0xFF) -> 0xFF
if (N0.getOpcode() == ISD::OR)
if (N0.getOpcode() == ISD::OR && N1C)
if (ConstantSDNode *ORI = dyn_cast<ConstantSDNode>(N0.getOperand(1)))
if ((ORI->getValue() & N1C->getValue()) == N1C->getValue())
return N1;