[PATCH] D40728: [CallSiteSplitting] Refactor creating callsites.
Jun Bum Lim via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Thu Dec 7 08:42:45 PST 2017
junbuml added inline comments.
================
Comment at: lib/Transforms/Scalar/CallSiteSplitting.cpp:143
+ BasicBlock *To = Pred;
+ while ((From = From->getSinglePredecessor())) {
+ recordCondition(CS, From, To, Conditions);
----------------
We should not revisit the same predecessor. Otherwise, it might get into infinite loop if header is unreachable from the entry and we have a backedge from TBB to header :
```
define i32 @test(i32* %a, i32 %v, i32 %p) {
Entry:
br label %End
Header:
%tobool2 = icmp eq i32 %p, 10
br i1 %tobool2, label %Tail, label %TBB
TBB:
%cmp = icmp eq i32 %v, 1
br i1 %cmp, label %Tail, label %Header
Tail:
%r = call i32 @callee(i32* %a, i32 %v, i32 %p)
ret i32 %r
End:
ret i32 %v
}
```
https://reviews.llvm.org/D40728
More information about the llvm-commits
mailing list