[llvm] [RISCV] Optimize divide by constant for VP intrinsics (PR #125991)

Craig Topper via llvm-commits llvm-commits at lists.llvm.org
Thu Mar 20 10:55:11 PDT 2025


================
@@ -1277,8 +1277,8 @@ void DAGTypeLegalizer::SplitVectorResult(SDNode *N, unsigned ResNo) {
   case ISD::ADD: case ISD::VP_ADD:
   case ISD::SUB: case ISD::VP_SUB:
   case ISD::MUL: case ISD::VP_MUL:
-  case ISD::MULHS:
-  case ISD::MULHU:
+  case ISD::MULHS: case ISD::VP_MULHS:
----------------
topperc wrote:

I can't find a way to test this. The div by constant optimization that creates MULH won't fire on illegal vector types.

I guess we can leave it so we dont't forget it if we add more VP_MULH combines in the future. Its sufficiently simililar to VP_MUL that it should just work.

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


More information about the llvm-commits mailing list