mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-06-23 01:24:30 +00:00
[IndVarSimplify] Widen loop unsigned compares.
This patch extends r217953 to handle unsigned comparison. Phabricator revision: http://reviews.llvm.org/D5526 git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@218659 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
@ -936,12 +936,8 @@ bool WidenIV::WidenLoopCompare(NarrowIVDefUse DU) {
|
||||
if (!Cmp)
|
||||
return false;
|
||||
|
||||
// Must be a signed compare.
|
||||
if (!CmpInst::isSigned(Cmp->getPredicate()))
|
||||
return false;
|
||||
|
||||
// Must be a signed IV user.
|
||||
if (!IsSigned)
|
||||
// Sign of IV user and compare must match.
|
||||
if (IsSigned != CmpInst::isSigned(Cmp->getPredicate()))
|
||||
return false;
|
||||
|
||||
Value *Op = Cmp->getOperand(Cmp->getOperand(0) == DU.NarrowDef ? 1 : 0);
|
||||
|
Reference in New Issue
Block a user