[llvm] [RISCV][GlobalISel] Zbkb support for G_ROTL and G_ROTR (PR #76599)

Mikhail Gudim via llvm-commits llvm-commits at lists.llvm.org
Fri Dec 29 21:37:28 PST 2023


================
@@ -101,7 +101,7 @@ RISCVLegalizerInfo::RISCVLegalizerInfo(const RISCVSubtarget &ST)
   getActionDefinitionsBuilder({G_FSHL, G_FSHR}).lower();
 
   auto &RotateActions = getActionDefinitionsBuilder({G_ROTL, G_ROTR});
-  if (ST.hasStdExtZbb()) {
+  if (ST.hasStdExtZbb() || ST.hasStdExtZbkb()) {
     RotateActions.legalFor({{s32, sXLen}, {sXLen, sXLen}});
     // Widen s32 rotate amount to s64 so SDAG patterns will match.
     if (ST.is64Bit())
----------------
mgudim wrote:

I see. I just thought that since the definition of `G_ROTL` doesn't require `type0` and `type1` to be the same  we should consider this as a possibility.

https://github.com/llvm/llvm-project/pull/76599


More information about the llvm-commits mailing list