aboutsummaryrefslogtreecommitdiff
path: root/llvm/lib/Transforms/Instrumentation/ControlHeightReduction.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'llvm/lib/Transforms/Instrumentation/ControlHeightReduction.cpp')
-rw-r--r--llvm/lib/Transforms/Instrumentation/ControlHeightReduction.cpp5
1 files changed, 5 insertions, 0 deletions
diff --git a/llvm/lib/Transforms/Instrumentation/ControlHeightReduction.cpp b/llvm/lib/Transforms/Instrumentation/ControlHeightReduction.cpp
index 3420256..3b4d80d 100644
--- a/llvm/lib/Transforms/Instrumentation/ControlHeightReduction.cpp
+++ b/llvm/lib/Transforms/Instrumentation/ControlHeightReduction.cpp
@@ -767,6 +767,11 @@ CHRScope * CHR::findScope(Region *R) {
for (BasicBlock *Pred : predecessors(Entry))
if (R->contains(Pred))
return nullptr;
+ // If any of the basic blocks have address taken, we must skip this region
+ // because we cannot clone basic blocks that have address taken.
+ for (BasicBlock *BB : R->blocks())
+ if (BB->hasAddressTaken())
+ return nullptr;
if (Exit) {
// Try to find an if-then block (check if R is an if-then).
// if (cond) {