[PATCH] D42885: [AMDGPU] intrintrics for byte/short load/store

Matt Arsenault via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Feb 21 17:16:00 PST 2019


arsenm added inline comments.


================
Comment at: lib/Target/AMDGPU/SIISelLowering.cpp:5642-5650
+      // set node opcode if buffer_load_byte/short
+      if (Op.hasOneUse()) {
+        if (M->use_begin()->getOpcode() == ISD::SIGN_EXTEND) {
+          if (LoadVT.getScalarType() == MVT::i8)
+            Opc = AMDGPUISD::BUFFER_LOAD_BYTE;
+          else
+            Opc = AMDGPUISD::BUFFER_LOAD_SHORT;
----------------
You shouldn't be inspecting the users. You can just unconditionally use one or the other. You're going to have to insert a truncate back to the original type at the end anyway. You can then add a separate optimization to fold in the sext_inreg or mask into the buffer like is done for loads


Repository:
  rL LLVM

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D42885/new/

https://reviews.llvm.org/D42885





More information about the llvm-commits mailing list