Skip to content

[RISCV] Use Root instead of N throughout the worklist loop in combineBinOp_VLToVWBinOp_VL. #99416

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 3 commits into from
Jul 18, 2024

Conversation

topperc
Copy link
Collaborator

@topperc topperc commented Jul 18, 2024

We were only checking that the node from the worklist is a supported root. We weren't checking the strategy or any of its operands unless it was the original node. For any other node, we just rechecked the original node's strategy and operands.

The effect of this is that we don't do all of the transformations at once. Instead, when there were multiple possible nodes to transform we would only do them as each node was visited by the main DAG combine worklist.

The test shows a case where we widened an instruction without removing all of the uses of the vsext. The sext is shared by one node that shares another sext node with the root another node that doesn't share anything with the root.

…BinOp_VLToVWBinOp_VL.

We were only checking that the node from the worklist is a supported
root. We weren't checking the strategy or any of its operands unless
it was the original node. For any other node, we just rechecked the
original node's strategy and operands.

The effect of this is that we don't do all of the transformations at
once. Instead, when there were multiple possible nodes to transform
we would only do them as each node was visited by the main DAG combine
worklist.

I'm not sure if there's a way to construct a test to show this
or not. I'll keep trying.
@llvmbot
Copy link
Member

llvmbot commented Jul 18, 2024

@llvm/pr-subscribers-backend-risc-v

Author: Craig Topper (topperc)

Changes

We were only checking that the node from the worklist is a supported root. We weren't checking the strategy or any of its operands unless it was the original node. For any other node, we just rechecked the original node's strategy and operands.

The effect of this is that we don't do all of the transformations at once. Instead, when there were multiple possible nodes to transform we would only do them as each node was visited by the main DAG combine worklist.

I'm not sure if there's a way to construct a test to show this or not. I'll keep trying.


Full diff: https://github.com/llvm/llvm-project/pull/99416.diff

1 Files Affected:

  • (modified) llvm/lib/Target/RISCV/RISCVISelLowering.cpp (+5-5)
