mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-07-08 15:24:21 +00:00
[LoopVectorize] Don't crash on zero-sized types in isInductionPHI
isInductionPHI wants to calculate the stride based on the pointee size. However, this is not possible when the pointee is zero sized. This fixes PR23763. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@239143 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
@ -491,6 +491,9 @@ bool llvm::isInductionPHI(PHINode *Phi, ScalarEvolution *SE,
|
||||
|
||||
const DataLayout &DL = Phi->getModule()->getDataLayout();
|
||||
int64_t Size = static_cast<int64_t>(DL.getTypeAllocSize(PointerElementType));
|
||||
if (!Size)
|
||||
return false;
|
||||
|
||||
int64_t CVSize = CV->getSExtValue();
|
||||
if (CVSize % Size)
|
||||
return false;
|
||||
|
Reference in New Issue
Block a user