[PATCH] Add NVPTXPeephole pass to reduce unnecessary address cast

Jingyue Wu jingyue at google.com
Thu Jun 18 21:02:15 PDT 2015


================
Comment at: lib/Target/NVPTX/NVPTXFrameLowering.cpp:51
@@ +50,3 @@
+      if (MR.hasOneNonDBGUse(NVPTX::VRFrame)) {
+        MI = BuildMI(MBB, MI, dl, MF.getSubtarget().getInstrInfo()->get(
+                                      NVPTX::cvta_local_yes_64),
----------------
I'd run clang-format on this file again. Indentation changed since your last modification. 

================
Comment at: lib/Target/NVPTX/NVPTXPeephole.cpp:18
@@ +17,3 @@
+// this address with their .local versions, but this may introduce a lot of
+// cvta.to.local instructions. Performance can be improved if we avoid to cast
+// address back and forth and directly calculate local address based on %SPL.
----------------
"avoid casting"

================
Comment at: lib/Target/NVPTX/NVPTXPeephole.cpp:89
@@ +88,3 @@
+  auto &BaseAddrOp = GenericAddrDef->getOperand(1);
+  if (BaseAddrOp.getType() == MachineOperand::MO_FrameIndex) {
+    return true;
----------------
wengxt wrote:
> jingyue wrote:
> > Could there be multiple frame indices? `fi#0`, `fi#1`, ...
> Fixed
Did you miss uploading something? I didn't see anything's changed.

http://reviews.llvm.org/D10549

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






More information about the llvm-commits mailing list