diff --git a/llvm/lib/Target/RISCV/RISCVISelLowering.cpp b/llvm/lib/Target/RISCV/RISCVISelLowering.cpp
index 21193ebe1eb94..e938454b8e642 100644
--- a/llvm/lib/Target/RISCV/RISCVISelLowering.cpp
+++ b/llvm/lib/Target/RISCV/RISCVISelLowering.cpp
@@ -14998,8 +14998,8 @@ static SDValue combineBinOp_VLToVWBinOp_VL(SDNode *N,
     if (!NodeExtensionHelper::isSupportedRoot(Root, Subtarget))
       return SDValue();
 
-    NodeExtensionHelper LHS(N, 0, DAG, Subtarget);
-    NodeExtensionHelper RHS(N, 1, DAG, Subtarget);
+    NodeExtensionHelper LHS(Root, 0, DAG, Subtarget);
+    NodeExtensionHelper RHS(Root, 1, DAG, Subtarget);
     auto AppendUsersIfNeeded = [&Worklist,
                                 &Inserted](const NodeExtensionHelper &Op) {
       if (Op.needToPromoteOtherUsers()) {
@@ -15016,18 +15016,18 @@ static SDValue combineBinOp_VLToVWBinOp_VL(SDNode *N,
       return SDValue();
 
     SmallVector<NodeExtensionHelper::CombineToTry> FoldingStrategies =
-        NodeExtensionHelper::getSupportedFoldings(N);
+        NodeExtensionHelper::getSupportedFoldings(Root);
 
     assert(!FoldingStrategies.empty() && "Nothing to be folded");
     bool Matched = false;
     for (int Attempt = 0;
-         (Attempt != 1 + NodeExtensionHelper::isCommutative(N)) && !Matched;
+         (Attempt != 1 + NodeExtensionHelper::isCommutative(Root)) && !Matched;
          ++Attempt) {
 
       for (NodeExtensionHelper::CombineToTry FoldingStrategy :
            FoldingStrategies) {
         std::optional<CombineResult> Res =
-            FoldingStrategy(N, LHS, RHS, DAG, Subtarget);
+            FoldingStrategy(Root, LHS, RHS, DAG, Subtarget);
         if (Res) {
           Matched = true;
           CombinesToApply.push_back(*Res);

Copy link
Collaborator

@qcolombet qcolombet left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Great catch!

Thanks for the fix

@topperc topperc merged commit 0c4023a into llvm:main Jul 18, 2024
4 of 7 checks passed
@topperc topperc deleted the pr/binop-worklist branch July 18, 2024 15:47
@llvm-ci
Copy link
Collaborator

llvm-ci commented Jul 18, 2024

LLVM Buildbot has detected a new failure on builder ml-opt-devrel-x86-64 running on ml-opt-devrel-x86-64-b1 while building llvm at step 6 "test-build-unified-tree-check-all".

Full details are available at: https://lab.llvm.org/buildbot/#/builders/175/builds/1945

Here is the relevant piece of the build log for the reference:

Step 6 (test-build-unified-tree-check-all) failure: test (failure)
******************** TEST 'LLVM :: CodeGen/RISCV/rvv/fixed-vectors-vwmul.ll' FAILED ********************
Exit Code: 1

Command Output (stderr):
--
RUN: at line 2: /b/ml-opt-devrel-x86-64-b1/build/bin/llc -mtriple=riscv32 -mattr=+v -verify-machineinstrs < /b/ml-opt-devrel-x86-64-b1/llvm-project/llvm/test/CodeGen/RISCV/rvv/fixed-vectors-vwmul.ll | /b/ml-opt-devrel-x86-64-b1/build/bin/FileCheck /b/ml-opt-devrel-x86-64-b1/llvm-project/llvm/test/CodeGen/RISCV/rvv/fixed-vectors-vwmul.ll --check-prefixes=CHECK,RV32
+ /b/ml-opt-devrel-x86-64-b1/build/bin/llc -mtriple=riscv32 -mattr=+v -verify-machineinstrs
+ /b/ml-opt-devrel-x86-64-b1/build/bin/FileCheck /b/ml-opt-devrel-x86-64-b1/llvm-project/llvm/test/CodeGen/RISCV/rvv/fixed-vectors-vwmul.ll --check-prefixes=CHECK,RV32
/b/ml-opt-devrel-x86-64-b1/llvm-project/llvm/test/CodeGen/RISCV/rvv/fixed-vectors-vwmul.ll:890:15: error: CHECK-NEXT: expected string not found in input
; CHECK-NEXT: vle8.v v8, (a1)
              ^
<stdin>:850:36: note: scanning from here
 vsetivli zero, 2, e16, mf4, ta, ma
                                   ^
<stdin>:851:2: note: possible intended match here
 vle8.v v8, (a0)
 ^

Input file: <stdin>
Check file: /b/ml-opt-devrel-x86-64-b1/llvm-project/llvm/test/CodeGen/RISCV/rvv/fixed-vectors-vwmul.ll

-dump-input=help explains the following input dump.

Input was:
<<<<<<
            .
            .
            .
          845:  .type vwmul_v2i16_multiuse,@function 
          846:  .variant_cc vwmul_v2i16_multiuse 
          847: vwmul_v2i16_multiuse: # @vwmul_v2i16_multiuse 
          848:  .cfi_startproc 
          849: # %bb.0: 
          850:  vsetivli zero, 2, e16, mf4, ta, ma 
next:890'0                                        X error: no match found
          851:  vle8.v v8, (a0) 
next:890'0     ~~~~~~~~~~~~~~~~~
next:890'1      ?                possible intended match
          852:  vle8.v v9, (a1) 
next:890'0     ~~~~~~~~~~~~~~~~~
          853:  vle8.v v10, (a2) 
next:890'0     ~~~~~~~~~~~~~~~~~~
          854:  vle8.v v11, (a3) 
next:890'0     ~~~~~~~~~~~~~~~~~~
          855:  vsext.vf2 v12, v8 
next:890'0     ~~~~~~~~~~~~~~~~~~~
          856:  vsext.vf2 v8, v9 
next:890'0     ~~~~~~~~~~~~~~~~~~
            .
            .
...

@llvm-ci
Copy link
Collaborator

llvm-ci commented Jul 18, 2024

LLVM Buildbot has detected a new failure on builder ml-opt-dev-x86-64 running on ml-opt-dev-x86-64-b1 while building llvm at step 6 "test-build-unified-tree-check-all".

Full details are available at: https://lab.llvm.org/buildbot/#/builders/137/builds/1979

Here is the relevant piece of the build log for the reference:

Step 6 (test-build-unified-tree-check-all) failure: test (failure)
******************** TEST 'LLVM :: CodeGen/RISCV/rvv/fixed-vectors-vwmul.ll' FAILED ********************
Exit Code: 1

Command Output (stderr):
--
RUN: at line 2: /b/ml-opt-dev-x86-64-b1/build/bin/llc -mtriple=riscv32 -mattr=+v -verify-machineinstrs < /b/ml-opt-dev-x86-64-b1/llvm-project/llvm/test/CodeGen/RISCV/rvv/fixed-vectors-vwmul.ll | /b/ml-opt-dev-x86-64-b1/build/bin/FileCheck /b/ml-opt-dev-x86-64-b1/llvm-project/llvm/test/CodeGen/RISCV/rvv/fixed-vectors-vwmul.ll --check-prefixes=CHECK,RV32
+ /b/ml-opt-dev-x86-64-b1/build/bin/llc -mtriple=riscv32 -mattr=+v -verify-machineinstrs
+ /b/ml-opt-dev-x86-64-b1/build/bin/FileCheck /b/ml-opt-dev-x86-64-b1/llvm-project/llvm/test/CodeGen/RISCV/rvv/fixed-vectors-vwmul.ll --check-prefixes=CHECK,RV32
/b/ml-opt-dev-x86-64-b1/llvm-project/llvm/test/CodeGen/RISCV/rvv/fixed-vectors-vwmul.ll:890:15: error: CHECK-NEXT: expected string not found in input
; CHECK-NEXT: vle8.v v8, (a1)
              ^
<stdin>:850:36: note: scanning from here
 vsetivli zero, 2, e16, mf4, ta, ma
                                   ^
<stdin>:851:2: note: possible intended match here
 vle8.v v8, (a0)
 ^

Input file: <stdin>
Check file: /b/ml-opt-dev-x86-64-b1/llvm-project/llvm/test/CodeGen/RISCV/rvv/fixed-vectors-vwmul.ll

-dump-input=help explains the following input dump.

Input was:
<<<<<<
            .
            .
            .
          845:  .type vwmul_v2i16_multiuse,@function 
          846:  .variant_cc vwmul_v2i16_multiuse 
          847: vwmul_v2i16_multiuse: # @vwmul_v2i16_multiuse 
          848:  .cfi_startproc 
          849: # %bb.0: 
          850:  vsetivli zero, 2, e16, mf4, ta, ma 
next:890'0                                        X error: no match found
          851:  vle8.v v8, (a0) 
next:890'0     ~~~~~~~~~~~~~~~~~
next:890'1      ?                possible intended match
          852:  vle8.v v9, (a1) 
next:890'0     ~~~~~~~~~~~~~~~~~
          853:  vle8.v v10, (a2) 
next:890'0     ~~~~~~~~~~~~~~~~~~
          854:  vle8.v v11, (a3) 
next:890'0     ~~~~~~~~~~~~~~~~~~
          855:  vsext.vf2 v12, v8 
next:890'0     ~~~~~~~~~~~~~~~~~~~
          856:  vsext.vf2 v8, v9 
next:890'0     ~~~~~~~~~~~~~~~~~~
            .
            .
...

@llvm-ci
Copy link
Collaborator

llvm-ci commented Jul 18, 2024

LLVM Buildbot has detected a new failure on builder clang-x86_64-debian-fast running on gribozavr4 while building llvm at step 6 "test-build-unified-tree-check-all".

Full details are available at: https://lab.llvm.org/buildbot/#/builders/56/builds/2746

Here is the relevant piece of the build log for the reference:

Step 6 (test-build-unified-tree-check-all) failure: test (failure)
******************** TEST 'LLVM :: CodeGen/RISCV/rvv/fixed-vectors-vwmul.ll' FAILED ********************
Exit Code: 1

Command Output (stderr):
--
RUN: at line 2: /b/1/clang-x86_64-debian-fast/llvm.obj/bin/llc -mtriple=riscv32 -mattr=+v -verify-machineinstrs < /b/1/clang-x86_64-debian-fast/llvm.src/llvm/test/CodeGen/RISCV/rvv/fixed-vectors-vwmul.ll | /b/1/clang-x86_64-debian-fast/llvm.obj/bin/FileCheck /b/1/clang-x86_64-debian-fast/llvm.src/llvm/test/CodeGen/RISCV/rvv/fixed-vectors-vwmul.ll --check-prefixes=CHECK,RV32
+ /b/1/clang-x86_64-debian-fast/llvm.obj/bin/FileCheck /b/1/clang-x86_64-debian-fast/llvm.src/llvm/test/CodeGen/RISCV/rvv/fixed-vectors-vwmul.ll --check-prefixes=CHECK,RV32
+ /b/1/clang-x86_64-debian-fast/llvm.obj/bin/llc -mtriple=riscv32 -mattr=+v -verify-machineinstrs
/b/1/clang-x86_64-debian-fast/llvm.src/llvm/test/CodeGen/RISCV/rvv/fixed-vectors-vwmul.ll:890:15: error: CHECK-NEXT: expected string not found in input
; CHECK-NEXT: vle8.v v8, (a1)
              ^
<stdin>:850:36: note: scanning from here
 vsetivli zero, 2, e16, mf4, ta, ma
                                   ^
<stdin>:851:2: note: possible intended match here
 vle8.v v8, (a0)
 ^

Input file: <stdin>
Check file: /b/1/clang-x86_64-debian-fast/llvm.src/llvm/test/CodeGen/RISCV/rvv/fixed-vectors-vwmul.ll

-dump-input=help explains the following input dump.

Input was:
<<<<<<
            .
            .
            .
          845:  .type vwmul_v2i16_multiuse,@function 
          846:  .variant_cc vwmul_v2i16_multiuse 
          847: vwmul_v2i16_multiuse: # @vwmul_v2i16_multiuse 
          848:  .cfi_startproc 
          849: # %bb.0: 
          850:  vsetivli zero, 2, e16, mf4, ta, ma 
next:890'0                                        X error: no match found
          851:  vle8.v v8, (a0) 
next:890'0     ~~~~~~~~~~~~~~~~~
next:890'1      ?                possible intended match
          852:  vle8.v v9, (a1) 
next:890'0     ~~~~~~~~~~~~~~~~~
          853:  vle8.v v10, (a2) 
next:890'0     ~~~~~~~~~~~~~~~~~~
          854:  vle8.v v11, (a3) 
next:890'0     ~~~~~~~~~~~~~~~~~~
          855:  vsext.vf2 v12, v8 
next:890'0     ~~~~~~~~~~~~~~~~~~~
          856:  vsext.vf2 v8, v9 
next:890'0     ~~~~~~~~~~~~~~~~~~
            .
            .
...

@llvm-ci
Copy link
Collaborator

llvm-ci commented Jul 18, 2024

LLVM Buildbot has detected a new failure on builder ml-opt-rel-x86-64 running on ml-opt-rel-x86-64-b2 while building llvm at step 6 "test-build-unified-tree-check-all".

Full details are available at: https://lab.llvm.org/buildbot/#/builders/185/builds/1957

Here is the relevant piece of the build log for the reference:

Step 6 (test-build-unified-tree-check-all) failure: test (failure)
******************** TEST 'LLVM :: CodeGen/RISCV/rvv/fixed-vectors-vwmul.ll' FAILED ********************
Exit Code: 1

Command Output (stderr):
--
RUN: at line 2: /b/ml-opt-rel-x86-64-b1/build/bin/llc -mtriple=riscv32 -mattr=+v -verify-machineinstrs < /b/ml-opt-rel-x86-64-b1/llvm-project/llvm/test/CodeGen/RISCV/rvv/fixed-vectors-vwmul.ll | /b/ml-opt-rel-x86-64-b1/build/bin/FileCheck /b/ml-opt-rel-x86-64-b1/llvm-project/llvm/test/CodeGen/RISCV/rvv/fixed-vectors-vwmul.ll --check-prefixes=CHECK,RV32
+ /b/ml-opt-rel-x86-64-b1/build/bin/FileCheck /b/ml-opt-rel-x86-64-b1/llvm-project/llvm/test/CodeGen/RISCV/rvv/fixed-vectors-vwmul.ll --check-prefixes=CHECK,RV32
+ /b/ml-opt-rel-x86-64-b1/build/bin/llc -mtriple=riscv32 -mattr=+v -verify-machineinstrs
/b/ml-opt-rel-x86-64-b1/llvm-project/llvm/test/CodeGen/RISCV/rvv/fixed-vectors-vwmul.ll:890:15: error: CHECK-NEXT: expected string not found in input
; CHECK-NEXT: vle8.v v8, (a1)
              ^
<stdin>:850:36: note: scanning from here
 vsetivli zero, 2, e16, mf4, ta, ma
                                   ^
<stdin>:851:2: note: possible intended match here
 vle8.v v8, (a0)
 ^

Input file: <stdin>
Check file: /b/ml-opt-rel-x86-64-b1/llvm-project/llvm/test/CodeGen/RISCV/rvv/fixed-vectors-vwmul.ll

-dump-input=help explains the following input dump.

Input was:
<<<<<<
            .
            .
            .
          845:  .type vwmul_v2i16_multiuse,@function 
          846:  .variant_cc vwmul_v2i16_multiuse 
          847: vwmul_v2i16_multiuse: # @vwmul_v2i16_multiuse 
          848:  .cfi_startproc 
          849: # %bb.0: 
          850:  vsetivli zero, 2, e16, mf4, ta, ma 
next:890'0                                        X error: no match found
          851:  vle8.v v8, (a0) 
next:890'0     ~~~~~~~~~~~~~~~~~
next:890'1      ?                possible intended match
          852:  vle8.v v9, (a1) 
next:890'0     ~~~~~~~~~~~~~~~~~
          853:  vle8.v v10, (a2) 
next:890'0     ~~~~~~~~~~~~~~~~~~
          854:  vle8.v v11, (a3) 
next:890'0     ~~~~~~~~~~~~~~~~~~
          855:  vsext.vf2 v12, v8 
next:890'0     ~~~~~~~~~~~~~~~~~~~
          856:  vsext.vf2 v8, v9 
next:890'0     ~~~~~~~~~~~~~~~~~~
            .
            .
...

topperc added a commit that referenced this pull request Jul 18, 2024
… combineBinOp_VLToVWBinOp_VL. (#99416)"

This reverts commit 0c4023a.

I messed up re-generating the test after the change.
topperc added a commit that referenced this pull request Jul 18, 2024
… in combineBinOp_VLToVWBinOp_VL. (#99416)"

With correct test update.

Original message:

We were only checking that the node from the worklist is a supported
root. We weren't checking the strategy or any of its operands unless it
was the original node. For any other node, we just rechecked the
original node's strategy and operands.

The effect of this is that we don't do all of the transformations at
once. Instead, when there were multiple possible nodes to transform we
would only do them as each node was visited by the main DAG combine
worklist.

The test shows a case where we widened an instruction without removing
all of the uses of the vsext. The sext is shared by one node that shares
another sext node with the root another node that doesn't share anything
with the root.
@llvm-ci
Copy link
Collaborator

llvm-ci commented Jul 18, 2024

LLVM Buildbot has detected a new failure on builder lld-x86_64-win running on as-worker-93 while building llvm at step 7 "test-build-unified-tree-check-all".

Full details are available at: https://lab.llvm.org/buildbot/#/builders/146/builds/298

Here is the relevant piece of the build log for the reference:

Step 7 (test-build-unified-tree-check-all) failure: test (failure)
******************** TEST 'LLVM :: CodeGen/RISCV/rvv/fixed-vectors-vwmul.ll' FAILED ********************
Exit Code: 1

Command Output (stdout):
--
# RUN: at line 2
c:\a\lld-x86_64-win\build\bin\llc.exe -mtriple=riscv32 -mattr=+v -verify-machineinstrs < C:\a\lld-x86_64-win\llvm-project\llvm\test\CodeGen\RISCV\rvv\fixed-vectors-vwmul.ll | c:\a\lld-x86_64-win\build\bin\filecheck.exe C:\a\lld-x86_64-win\llvm-project\llvm\test\CodeGen\RISCV\rvv\fixed-vectors-vwmul.ll --check-prefixes=CHECK,RV32
# executed command: 'c:\a\lld-x86_64-win\build\bin\llc.exe' -mtriple=riscv32 -mattr=+v -verify-machineinstrs
# executed command: 'c:\a\lld-x86_64-win\build\bin\filecheck.exe' 'C:\a\lld-x86_64-win\llvm-project\llvm\test\CodeGen\RISCV\rvv\fixed-vectors-vwmul.ll' --check-prefixes=CHECK,RV32
# .---command stderr------------
# | C:\a\lld-x86_64-win\llvm-project\llvm\test\CodeGen\RISCV\rvv\fixed-vectors-vwmul.ll:890:15: error: CHECK-NEXT: expected string not found in input
# | ; CHECK-NEXT: vle8.v v8, (a1)
# |               ^
# | <stdin>:850:36: note: scanning from here
# |  vsetivli zero, 2, e16, mf4, ta, ma
# |                                    ^
# | <stdin>:851:2: note: possible intended match here
# |  vle8.v v8, (a0)
# |  ^
# | 
# | Input file: <stdin>
# | Check file: C:\a\lld-x86_64-win\llvm-project\llvm\test\CodeGen\RISCV\rvv\fixed-vectors-vwmul.ll
# | 
# | -dump-input=help explains the following input dump.
# | 
# | Input was:
# | <<<<<<
# |             .
# |             .
# |             .
# |           845:  .type vwmul_v2i16_multiuse,@function 
# |           846:  .variant_cc vwmul_v2i16_multiuse 
# |           847: vwmul_v2i16_multiuse: # @vwmul_v2i16_multiuse 
# |           848:  .cfi_startproc 
# |           849: # %bb.0: 
# |           850:  vsetivli zero, 2, e16, mf4, ta, ma 
# | next:890'0                                        X error: no match found
# |           851:  vle8.v v8, (a0) 
# | next:890'0     ~~~~~~~~~~~~~~~~~
# | next:890'1      ?                possible intended match
# |           852:  vle8.v v9, (a1) 
# | next:890'0     ~~~~~~~~~~~~~~~~~
# |           853:  vle8.v v10, (a2) 
# | next:890'0     ~~~~~~~~~~~~~~~~~~
# |           854:  vle8.v v11, (a3) 
# | next:890'0     ~~~~~~~~~~~~~~~~~~
# |           855:  vsext.vf2 v12, v8 
# | next:890'0     ~~~~~~~~~~~~~~~~~~~
# |           856:  vsext.vf2 v8, v9 
# | next:890'0     ~~~~~~~~~~~~~~~~~~
...

@llvm-ci
Copy link
Collaborator

llvm-ci commented Jul 18, 2024

LLVM Buildbot has detected a new failure on builder premerge-monolithic-linux running on premerge-linux-1 while building llvm at step 7 "test-build-unified-tree-check-all".

Full details are available at: https://lab.llvm.org/buildbot/#/builders/153/builds/3421

Here is the relevant piece of the build log for the reference:

Step 7 (test-build-unified-tree-check-all) failure: test (failure)
******************** TEST 'LLVM :: CodeGen/RISCV/rvv/fixed-vectors-vwmul.ll' FAILED ********************
Exit Code: 1

Command Output (stderr):
--
RUN: at line 2: /build/buildbot/premerge-monolithic-linux/build/bin/llc -mtriple=riscv32 -mattr=+v -verify-machineinstrs < /build/buildbot/premerge-monolithic-linux/llvm-project/llvm/test/CodeGen/RISCV/rvv/fixed-vectors-vwmul.ll | /build/buildbot/premerge-monolithic-linux/build/bin/FileCheck /build/buildbot/premerge-monolithic-linux/llvm-project/llvm/test/CodeGen/RISCV/rvv/fixed-vectors-vwmul.ll --check-prefixes=CHECK,RV32
+ /build/buildbot/premerge-monolithic-linux/build/bin/llc -mtriple=riscv32 -mattr=+v -verify-machineinstrs
+ /build/buildbot/premerge-monolithic-linux/build/bin/FileCheck /build/buildbot/premerge-monolithic-linux/llvm-project/llvm/test/CodeGen/RISCV/rvv/fixed-vectors-vwmul.ll --check-prefixes=CHECK,RV32
/build/buildbot/premerge-monolithic-linux/llvm-project/llvm/test/CodeGen/RISCV/rvv/fixed-vectors-vwmul.ll:890:15: error: CHECK-NEXT: expected string not found in input
; CHECK-NEXT: vle8.v v8, (a1)
              ^
<stdin>:850:36: note: scanning from here
 vsetivli zero, 2, e16, mf4, ta, ma
                                   ^
<stdin>:851:2: note: possible intended match here
 vle8.v v8, (a0)
 ^

Input file: <stdin>
Check file: /build/buildbot/premerge-monolithic-linux/llvm-project/llvm/test/CodeGen/RISCV/rvv/fixed-vectors-vwmul.ll

-dump-input=help explains the following input dump.

Input was:
<<<<<<
            .
            .
            .
          845:  .type vwmul_v2i16_multiuse,@function 
          846:  .variant_cc vwmul_v2i16_multiuse 
          847: vwmul_v2i16_multiuse: # @vwmul_v2i16_multiuse 
          848:  .cfi_startproc 
          849: # %bb.0: 
          850:  vsetivli zero, 2, e16, mf4, ta, ma 
next:890'0                                        X error: no match found
          851:  vle8.v v8, (a0) 
next:890'0     ~~~~~~~~~~~~~~~~~
next:890'1      ?                possible intended match
          852:  vle8.v v9, (a1) 
next:890'0     ~~~~~~~~~~~~~~~~~
          853:  vle8.v v10, (a2) 
next:890'0     ~~~~~~~~~~~~~~~~~~
          854:  vle8.v v11, (a3) 
next:890'0     ~~~~~~~~~~~~~~~~~~
          855:  vsext.vf2 v12, v8 
next:890'0     ~~~~~~~~~~~~~~~~~~~
          856:  vsext.vf2 v8, v9 
next:890'0     ~~~~~~~~~~~~~~~~~~
            .
            .
...

@llvm-ci
Copy link
Collaborator

llvm-ci commented Jul 18, 2024

LLVM Buildbot has detected a new failure on builder llvm-clang-x86_64-expensive-checks-debian running on gribozavr4 while building llvm at step 6 "test-build-unified-tree-check-all".

Full details are available at: https://lab.llvm.org/buildbot/#/builders/16/builds/1964

Here is the relevant piece of the build log for the reference:

Step 6 (test-build-unified-tree-check-all) failure: test (failure)
******************** TEST 'LLVM :: CodeGen/RISCV/rvv/fixed-vectors-vwmul.ll' FAILED ********************
Exit Code: 1

Command Output (stderr):
--
RUN: at line 2: /b/1/llvm-clang-x86_64-expensive-checks-debian/build/bin/llc -mtriple=riscv32 -mattr=+v -verify-machineinstrs < /b/1/llvm-clang-x86_64-expensive-checks-debian/llvm-project/llvm/test/CodeGen/RISCV/rvv/fixed-vectors-vwmul.ll | /b/1/llvm-clang-x86_64-expensive-checks-debian/build/bin/FileCheck /b/1/llvm-clang-x86_64-expensive-checks-debian/llvm-project/llvm/test/CodeGen/RISCV/rvv/fixed-vectors-vwmul.ll --check-prefixes=CHECK,RV32
+ /b/1/llvm-clang-x86_64-expensive-checks-debian/build/bin/FileCheck /b/1/llvm-clang-x86_64-expensive-checks-debian/llvm-project/llvm/test/CodeGen/RISCV/rvv/fixed-vectors-vwmul.ll --check-prefixes=CHECK,RV32
+ /b/1/llvm-clang-x86_64-expensive-checks-debian/build/bin/llc -mtriple=riscv32 -mattr=+v -verify-machineinstrs
/b/1/llvm-clang-x86_64-expensive-checks-debian/llvm-project/llvm/test/CodeGen/RISCV/rvv/fixed-vectors-vwmul.ll:890:15: error: CHECK-NEXT: expected string not found in input
; CHECK-NEXT: vle8.v v8, (a1)
              ^
<stdin>:850:36: note: scanning from here
 vsetivli zero, 2, e16, mf4, ta, ma
                                   ^
<stdin>:851:2: note: possible intended match here
 vle8.v v8, (a0)
 ^

Input file: <stdin>
Check file: /b/1/llvm-clang-x86_64-expensive-checks-debian/llvm-project/llvm/test/CodeGen/RISCV/rvv/fixed-vectors-vwmul.ll

-dump-input=help explains the following input dump.

Input was:
<<<<<<
            .
            .
            .
          845:  .type vwmul_v2i16_multiuse,@function 
          846:  .variant_cc vwmul_v2i16_multiuse 
          847: vwmul_v2i16_multiuse: # @vwmul_v2i16_multiuse 
          848:  .cfi_startproc 
          849: # %bb.0: 
          850:  vsetivli zero, 2, e16, mf4, ta, ma 
next:890'0                                        X error: no match found
          851:  vle8.v v8, (a0) 
next:890'0     ~~~~~~~~~~~~~~~~~
next:890'1      ?                possible intended match
          852:  vle8.v v9, (a1) 
next:890'0     ~~~~~~~~~~~~~~~~~
          853:  vle8.v v10, (a2) 
next:890'0     ~~~~~~~~~~~~~~~~~~
          854:  vle8.v v11, (a3) 
next:890'0     ~~~~~~~~~~~~~~~~~~
          855:  vsext.vf2 v12, v8 
next:890'0     ~~~~~~~~~~~~~~~~~~~
          856:  vsext.vf2 v8, v9 
next:890'0     ~~~~~~~~~~~~~~~~~~
            .
            .
...

@llvm-ci
Copy link
Collaborator

llvm-ci commented Jul 18, 2024

LLVM Buildbot has detected a new failure on builder lld-x86_64-ubuntu-fast running on as-builder-4 while building llvm at step 6 "test-build-unified-tree-check-all".

Full details are available at: https://lab.llvm.org/buildbot/#/builders/33/builds/945

Here is the relevant piece of the build log for the reference:

Step 6 (test-build-unified-tree-check-all) failure: test (failure)
******************** TEST 'LLVM :: CodeGen/RISCV/rvv/fixed-vectors-vwmul.ll' FAILED ********************
Exit Code: 1

Command Output (stderr):
--
RUN: at line 2: /home/buildbot/worker/as-builder-4/ramdisk/lld-x86_64/build/bin/llc -mtriple=riscv32 -mattr=+v -verify-machineinstrs < /home/buildbot/worker/as-builder-4/ramdisk/lld-x86_64/llvm-project/llvm/test/CodeGen/RISCV/rvv/fixed-vectors-vwmul.ll | /home/buildbot/worker/as-builder-4/ramdisk/lld-x86_64/build/bin/FileCheck /home/buildbot/worker/as-builder-4/ramdisk/lld-x86_64/llvm-project/llvm/test/CodeGen/RISCV/rvv/fixed-vectors-vwmul.ll --check-prefixes=CHECK,RV32
+ /home/buildbot/worker/as-builder-4/ramdisk/lld-x86_64/build/bin/llc -mtriple=riscv32 -mattr=+v -verify-machineinstrs
+ /home/buildbot/worker/as-builder-4/ramdisk/lld-x86_64/build/bin/FileCheck /home/buildbot/worker/as-builder-4/ramdisk/lld-x86_64/llvm-project/llvm/test/CodeGen/RISCV/rvv/fixed-vectors-vwmul.ll --check-prefixes=CHECK,RV32
/home/buildbot/worker/as-builder-4/ramdisk/lld-x86_64/llvm-project/llvm/test/CodeGen/RISCV/rvv/fixed-vectors-vwmul.ll:890:15: error: CHECK-NEXT: expected string not found in input
; CHECK-NEXT: vle8.v v8, (a1)
              ^
<stdin>:850:36: note: scanning from here
 vsetivli zero, 2, e16, mf4, ta, ma
                                   ^
<stdin>:851:2: note: possible intended match here
 vle8.v v8, (a0)
 ^

Input file: <stdin>
Check file: /home/buildbot/worker/as-builder-4/ramdisk/lld-x86_64/llvm-project/llvm/test/CodeGen/RISCV/rvv/fixed-vectors-vwmul.ll

-dump-input=help explains the following input dump.

Input was:
<<<<<<
            .
            .
            .
          845:  .type vwmul_v2i16_multiuse,@function 
          846:  .variant_cc vwmul_v2i16_multiuse 
          847: vwmul_v2i16_multiuse: # @vwmul_v2i16_multiuse 
          848:  .cfi_startproc 
          849: # %bb.0: 
          850:  vsetivli zero, 2, e16, mf4, ta, ma 
next:890'0                                        X error: no match found
          851:  vle8.v v8, (a0) 
next:890'0     ~~~~~~~~~~~~~~~~~
next:890'1      ?                possible intended match
          852:  vle8.v v9, (a1) 
next:890'0     ~~~~~~~~~~~~~~~~~
          853:  vle8.v v10, (a2) 
next:890'0     ~~~~~~~~~~~~~~~~~~
          854:  vle8.v v11, (a3) 
next:890'0     ~~~~~~~~~~~~~~~~~~
          855:  vsext.vf2 v12, v8 
next:890'0     ~~~~~~~~~~~~~~~~~~~
          856:  vsext.vf2 v8, v9 
next:890'0     ~~~~~~~~~~~~~~~~~~
            .
            .
...

@llvm-ci
Copy link
Collaborator

llvm-ci commented Jul 19, 2024

LLVM Buildbot has detected a new failure on builder llvm-x86_64-debian-dylib running on gribozavr4 while building llvm at step 7 "test-build-unified-tree-check-llvm".

Full details are available at: https://lab.llvm.org/buildbot/#/builders/60/builds/2834

Here is the relevant piece of the build log for the reference:

Step 7 (test-build-unified-tree-check-llvm) failure: test (failure)
******************** TEST 'LLVM :: CodeGen/RISCV/rvv/fixed-vectors-vwmul.ll' FAILED ********************
Exit Code: 1

Command Output (stderr):
--
RUN: at line 2: /b/1/llvm-x86_64-debian-dylib/build/bin/llc -mtriple=riscv32 -mattr=+v -verify-machineinstrs < /b/1/llvm-x86_64-debian-dylib/llvm-project/llvm/test/CodeGen/RISCV/rvv/fixed-vectors-vwmul.ll | /b/1/llvm-x86_64-debian-dylib/build/bin/FileCheck /b/1/llvm-x86_64-debian-dylib/llvm-project/llvm/test/CodeGen/RISCV/rvv/fixed-vectors-vwmul.ll --check-prefixes=CHECK,RV32
+ /b/1/llvm-x86_64-debian-dylib/build/bin/llc -mtriple=riscv32 -mattr=+v -verify-machineinstrs
+ /b/1/llvm-x86_64-debian-dylib/build/bin/FileCheck /b/1/llvm-x86_64-debian-dylib/llvm-project/llvm/test/CodeGen/RISCV/rvv/fixed-vectors-vwmul.ll --check-prefixes=CHECK,RV32
/b/1/llvm-x86_64-debian-dylib/llvm-project/llvm/test/CodeGen/RISCV/rvv/fixed-vectors-vwmul.ll:890:15: error: CHECK-NEXT: expected string not found in input
; CHECK-NEXT: vle8.v v8, (a1)
              ^
<stdin>:850:36: note: scanning from here
 vsetivli zero, 2, e16, mf4, ta, ma
                                   ^
<stdin>:851:2: note: possible intended match here
 vle8.v v8, (a0)
 ^

Input file: <stdin>
Check file: /b/1/llvm-x86_64-debian-dylib/llvm-project/llvm/test/CodeGen/RISCV/rvv/fixed-vectors-vwmul.ll

-dump-input=help explains the following input dump.

Input was:
<<<<<<
            .
            .
            .
          845:  .type vwmul_v2i16_multiuse,@function 
          846:  .variant_cc vwmul_v2i16_multiuse 
          847: vwmul_v2i16_multiuse: # @vwmul_v2i16_multiuse 
          848:  .cfi_startproc 
          849: # %bb.0: 
          850:  vsetivli zero, 2, e16, mf4, ta, ma 
next:890'0                                        X error: no match found
          851:  vle8.v v8, (a0) 
next:890'0     ~~~~~~~~~~~~~~~~~
next:890'1      ?                possible intended match
          852:  vle8.v v9, (a1) 
next:890'0     ~~~~~~~~~~~~~~~~~
          853:  vle8.v v10, (a2) 
next:890'0     ~~~~~~~~~~~~~~~~~~
          854:  vle8.v v11, (a3) 
next:890'0     ~~~~~~~~~~~~~~~~~~
          855:  vsext.vf2 v12, v8 
next:890'0     ~~~~~~~~~~~~~~~~~~~
          856:  vsext.vf2 v8, v9 
next:890'0     ~~~~~~~~~~~~~~~~~~
            .
            .
...

yuxuanchen1997 pushed a commit that referenced this pull request Jul 25, 2024
…BinOp_VLToVWBinOp_VL. (#99416)

We were only checking that the node from the worklist is a supported
root. We weren't checking the strategy or any of its operands unless it
was the original node. For any other node, we just rechecked the
original node's strategy and operands.

The effect of this is that we don't do all of the transformations at
once. Instead, when there were multiple possible nodes to transform we
would only do them as each node was visited by the main DAG combine
worklist.

The test shows a case where we widened an instruction without removing
all of the uses of the vsext. The sext is shared by one node that shares
another sext node with the root another node that doesn't share anything
with the root.
yuxuanchen1997 pushed a commit that referenced this pull request Jul 25, 2024
… combineBinOp_VLToVWBinOp_VL. (#99416)"

Summary:
This reverts commit 0c4023a.

I messed up re-generating the test after the change.

Test Plan: 

Reviewers: 

Subscribers: 

Tasks: 

Tags: 


Differential Revision: https://phabricator.intern.facebook.com/D60250829
yuxuanchen1997 pushed a commit that referenced this pull request Jul 25, 2024
… in combineBinOp_VLToVWBinOp_VL. (#99416)"

Summary:
With correct test update.

Original message:

We were only checking that the node from the worklist is a supported
root. We weren't checking the strategy or any of its operands unless it
was the original node. For any other node, we just rechecked the
original node's strategy and operands.

The effect of this is that we don't do all of the transformations at
once. Instead, when there were multiple possible nodes to transform we
would only do them as each node was visited by the main DAG combine
worklist.

The test shows a case where we widened an instruction without removing
all of the uses of the vsext. The sext is shared by one node that shares
another sext node with the root another node that doesn't share anything
with the root.

Test Plan: 

Reviewers: 

Subscribers: 

Tasks: 

Tags: 


Differential Revision: https://phabricator.intern.facebook.com/D60250791
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants