- UI != UE; ++UI) { // Loop over all of the uses of the alloca
-
- // Only allow nonindexed memory access instructions...
- if (MemAccessInst *MAI = dyn_cast<MemAccessInst>(*UI)) {
- if (MAI->hasIndices()) { // indexed?
- // Allow the access if there is only one index and the index is
- // zero.
- if (*MAI->idx_begin() != ConstantUInt::get(Type::UIntTy, 0) ||
- MAI->idx_begin()+1 != MAI->idx_end())
- return false;
- }
- } else {
+ UI != UE; ++UI) // Loop over all of the uses of the alloca
+ if (!isa<LoadInst>(*UI) && !isa<StoreInst>(*UI))