mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-07-18 10:24:45 +00:00
Fix PR3667
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@65464 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
@@ -10837,7 +10837,7 @@ Instruction *InstCombiner::visitGetElementPtrInst(GetElementPtrInst &GEP) {
|
||||
// out, perform the transformation. Note, we don't know whether Scale is
|
||||
// signed or not. We'll use unsigned version of division/modulo
|
||||
// operation after making sure Scale doesn't have the sign bit set.
|
||||
if (Scale && Scale->getSExtValue() >= 0LL &&
|
||||
if (ArrayEltSize && Scale && Scale->getSExtValue() >= 0LL &&
|
||||
Scale->getZExtValue() % ArrayEltSize == 0) {
|
||||
Scale = ConstantInt::get(Scale->getType(),
|
||||
Scale->getZExtValue() / ArrayEltSize);
|
||||
|
Reference in New Issue
Block a user