[PATCH] D46570: [AMDGPU] Optimzed old value for dpp if unused

Stanislav Mekhanoshin via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue May 8 09:55:37 PDT 2018


rampitec added inline comments.


================
Comment at: lib/Target/AMDGPU/SIISelLowering.cpp:7402-7418
+  case AMDGPU::V_MOV_B32_dpp: {
+    ConstantSDNode *RM = cast<ConstantSDNode>(Node->getOperand(3));
+    ConstantSDNode *BM = cast<ConstantSDNode>(Node->getOperand(4));
+    ConstantSDNode *BC = cast<ConstantSDNode>(Node->getOperand(5));
+    if (!BC->getZExtValue() ||
+        RM->getZExtValue() != 0xf || BM->getZExtValue() != 0xf)
+      break;
----------------
arsenm wrote:
> Can this be done earlier before selection?
Theoretically this can be done as early as in the AMDGPULibCalls. Unused old value can be replaced with undef.

Why do you think it is better? I do not see any optimization which may be done based on that. At the same time before the selection we have to work with an intrinsic and after we are working with the instruction itself. Given that we may have several intrinsics leading here in the future that maybe less code potentially.


https://reviews.llvm.org/D46570





More information about the llvm-commits mailing list