aboutsummaryrefslogtreecommitdiff
path: root/llvm/lib/CodeGen/TailDuplication.cpp
diff options
context:
space:
mode:
authorMatthias Braun <matze@braunis.de>2017-08-23 03:17:59 +0000
committerMatthias Braun <matze@braunis.de>2017-08-23 03:17:59 +0000
commit8426d1342d82b365f4997c3d222c349fe7fba2ac (patch)
tree97ebae8104e0c0a140bc498aa1e61a6631db5b6a /llvm/lib/CodeGen/TailDuplication.cpp
parent498117bf11d8e7be5770f5f16da398a5e372c4be (diff)
downloadllvm-8426d1342d82b365f4997c3d222c349fe7fba2ac.zip
llvm-8426d1342d82b365f4997c3d222c349fe7fba2ac.tar.gz
llvm-8426d1342d82b365f4997c3d222c349fe7fba2ac.tar.bz2
Add test case for r311511
This also changes the TailDuplicator to be configured explicitely pre/post regalloc rather than relying on the isSSA() flag. This was necessary to have `llc -run-pass` work reliably. llvm-svn: 311520
Diffstat (limited to 'llvm/lib/CodeGen/TailDuplication.cpp')
-rw-r--r--llvm/lib/CodeGen/TailDuplication.cpp5
1 files changed, 4 insertions, 1 deletions
diff --git a/llvm/lib/CodeGen/TailDuplication.cpp b/llvm/lib/CodeGen/TailDuplication.cpp
index 489a607..131b9a2 100644
--- a/llvm/lib/CodeGen/TailDuplication.cpp
+++ b/llvm/lib/CodeGen/TailDuplication.cpp
@@ -52,7 +52,10 @@ bool TailDuplicatePass::runOnMachineFunction(MachineFunction &MF) {
auto MBPI = &getAnalysis<MachineBranchProbabilityInfo>();
- Duplicator.initMF(MF, MBPI, /* LayoutMode */ false);
+ // TODO: Querying isSSA() to determine pre-/post-regalloc is fragile, better
+ // split this into two passes instead.
+ bool PreRegAlloc = MF.getRegInfo().isSSA();
+ Duplicator.initMF(MF, PreRegAlloc, MBPI, /* LayoutMode */ false);
bool MadeChange = false;
while (Duplicator.tailDuplicateBlocks())