mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2026-04-25 21:18:19 +00:00
PR9998: ashr exact %x, 31 is not equivalent to sdiv exact %x, -2147483648.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@132097 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
@@ -919,11 +919,11 @@ Instruction *InstCombiner::FoldICmpShrCst(ICmpInst &ICI, BinaryOperator *Shr,
|
||||
if (ICI.isSigned() != (Shr->getOpcode() == Instruction::AShr))
|
||||
return 0;
|
||||
|
||||
// Otherwise, all lshr and all exact ashr's are equivalent to a udiv/sdiv by
|
||||
// a power of 2. Since we already have logic to simplify these, transform
|
||||
// to div and then simplify the resultant comparison.
|
||||
// Otherwise, all lshr and most exact ashr's are equivalent to a udiv/sdiv
|
||||
// by a power of 2. Since we already have logic to simplify these,
|
||||
// transform to div and then simplify the resultant comparison.
|
||||
if (Shr->getOpcode() == Instruction::AShr &&
|
||||
!Shr->isExact())
|
||||
(!Shr->isExact() || ShAmtVal == TypeBits - 1))
|
||||
return 0;
|
||||
|
||||
// Revisit the shift (to delete it).
|
||||
|
||||
Reference in New Issue
Block a user