[PATCH] D149344: [SCEV] Replace IsAvailableOnEntry with block disposition
Nikita Popov via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Tue May 16 06:21:34 PDT 2023
nikic added a comment.
@manojgupta Thanks! Here's a somewhat reduced test case for `-passes=loop-idiom`:
define void @test() {
entry:
%alloca = alloca [64 x i8], align 16
br label %loop
loop:
%phi = phi i64 [ 0, %entry ], [ 1, %loop.latch ]
br i1 false, label %loop.exit2, label %loop.latch
loop.latch:
%or = or i64 %phi, 4
br i1 false, label %loop.exit, label %loop
loop.exit:
br label %loop2.preheader
loop.exit2:
br label %loop2.preheader
loop2.preheader:
%phi5.ph = phi ptr [ null, %loop.exit2 ], [ %alloca, %loop.exit ]
%phi6.ph = phi i64 [ 0, %loop.exit2 ], [ %or, %loop.exit ]
br label %loop2
loop2:
%phi5 = phi ptr [ %getelementptr7, %loop2 ], [ %phi5.ph, %loop2.preheader ]
%phi6 = phi i64 [ %add, %loop2 ], [ %phi6.ph, %loop2.preheader ]
%getelementptr = getelementptr i8, ptr %alloca, i64 %phi6
%load = load i8, ptr %getelementptr, align 1
store i8 %load, ptr %phi5, align 1
%getelementptr7 = getelementptr i8, ptr %phi5, i64 1
%add = add i64 %phi6, 1
%icmp = icmp eq i64 %phi6, 0
br i1 %icmp, label %loop2.exit, label %loop2
loop2.exit:
ret void
}
Triggers this assertion:
> opt: /home/npopov/repos/llvm-project/llvm/lib/Transforms/Utils/ScalarEvolutionExpander.cpp:2673: void llvm::SCEVExpanderCleaner::cleanup(): Assertion `all_of(I->users(), [&InsertedSet](Value *U) { return InsertedSet.contains(cast<Instruction>(U)); }) && "removed instruction should only be used by instructions inserted " "during expansion"' failed.
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D149344/new/
https://reviews.llvm.org/D149344
More information about the llvm-commits
mailing list