[PATCH] D92219: [AMDGPU] Constant fold S_PACK instructions

Jay Foad via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri Nov 27 03:31:25 PST 2020


foad added inline comments.


================
Comment at: llvm/lib/Target/AMDGPU/SIFoldOperands.cpp:980-988
+  case AMDGPU::S_PACK_LL_B32_B16:
+    Result = (LHS & 0xffff) | ((RHS & 0xffff) << 16);
+    return true;
+  case AMDGPU::S_PACK_LH_B32_B16:
+    Result = (LHS & 0xffff) | (RHS & 0xffff0000);
+    return true;
+  case AMDGPU::S_PACK_HH_B32_B16:
----------------
I would prefer not to add more ad hoc constant folding to this pass. Can you work out where the un-folded pack instructions are coming from in the first place, and fix it there instead?


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D92219



More information about the llvm-commits mailing list