[PATCH] [NVPTX] Move NVPTXPeephole after NVPTXPrologEpilogPass

Xuetian Weng xweng at google.com
Wed Jul 1 11:22:46 PDT 2015


================
Comment at: lib/Target/NVPTX/NVPTXPeephole.cpp:25
@@ -24,3 +24,3 @@
 // It will transform the following pattern
 //    %vreg0<def> = LEA_ADDRi64 <fi#0>, 4
 //    %vreg1<def> = cvta_to_local_yes_64 %vreg0
----------------
jingyue wrote:
> The comment here needs to be updated. 
done

================
Comment at: lib/Target/NVPTX/NVPTXPeephole.cpp:113
@@ -113,5 +112,3 @@
   // Get the correct offset
-  int FrameIndex = Prev.getOperand(1).getIndex();
-  int Offset = MF.getFrameInfo()->getObjectOffset(FrameIndex) +
-               Prev.getOperand(2).getImm();
+  auto Offset = Prev.getOperand(2).getImm();
 
----------------
jingyue wrote:
> `isCVTAToLocalCombination` should check Prev.getOperand(2) is an immediate; otherwise, things may break.  
since there's no need to use frame offset here (already replaced by NVPTXPrologEpilogPass), this is changed to directly reuse the operand instead of create a new imm.

================
Comment at: lib/Target/NVPTX/NVPTXPeephole.cpp:146-151
@@ +145,8 @@
+
+  const auto &MRI = MF.getRegInfo();
+  if (MRI.use_empty(NVPTX::VRFrame)) {
+    if (auto MI = MRI.getUniqueVRegDef(NVPTX::VRFrame)) {
+      MI->eraseFromParentAndMarkDBGValuesForRemoval();
+    }
+  }
+
----------------
jingyue wrote:
> Add a sentence explaining what this do. 
done

http://reviews.llvm.org/D10853

EMAIL PREFERENCES
  http://reviews.llvm.org/settings/panel/emailpreferences/






More information about the llvm-commits mailing list