[PATCH] D110231: [AMDGPU] Add constrained shift pattern matches.

Jay Foad via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Sep 22 07:05:55 PDT 2021


foad added a comment.

Would it be better to do this as some kind of DAGCombine, so that other patterns involving shifts (like for v_lshl_add etc instructions) can take advantage of it too? I wonder how other targets do this. I see X86 has isUnneededShiftMask() which is used in PatFrags for shift instruction selection.



================
Comment at: llvm/lib/Target/AMDGPU/SIInstructions.td:2520
+def : ConstrainedI32ShiftPat<sra, V_ASHRREV_I32_e64>;
 
 // Avoid pointlessly materializing a constant in VGPR.
----------------
arsenm wrote:
> Should also handle scalar cases. Also consider handling 32-bit and 16-bit shifts
And 64-bit.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D110231



More information about the llvm-commits mailing list