[PATCH] D30038: [ADMGPU] SDWA peephole optimization pass.

Stanislav Mekhanoshin via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Mar 6 11:18:54 PST 2017


rampitec added inline comments.


================
Comment at: lib/Target/AMDGPU/SIPeepholeSDWA.cpp:196
+  int SecondBBNum = SecondBB->getNumber();
+  return FirstBBNum >= 0 && SecondBBNum >= 0 && FirstBBNum == SecondBBNum;
+}
----------------
You still do not need logic more than FirstMI->getParent() == SecondMI->getParent()


================
Comment at: lib/Target/AMDGPU/SIPeepholeSDWA.cpp:218
+
+static bool isSubregOf(const MachineOperand &SubReg,
+                       const MachineOperand &SuperReg,
----------------
TRI->getMatchingSuperReg() or TRI->getMatchingSuperRegClass() maybe?


================
Comment at: lib/Target/AMDGPU/SIPeepholeSDWA.cpp:231
+  LaneBitmask::Type SuperMask =
+      TRI->getSubRegIndexLaneMask(SuperReg.getSubReg()).getAsInteger();
+  LaneBitmask::Type SubMask =
----------------
No need to convert lanemask to integer and back.


https://reviews.llvm.org/D30038





More information about the llvm-commits mailing list