1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2024-11-22 02:33:06 +01:00

[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 ac14d3966e
commit 9ec98f07d7
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
/// return {nullptr, Unknown}.
WidenIV::WidenedRecTy WidenIV::getWideRecurrence(WidenIV::NarrowIVDefUse DU) {
if (!SE->isSCEVable(DU.NarrowUse->getType()))
if (!DU.NarrowUse->getType()->isIntegerTy())
return {nullptr, Unknown};
const SCEV *NarrowExpr = SE->getSCEV(DU.NarrowUse);

View File

@ -1,7 +1,7 @@
; RUN: opt < %s -indvars -S | FileCheck %s
; 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 {