From 8426d1342d82b365f4997c3d222c349fe7fba2ac Mon Sep 17 00:00:00 2001 From: Matthias Braun Date: Wed, 23 Aug 2017 03:17:59 +0000 Subject: 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 --- llvm/lib/CodeGen/TailDuplication.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'llvm/lib/CodeGen/TailDuplication.cpp') diff --git a/llvm/lib/CodeGen/TailDuplication.cpp b/llvm/lib/CodeGen/TailDuplication.cpp index 489a607eb17..131b9a22768 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(); - 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()) -- cgit v1.2.3