diff options
author | Florian Hahn <florian.hahn@arm.com> | 2018-01-26 10:36:50 +0000 |
---|---|---|
committer | Florian Hahn <florian.hahn@arm.com> | 2018-01-26 10:36:50 +0000 |
commit | 212afb9fd9c24e9f2e32d77deb7c456bee49193f (patch) | |
tree | b1e2fa13c8c5a4da1115a1e5c87dcf63023c0683 /llvm/lib/Transforms/Scalar/CallSiteSplitting.cpp | |
parent | d2cc6fd90b7d72ff0bd5705ff57c6d0980c345ba (diff) | |
download | bcm5719-llvm-212afb9fd9c24e9f2e32d77deb7c456bee49193f.tar.gz bcm5719-llvm-212afb9fd9c24e9f2e32d77deb7c456bee49193f.zip |
[CallSiteSplitting] Fix infinite loop when recording conditions.
Fix infinite loop when recording conditions by correctly marking basic
blocks as visited.
Fixes https://bugs.llvm.org/show_bug.cgi?id=36105
llvm-svn: 323515
Diffstat (limited to 'llvm/lib/Transforms/Scalar/CallSiteSplitting.cpp')
-rw-r--r-- | llvm/lib/Transforms/Scalar/CallSiteSplitting.cpp | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/llvm/lib/Transforms/Scalar/CallSiteSplitting.cpp b/llvm/lib/Transforms/Scalar/CallSiteSplitting.cpp index 3243731f07d..76358a040d9 100644 --- a/llvm/lib/Transforms/Scalar/CallSiteSplitting.cpp +++ b/llvm/lib/Transforms/Scalar/CallSiteSplitting.cpp @@ -140,10 +140,11 @@ static void recordConditions(CallSite CS, BasicBlock *Pred, recordCondition(CS, Pred, CS.getInstruction()->getParent(), Conditions); BasicBlock *From = Pred; BasicBlock *To = Pred; - SmallPtrSet<BasicBlock *, 4> Visited = {From}; + SmallPtrSet<BasicBlock *, 4> Visited; while (!Visited.count(From->getSinglePredecessor()) && (From = From->getSinglePredecessor())) { recordCondition(CS, From, To, Conditions); + Visited.insert(From); To = From; } } |