[llvm] [RISCV][ISel] Combine scalable vector add/sub/mul with zero/sign extension (PR #72340)

Craig Topper via llvm-commits llvm-commits at lists.llvm.org
Wed Nov 15 19:38:27 PST 2023


================
@@ -12764,6 +12788,15 @@ struct NodeExtensionHelper {
   /// Check if \p Root supports any extension folding combines.
   static bool isSupportedRoot(const SDNode *Root) {
     switch (Root->getOpcode()) {
+    case ISD::ADD:
+    case ISD::SUB:
+    case ISD::MUL: {
+      EVT VT0 = Root->getOperand(0).getValueType();
----------------
topperc wrote:

It should be sufficient to check `return N->getValueType().isScalableVector()` The operands of ISD::ADD/SUB/MUL must all have the same as the result.

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


More information about the llvm-commits mailing list