[PATCH] D99449: [GlobalISel] Implement lowering for G_ROTR and G_ROTL.

Matt Arsenault via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Mar 29 14:48:18 PDT 2021


arsenm added inline comments.


================
Comment at: llvm/lib/CodeGen/GlobalISel/LegalizerHelper.cpp:5372-5374
+  unsigned RevRot = IsLeft ? TargetOpcode::G_ROTR : TargetOpcode::G_ROTL;
+  if (LI.isLegalOrCustom({RevRot, {DstTy, SrcTy}}) &&
+      isPowerOf2_32(EltSizeInBits)) {
----------------
I believe alternate lowerings based on instruction legality should be split into separate lower* functions. That way custom lowering can pick the strategy itself, and the default function would then use these crude legality heuristics to pick which strategy to use.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D99449



More information about the llvm-commits mailing list