forked from OSchip/llvm-project
[IndVars] Don't widen pointers in WidenIV::getWideRecurrence
It's not a reasonable transform, and calling getSignExtendExpr() on a pointer hits an assertion.
This commit is contained in:
parent
11a0d23650
commit
6144085c29
|
@ -1359,7 +1359,7 @@ WidenIV::getExtendedOperandRecurrence(WidenIV::NarrowIVDefUse DU) {
|
||||||
/// so, return the extended recurrence and the kind of extension used. Otherwise
|
/// so, return the extended recurrence and the kind of extension used. Otherwise
|
||||||
/// return {nullptr, Unknown}.
|
/// return {nullptr, Unknown}.
|
||||||
WidenIV::WidenedRecTy WidenIV::getWideRecurrence(WidenIV::NarrowIVDefUse DU) {
|
WidenIV::WidenedRecTy WidenIV::getWideRecurrence(WidenIV::NarrowIVDefUse DU) {
|
||||||
if (!SE->isSCEVable(DU.NarrowUse->getType()))
|
if (!DU.NarrowUse->getType()->isIntegerTy())
|
||||||
return {nullptr, Unknown};
|
return {nullptr, Unknown};
|
||||||
|
|
||||||
const SCEV *NarrowExpr = SE->getSCEV(DU.NarrowUse);
|
const SCEV *NarrowExpr = SE->getSCEV(DU.NarrowUse);
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
; RUN: opt < %s -indvars -S | FileCheck %s
|
; RUN: opt < %s -indvars -S | FileCheck %s
|
||||||
|
|
||||||
; Provide legal integer types.
|
; Provide legal integer types.
|
||||||
target datalayout = "n8:16:32:64"
|
target datalayout = "e-p:32:32:32-n8:16:32:64"
|
||||||
|
|
||||||
|
|
||||||
define void @foo(i64* nocapture %x, i32 %n) nounwind {
|
define void @foo(i64* nocapture %x, i32 %n) nounwind {
|
||||||
|
|
Loading…
Reference in New Issue