mirror of
https://github.com/RPCS3/llvm-mirror.git
synced 2025-04-14 13:40:10 +00:00
Fix PR33514
Summary: The bug was uncovered after fix of PR23384 (part 3 of 3). The patch restricts pointer multiplication in SCEV computaion for ICmpZero. Reviewers: qcolombet Differential Revision: http://reviews.llvm.org/D36170 From: Evgeny Stupachenko <evstupac@gmail.com> <evgeny.v.stupachenko@intel.com> llvm-svn: 310092
This commit is contained in:
parent
6e37795482
commit
2be9c5c55b
@ -3672,6 +3672,12 @@ void LSRInstance::GenerateICmpZeroScales(LSRUse &LU, unsigned LUIdx,
|
||||
// Don't do this if there is more than one offset.
|
||||
if (LU.MinOffset != LU.MaxOffset) return;
|
||||
|
||||
// Check if transformation is valid. It is illegal to multiply pointer.
|
||||
if (Base.ScaledReg && Base.ScaledReg->getType()->isPointerTy())
|
||||
return;
|
||||
for (const SCEV *BaseReg : Base.BaseRegs)
|
||||
if (BaseReg->getType()->isPointerTy())
|
||||
return;
|
||||
assert(!Base.BaseGV && "ICmpZero use is not legal!");
|
||||
|
||||
// Check each interesting stride.
|
||||
|
@ -45,6 +45,7 @@ try.cont: ; preds = %for.end
|
||||
; CHECK-LABEL: define void @b_copy_ctor(
|
||||
; CHECK: catchpad
|
||||
; CHECK-NEXT: icmp eq %struct.L
|
||||
; CHECK-NEXT: getelementptr {{.*}} i64 sub (i64 0, i64 ptrtoint (%struct.L* @GV2 to i64))
|
||||
; CHECK-NEXT: %4 = sub i64 0, %1
|
||||
; CHECK-NEXT: getelementptr {{.*}} getelementptr inbounds (%struct.L, %struct.L* @GV2, i32 0, i32 0), i64 %4
|
||||
|
||||
declare void @a_copy_ctor()
|
||||
|
Loading…
x
Reference in New Issue
Block a user