lets hope this doesn't break other programs with induced entropy
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@21174
91177308-0d34-0410-b5e6-
96231b3b80d8
// in this and any preceding GetElemPtr instructions.
bool foldedGEPs = false;
bool leadingNonZeroIdx = gepI && ! IsZero(*gepI->idx_begin());
- if (allConstantIndices)
+ if (allConstantIndices && !leadingNonZeroIdx)
if (Value* newPtr = FoldGetElemChain(ptrChild, idxVec, leadingNonZeroIdx)) {
ptrVal = newPtr;
foldedGEPs = true;