mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-01-01 00:33:09 +00:00
DAGCombine should not produce ISD::OR nodes after operation legalization if they're not legal.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@200503 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
21f09088d3
commit
45b07e157c
@ -1544,10 +1544,12 @@ SDValue DAGCombiner::visitADD(SDNode *N) {
|
||||
|
||||
// If all possibly-set bits on the LHS are clear on the RHS, return an OR.
|
||||
// If all possibly-set bits on the RHS are clear on the LHS, return an OR.
|
||||
if ((RHSZero & ~LHSZero) == ~LHSZero || (LHSZero & ~RHSZero) == ~RHSZero)
|
||||
if ((RHSZero & ~LHSZero) == ~LHSZero || (LHSZero & ~RHSZero) == ~RHSZero){
|
||||
if (!LegalOperations || TLI.isOperationLegal(ISD::OR, VT))
|
||||
return DAG.getNode(ISD::OR, SDLoc(N), VT, N0, N1);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// fold (add (shl (add x, c1), c2), ) -> (add (add (shl x, c2), c1<<c2), )
|
||||
if (N0.getOpcode() == ISD::SHL && N0.getNode()->hasOneUse()) {
|
||||
|
Loading…
Reference in New Issue
Block a user