In case all predecessor go to a single successor of current BB. We want to fold (not thread).
I failed to update the phi nodes properly in the last patch https://reviews.llvm.org/rL300657.
Phi nodes values are per predecessor in LLVM.
Paths
| Differential D32400
[JumpThread] We want to fold (not thread) when all predecessor go to single BB's successor. ClosedPublic Authored by trentxintong on Apr 23 2017, 9:28 AM.
Details Summary In case all predecessor go to a single successor of current BB. We want to fold (not thread). I failed to update the phi nodes properly in the last patch https://reviews.llvm.org/rL300657. Phi nodes values are per predecessor in LLVM.
Diff Detail
Event TimelineComment Actions lgtm with minor nit
This revision is now accepted and ready to land.Apr 23 2017, 1:18 PM Closed by commit rL301139: [JumpThread] We want to fold (not thread) when all predecessor go to single… (authored by trentxintong). · Explain WhyApr 23 2017, 2:09 PM This revision was automatically updated to reflect the committed changes.
Revision Contents
Diff 96310 lib/Transforms/Scalar/JumpThreading.cpp
test/Transforms/JumpThreading/fold-not-thread.ll
|
The TheOnlyDest variable name threw me off a bit. How about being 100% explicit, and using a bool SeenFirstBranchToOnlyDest;?