mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-02-20 14:29:27 +00:00
Don't expand sdiv by power of two before legalize, since it will likely
generate illegal nodes. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@26261 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
c2fe97e726
commit
cd6a6ed0a9
@ -731,8 +731,8 @@ SDOperand DAGCombiner::visitSDIV(SDNode *N) {
|
||||
if (TLI.MaskedValueIsZero(N1, SignBit) &&
|
||||
TLI.MaskedValueIsZero(N0, SignBit))
|
||||
return DAG.getNode(ISD::UDIV, N1.getValueType(), N0, N1);
|
||||
// fold (sdiv X, pow2) -> simple ops.
|
||||
if (N1C && N1C->getValue() && !TLI.isIntDivCheap() &&
|
||||
// fold (sdiv X, pow2) -> simple ops after legalize
|
||||
if (N1C && N1C->getValue() && !TLI.isIntDivCheap() && AfterLegalize &&
|
||||
(isPowerOf2_64(N1C->getSignExtended()) ||
|
||||
isPowerOf2_64(-N1C->getSignExtended()))) {
|
||||
// If dividing by powers of two is cheap, then don't perform the following
|
||||
|
Loading…
x
Reference in New Issue
Block a user