[PATCH] D151803: [GlobalIsel][X86] Legalize G_BSWAP II

Simon Pilgrim via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Jun 1 10:52:17 PDT 2023


RKSimon added inline comments.


================
Comment at: llvm/lib/Target/X86/X86LegalizerInfo.cpp:105
+      .widenScalarToNextPow2(0, /*Min=*/32)
+      .clampScalar(0, s32, s64);
+
----------------
Add the sMax variable from D151878 instead of s64


================
Comment at: llvm/lib/Target/X86/X86LegalizerInfo.cpp:127
+        return Query.Types[0] == s32;
+      })
+      .widenScalarToNextPow2(0, /*Min=*/32)
----------------
If you're going to use legalIf, why not merge them (the plan is to get rid of the if (Subtarget.is64Bit()) if-else entirely):
```
return Query.Types[0] == s32 || (Subtarget.is64Bit() && Query.Types[0] == s64);
```


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D151803



More information about the llvm-commits mailing list