[PATCH] D40158: AMDGPU: Use gfx9 carry-less add/sub instructions

Stanislav Mekhanoshin via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Nov 16 16:51:39 PST 2017


rampitec added inline comments.


================
Comment at: lib/Target/AMDGPU/SIInstrInfo.cpp:2847
            AMDGPU::COPY : AMDGPU::V_MOV_B32_e32;
   case AMDGPU::S_ADD_I32:
+  case AMDGPU::S_ADD_U32:
----------------
Should not we always return V_ADD_I32_e32 here?


================
Comment at: lib/Target/AMDGPU/SIInstrInfo.cpp:2854
+    return AMDGPU::V_ADDC_U32_e32;
   case AMDGPU::S_SUB_I32:
+  case AMDGPU::S_SUB_U32:
----------------
Same here.


================
Comment at: lib/Target/AMDGPU/SIInstrInfo.cpp:3892
+    unsigned NewOpc = Inst.getOpcode() == AMDGPU::S_ADD_I32 ?
+      AMDGPU::V_ADD_U32_e64 : AMDGPU::V_SUB_U32_e64;
+
----------------
It needs assert(Inst.getOpcode() == AMDGPU::S_ADD_I32 || Inst.getOpcode() == AMDGPU::S_SUB_I32)


https://reviews.llvm.org/D40158





More information about the llvm-commits mailing list