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

Matt Arsenault via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Sep 22 06:56:25 PDT 2021


arsenm added a comment.

Also should test globalisel



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


================
Comment at: llvm/test/CodeGen/AMDGPU/shift-opts.ll:13-14
+; CHECK-NEXT:    s_setpc_b64 s[30:31]
+  %and = and i32 %b, 31
+  %shl = shl i32 %a, %and
+  %lshr = lshr i32 %a, %and
----------------
I would prefer to split each case into a separate function. Should also test the scalar cases


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