[PATCH] D19337: [Tail duplication] Handle source registers with subregisters

Quentin Colombet via llvm-commits llvm-commits at lists.llvm.org
Mon Apr 25 15:01:03 PDT 2016


qcolombet added a subscriber: qcolombet.
qcolombet requested changes to this revision.
qcolombet added a reviewer: qcolombet.
qcolombet added a comment.
This revision now requires changes to proceed.

Hi Krzysztof,

This looks mostly good to me. The change on how we add register class constrains seems broken to me and the test case could benefit some check lines and a run of opt -instnamer.

Cheers,
-Quentin


================
Comment at: lib/CodeGen/TailDuplicator.cpp:366
@@ -363,1 +365,3 @@
+          if (VI->second.SubReg == 0)
+            MRI->constrainRegClass(VI->second.Reg, MRI->getRegClass(Reg));
         }
----------------
Why do you check for the subreg here?
If you believe the adding constraints will not work, you should check the result of constrainRegClass and act accordingly.

================
Comment at: lib/CodeGen/TailDuplicator.cpp:877
@@ +876,3 @@
+/// described by CopyInfos. Append resulting instructions to Copies.
+void TailDuplicator::appendCopies(MachineBasicBlock *MBB,
+      SmallVectorImpl<std::pair<unsigned,RegSubRegPair>> &CopyInfos,
----------------
Use \p in front of variable names.

================
Comment at: test/CodeGen/Hexagon/tail-dup-subreg-map.ll:1
@@ +1,2 @@
+; RUN: llc -march=hexagon < %s
+; REQUIRES: asserts
----------------
FileCheck?


Repository:
  rL LLVM

http://reviews.llvm.org/D19337





More information about the llvm-commits mailing list