[PATCH] D20769: [IPRA] Interprocedural Register Allocation - Analysis Passes

Mehdi AMINI via llvm-commits llvm-commits at lists.llvm.org
Sun Jun 5 10:35:19 PDT 2016


mehdi_amini added inline comments.

================
Comment at: include/llvm/CodeGen/RegisterUsageInfo.h:49
@@ +48,3 @@
+
+  bool doFinalization(Module &M) override {
+    RegMasks.shrink_and_clear();
----------------
add a method print() like other analysis, and call it here behind a flag.

================
Comment at: include/llvm/CodeGen/RegisterUsageInfo.h:54
@@ +53,3 @@
+
+  void storeUpdateRegUsageInfo(const GlobalVariable* MFGlobalVar,
+                               std::vector<uint32_t> RegMasks);
----------------
Doxygen

================
Comment at: include/llvm/CodeGen/RegisterUsageInfo.h:57
@@ +56,3 @@
+
+  const std::vector<uint32_t> *getRegUsageInfo(const GlobalVariable* MFGlobalVar);
+
----------------
Doxygen

================
Comment at: test/CodeGen/Generic/reg-usage-info.ll:2
@@ +1,3 @@
+; RUN: llc -enable-ipra -debug-only=ip-regalloc -o /dev/null 2>&1 < %s  | FileCheck %s
+; REQUIRES: asserts
+; CHECK: Function Name : fib
----------------
I don't like that we can't pass the test in release mode. I suggested that the dump occurs in `doFinalization()` for the analysis pass (i.e. `PhysicalRegisterUsageInfo`).  You need to implement a proper cl::opt that controls a dump there, that could be used in release mode.

================
Comment at: test/CodeGen/Generic/reg-usage-info.ll:4
@@ +3,3 @@
+; CHECK: Function Name : fib
+; CHECK: Clobbered Registers: 1 3 19 35 2 3 19 35 4 8 21 37 5 8 21 37 15 14 23 39 25 1 3 19 35 2 3 19 35 7 6 20 36 4 8 21 37 5 8 21 37 48 47 30 44
+
----------------
I'm worried that we don't provide any stability guarantee on the numbers printed here.
Having a nicer textual form would be better. 
I just don't see how to do it other than keep a pointer to the TRI in the DenseMap in the immutable pass to be able to get the register name.


http://reviews.llvm.org/D20769





More information about the llvm-commits mailing list