[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:
Eli Friedman 2021-07-11 17:00:14 -07:00
parent 11a0d23650
commit 6144085c29
2 changed files with 2 additions and 2 deletions

View File

@ -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);

View File

@ -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 {