[PATCH] D88823: [CodeGen][TailDuplicator] Don't duplicate blocks with INLINEASM_BR
Bill Wendling via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Mon Oct 5 10:08:07 PDT 2020
void updated this revision to Diff 296216.
void added a comment.
Improve comment on why we're limiting tail duplication on INLINEASM_BR instruction.
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D88823/new/
https://reviews.llvm.org/D88823
Files:
llvm/lib/CodeGen/TailDuplicator.cpp
Index: llvm/lib/CodeGen/TailDuplicator.cpp
===================================================================
--- llvm/lib/CodeGen/TailDuplicator.cpp
+++ llvm/lib/CodeGen/TailDuplicator.cpp
@@ -627,6 +627,14 @@
if (PreRegAlloc && MI.isCall())
return false;
+ // Copying a block with an INLINEASM_BR instruction may result in a PHI node
+ // on the indirect path. We assume that all values used on the indirect path
+ // dominates all paths into the indirect block, i.e. don't have PHI nodes.
+ // FIXME: This may be too restrictive. Perhaps should restrict only if a
+ // value in the current block isn't used on the indirect path.
+ if (MI.getOpcode() == TargetOpcode::INLINEASM_BR)
+ return false;
+
if (MI.isBundle())
InstrCount += MI.getBundleSize();
else if (!MI.isPHI() && !MI.isMetaInstruction())
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D88823.296216.patch
Type: text/x-patch
Size: 866 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20201005/5c9a2ab6/attachment.bin>
More information about the llvm-commits
mailing list