1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2024-11-24 19:52:54 +01:00

Reinstate this now that the offending opposite xform has been removed.

llvm-svn: 26548
This commit is contained in:
Chris Lattner 2006-03-05 19:53:55 +00:00
parent f8cbc8c4ea
commit f2bed5f46e

View File

@ -1454,6 +1454,13 @@ SDOperand DAGCombiner::visitSHL(SDNode *N) {
if (N1C && N0.getOpcode() == ISD::SRA && N1 == N0.getOperand(1))
return DAG.getNode(ISD::AND, VT, N0.getOperand(0),
DAG.getConstant(~0ULL << N1C->getValue(), VT));
// fold (shl (add x, c1), c2) -> (add (shl x, c2), c1<<c2)
if (N1C && N0.getOpcode() == ISD::ADD && N0.Val->hasOneUse() &&
isa<ConstantSDNode>(N0.getOperand(1))) {
return DAG.getNode(ISD::ADD, VT,
DAG.getNode(ISD::SHL, VT, N0.getOperand(0), N1),
DAG.getNode(ISD::SHL, VT, N0.getOperand(1), N1));
}
return SDOperand();
}