aboutsummaryrefslogtreecommitdiff
path: root/llvm/lib/CodeGen/MachineBasicBlock.cpp
diff options
context:
space:
mode:
authorBill Wendling <morbo@google.com>2020-01-07 12:53:44 -0800
committerBill Wendling <isanbard@gmail.com>2020-01-07 13:40:26 -0800
commit52366088a8e42c2f1e96e8430b84b8b65ec3f7bc (patch)
treee8a2e167aa496592c70af28529ba313de1642575 /llvm/lib/CodeGen/MachineBasicBlock.cpp
parent6652cc0cf7c0373b8af12f9e5b1a7065577a78da (diff)
downloadllvm-52366088a8e42c2f1e96e8430b84b8b65ec3f7bc.zip
llvm-52366088a8e42c2f1e96e8430b84b8b65ec3f7bc.tar.gz
llvm-52366088a8e42c2f1e96e8430b84b8b65ec3f7bc.tar.bz2
Allow output constraints on "asm goto"
Summary: Remove the restrictions that preventing "asm goto" from returning non-void values. The values returned by "asm goto" are only valid on the "fallthrough" path. Reviewers: jyknight, nickdesaulniers, hfinkel Reviewed By: jyknight, nickdesaulniers Subscribers: rsmith, hiraditya, llvm-commits, cfe-commits, craig.topper, rnk Tags: #clang, #llvm Differential Revision: https://reviews.llvm.org/D69876
Diffstat (limited to 'llvm/lib/CodeGen/MachineBasicBlock.cpp')
-rw-r--r--llvm/lib/CodeGen/MachineBasicBlock.cpp11
1 files changed, 11 insertions, 0 deletions
diff --git a/llvm/lib/CodeGen/MachineBasicBlock.cpp b/llvm/lib/CodeGen/MachineBasicBlock.cpp
index f433c4b..8928dc8 100644
--- a/llvm/lib/CodeGen/MachineBasicBlock.cpp
+++ b/llvm/lib/CodeGen/MachineBasicBlock.cpp
@@ -1109,6 +1109,17 @@ bool MachineBasicBlock::canSplitCriticalEdge(
if (Succ->isEHPad())
return false;
+ // Splitting the critical edge to a callbr's indirect block isn't advised.
+ // Don't do it in this generic function.
+ if (Succ->hasAddressTaken())
+ if (auto *cbr = dyn_cast<CallBrInst>(getBasicBlock()->getTerminator()))
+ if (auto *bb = Succ->getBasicBlock())
+ if (cbr->getDefaultDest() != bb)
+ if (llvm::any_of(cbr->getIndirectDests(), [&](const BasicBlock *succ){
+ return succ == bb;
+ }))
+ return false;
+
const MachineFunction *MF = getParent();
// Performance might be harmed on HW that implements branching using exec mask