diff options
author | Owen Anderson <resistor@mac.com> | 2015-10-09 20:17:46 +0000 |
---|---|---|
committer | Owen Anderson <resistor@mac.com> | 2015-10-09 20:17:46 +0000 |
commit | 97ca0f3f2c398424af53ad9c674230ada79ccda6 (patch) | |
tree | 471fef3abafdc2f2537cf8ec4ccdf81c680a4f71 /llvm/lib/Transforms/Scalar/LoopUnswitch.cpp | |
parent | 5b8217bc054f19b3f08f8d711151ca0053663e4c (diff) | |
download | bcm5719-llvm-97ca0f3f2c398424af53ad9c674230ada79ccda6.tar.gz bcm5719-llvm-97ca0f3f2c398424af53ad9c674230ada79ccda6.zip |
Generalize convergent check to handle invokes as well as calls.
llvm-svn: 249892
Diffstat (limited to 'llvm/lib/Transforms/Scalar/LoopUnswitch.cpp')
-rw-r--r-- | llvm/lib/Transforms/Scalar/LoopUnswitch.cpp | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/llvm/lib/Transforms/Scalar/LoopUnswitch.cpp b/llvm/lib/Transforms/Scalar/LoopUnswitch.cpp index 6d99caf1dff..0f7ce7eb052 100644 --- a/llvm/lib/Transforms/Scalar/LoopUnswitch.cpp +++ b/llvm/lib/Transforms/Scalar/LoopUnswitch.cpp @@ -506,10 +506,10 @@ bool LoopUnswitch::processCurrentLoop() { // FIXME: This could be refined to only bail if the convergent operation is // not already control-dependent on the unswitch value. for (const auto BB : currentLoop->blocks()) { - for (const auto &I : *BB) { - const auto CI = dyn_cast<CallInst>(&I); - if (!CI) continue; - if (CI->isConvergent()) + for (auto &I : *BB) { + auto CS = CallSite(&I); + if (!CS) continue; + if (CS.hasFnAttr(Attribute::Convergent)) return false; } } |