From b566848d68b43e94948b79dad4a338770da205c9 Mon Sep 17 00:00:00 2001 From: Tim Northover Date: Mon, 5 Dec 2016 22:40:13 +0000 Subject: GlobalISel: place constants correctly in the entry block. When the entry block was empty after arg lowering, we were always placing constants at the end. This is probably hamrless while translating the same block, but horribly wrong once its terminator has been translated. So switch to inserting at the beginning. llvm-svn: 288720 --- llvm/lib/CodeGen/GlobalISel/IRTranslator.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'llvm/lib/CodeGen') diff --git a/llvm/lib/CodeGen/GlobalISel/IRTranslator.cpp b/llvm/lib/CodeGen/GlobalISel/IRTranslator.cpp index 1c0020ee693..68fec1a555f 100644 --- a/llvm/lib/CodeGen/GlobalISel/IRTranslator.cpp +++ b/llvm/lib/CodeGen/GlobalISel/IRTranslator.cpp @@ -766,7 +766,7 @@ bool IRTranslator::runOnMachineFunction(MachineFunction &MF) { // Now that we've got the ABI handling code, it's safe to set a location for // any Constants we find in the IR. if (MBB.empty()) - EntryBuilder.setMBB(MBB); + EntryBuilder.setMBB(MBB, /* Beginning */ true); else EntryBuilder.setInstr(MBB.back(), /* Before */ false); -- cgit v1.2.3