Index: llvm/lib/CodeGen/CodeGenPrepare.cpp =================================================================== --- llvm/lib/CodeGen/CodeGenPrepare.cpp +++ llvm/lib/CodeGen/CodeGenPrepare.cpp @@ -278,8 +278,8 @@ /// Keep track of GEPs accessing the same data structures such as structs or /// arrays that are candidates to be split later because of their large /// size. - DenseMap< - AssertingVH, + ValueMap< + Value*, SmallVector, int64_t>, 32>> LargeOffsetGEPMap; @@ -4979,7 +4979,7 @@ // their offsets are smaller enough to fit into the addressing mode. bool CodeGenPrepare::splitLargeGEPOffsets() { bool Changed = false; - for (auto &Entry : LargeOffsetGEPMap) { + for (const auto &Entry : LargeOffsetGEPMap) { Value *OldBase = Entry.first; SmallVectorImpl, int64_t>> &LargeOffsetGEPs = Entry.second; Index: llvm/test/Transforms/CodeGenPrepare/AArch64/large-offset-gep.ll =================================================================== --- llvm/test/Transforms/CodeGenPrepare/AArch64/large-offset-gep.ll +++ llvm/test/Transforms/CodeGenPrepare/AArch64/large-offset-gep.ll @@ -145,3 +145,31 @@ while_end: ret void } + +declare i8* @llvm.strip.invariant.group.p0i8(i8*) + +define void @test_invariant_group(i32) { +; CHECK-LABEL: test_invariant_group + br i1 undef, label %8, label %7 + +;