[llvm] [RISCV][GISel] Legalize G_SMULO/G_UMULO (PR #67635)

Craig Topper via llvm-commits llvm-commits at lists.llvm.org
Thu Sep 28 10:05:09 PDT 2023


================
@@ -145,13 +145,21 @@ RISCVLegalizerInfo::RISCVLegalizerInfo(const RISCVSubtarget &ST) {
         .legalFor({XLenLLT})
         .lower();
     // clang-format on
+
+    getActionDefinitionsBuilder({G_SMULO, G_UMULO})
----------------
topperc wrote:

The widening of small types creates an XLenLLT sized G_SMULO even though that can't overflow if the small type was half of XLen or less. I don't know how to distinquish that G_SMULO from the original. So I ended up with a double XLen libcall no matter what which is not really what I wanted.

I guess I could write custom legalization for everything, but didn't seem ideal.

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


More information about the llvm-commits mailing list