mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-09-24 23:28:41 +00:00
[IndVar] Don't widen loop compare unless IV user is sign extended.
PR21030 git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@218539 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
@@ -650,7 +650,7 @@ namespace {
|
||||
struct WideIVInfo {
|
||||
PHINode *NarrowIV;
|
||||
Type *WidestNativeType; // Widest integer type created [sz]ext
|
||||
bool IsSigned; // Was an sext user seen before a zext?
|
||||
bool IsSigned; // Was a sext user seen before a zext?
|
||||
|
||||
WideIVInfo() : NarrowIV(nullptr), WidestNativeType(nullptr),
|
||||
IsSigned(false) {}
|
||||
@@ -936,7 +936,11 @@ bool WidenIV::WidenLoopCompare(NarrowIVDefUse DU) {
|
||||
if (!Cmp)
|
||||
return false;
|
||||
|
||||
bool IsSigned = CmpInst::isSigned(Cmp->getPredicate());
|
||||
// Must be a signed compare.
|
||||
if (!CmpInst::isSigned(Cmp->getPredicate()))
|
||||
return false;
|
||||
|
||||
// Must be a signed IV user.
|
||||
if (!IsSigned)
|
||||
return false;
|
||||
|
||||
|
Reference in New Issue
Block a user