summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Transforms/Scalar/LoopUnswitch.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'llvm/lib/Transforms/Scalar/LoopUnswitch.cpp')
-rw-r--r--llvm/lib/Transforms/Scalar/LoopUnswitch.cpp8
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;
}
}
OpenPOWER on IntegriCloud