Index: llvm/lib/Transforms/Utils/LoopUtils.cpp =================================================================== --- llvm/lib/Transforms/Utils/LoopUtils.cpp +++ llvm/lib/Transforms/Utils/LoopUtils.cpp @@ -1595,7 +1595,7 @@ // Use this type for pointer arithmetic. Type *PtrArithTy = Type::getInt8PtrTy(Ctx, AS); - if (SE->isLoopInvariant(Sc, TheLoop)) { + if (SE->isLoopInvariant(Sc, TheLoop) && CG->Members.size() == 1) { LLVM_DEBUG(dbgs() << "LAA: Adding RT check for a loop invariant ptr:" << *Ptr << "\n"); // Ptr could be in the loop body. If so, expand a new one at the correct