[PATCH] D42749: [MachineOutliner] Freeze registers in new functions

Geoff Berry via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Jan 31 10:46:32 PST 2018


gberry created this revision.
gberry added reviewers: MatzeB, qcolombet, paquette.
Herald added a subscriber: javed.absar.

Call MRI.freezeReservedRegs() on functions created during outlining so
that calls to isReserved() by the verifier called after this pass won't
assert.


Repository:
  rL LLVM

https://reviews.llvm.org/D42749

Files:
  lib/CodeGen/MachineOutliner.cpp
  test/CodeGen/AArch64/machine-outliner.mir


Index: test/CodeGen/AArch64/machine-outliner.mir
===================================================================
--- test/CodeGen/AArch64/machine-outliner.mir
+++ test/CodeGen/AArch64/machine-outliner.mir
@@ -1,4 +1,4 @@
-# RUN: llc -mtriple=aarch64--- -run-pass=machine-outliner %s -o - | FileCheck %s
+# RUN: llc -mtriple=aarch64--- -run-pass=machine-outliner -verify-machineinstrs %s -o - | FileCheck %s
 --- |
 
   @x = common global i32 0, align 4
Index: lib/CodeGen/MachineOutliner.cpp
===================================================================
--- lib/CodeGen/MachineOutliner.cpp
+++ lib/CodeGen/MachineOutliner.cpp
@@ -62,6 +62,7 @@
 #include "llvm/CodeGen/MachineFunction.h"
 #include "llvm/CodeGen/MachineModuleInfo.h"
 #include "llvm/CodeGen/MachineOptimizationRemarkEmitter.h"
+#include "llvm/CodeGen/MachineRegisterInfo.h"
 #include "llvm/CodeGen/Passes.h"
 #include "llvm/CodeGen/TargetInstrInfo.h"
 #include "llvm/CodeGen/TargetRegisterInfo.h"
@@ -1311,6 +1312,7 @@
     DB.finalize();
   }
 
+  MF.getRegInfo().freezeReservedRegs(MF);
   return &MF;
 }
 


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D42749.132210.patch
Type: text/x-patch
Size: 1084 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20180131/5ec1135c/attachment.bin>


More information about the llvm-commits mailing list