[llvm] [GVN] Support rnflow pattern matching and transform (PR #162259)

via llvm-commits llvm-commits at lists.llvm.org
Tue Mar 10 02:00:15 PDT 2026


github-actions[bot] wrote:

<!--PREMERGE ADVISOR COMMENT: Linux-->
# :penguin: Linux x64 Test Results

* 170978 tests passed
* 3024 tests skipped
* 1 test failed

## Failed Tests
(click on a test name to see its output)

### LLVM
<details>
<summary>LLVM.Transforms/GVN/PRE/gvn-min-pre.ll</summary>

```
Exit Code: 1

Command Output (stdout):
--
# RUN: at line 2
/home/gha/actions-runner/_work/llvm-project/llvm-project/build/bin/opt -passes=gvn -S < /home/gha/actions-runner/_work/llvm-project/llvm-project/llvm/test/Transforms/GVN/PRE/gvn-min-pre.ll | /home/gha/actions-runner/_work/llvm-project/llvm-project/build/bin/FileCheck /home/gha/actions-runner/_work/llvm-project/llvm-project/llvm/test/Transforms/GVN/PRE/gvn-min-pre.ll
# executed command: /home/gha/actions-runner/_work/llvm-project/llvm-project/build/bin/opt -passes=gvn -S
# note: command had no output on stdout or stderr
# executed command: /home/gha/actions-runner/_work/llvm-project/llvm-project/build/bin/FileCheck /home/gha/actions-runner/_work/llvm-project/llvm-project/llvm/test/Transforms/GVN/PRE/gvn-min-pre.ll
# .---command stderr------------
# | /home/gha/actions-runner/_work/llvm-project/llvm-project/llvm/test/Transforms/GVN/PRE/gvn-min-pre.ll:10:15: error: CHECK-NEXT: expected string not found in input
# | ; CHECK-NEXT: [[HOIST_SEXT:%.*]] = sext i32 [[INITIAL_MIN_IDX]] to i64
# |               ^
# | <stdin>:5:7: note: scanning from here
# | entry:
# |       ^
# | <stdin>:5:7: note: with "INITIAL_MIN_IDX" equal to "%initial_min_idx"
# | entry:
# |       ^
# | <stdin>:16:7: note: possible intended match here
# |  %min.idx.ext = sext i32 %min.idx to i64
# |       ^
# | /home/gha/actions-runner/_work/llvm-project/llvm-project/llvm/test/Transforms/GVN/PRE/gvn-min-pre.ll:68:15: error: CHECK-NEXT: expected string not found in input
# | ; CHECK-NEXT: [[HOIST_SEXT:%.*]] = sext i32 [[INITIAL_MIN_IDX]] to i64
# |               ^
# | <stdin>:32:7: note: scanning from here
# | entry:
# |       ^
# | <stdin>:32:7: note: with "INITIAL_MIN_IDX" equal to "%initial_min_idx"
# | entry:
# |       ^
# | <stdin>:43:7: note: possible intended match here
# |  %min.idx.ext = sext i32 %min.idx to i64
# |       ^
# | /home/gha/actions-runner/_work/llvm-project/llvm-project/llvm/test/Transforms/GVN/PRE/gvn-min-pre.ll:126:15: error: CHECK-NEXT: expected string not found in input
# | ; CHECK-NEXT: [[HOIST_SEXT:%.*]] = sext i32 [[INITIAL_MIN_IDX]] to i64
# |               ^
# | <stdin>:59:7: note: scanning from here
# | entry:
# |       ^
# | <stdin>:59:7: note: with "INITIAL_MIN_IDX" equal to "%initial_min_idx"
# | entry:
# |       ^
# | <stdin>:70:7: note: possible intended match here
# |  %min.idx.ext = sext i32 %min.idx to i64
# |       ^
# | 
# | Input file: <stdin>
# | Check file: /home/gha/actions-runner/_work/llvm-project/llvm-project/llvm/test/Transforms/GVN/PRE/gvn-min-pre.ll
# | 
# | -dump-input=help explains the following input dump.
# | 
# | Input was:
# | <<<<<<
# |             1: ; ModuleID = '<stdin>' 
# |             2: source_filename = "<stdin>" 
# |             3:  
# |             4: define void @test_gvn_min_pattern(ptr %0, i32 %initial_min_idx) { 
# |             5: entry: 
# | next:10'0            X error: no match found
# | next:10'1              with "INITIAL_MIN_IDX" equal to "%initial_min_idx"
# |             6:  br label %loop 
# | next:10'0      ~~~~~~~~~~~~~~~~
# |             7:  
# | next:10'0      ~
# |             8: loop: ; preds = %loop, %entry 
# | next:10'0      ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
# |             9:  %indvars.iv.i = phi i64 [ 1, %entry ], [ %indvars.iv.next.i, %loop ] 
# | next:10'0      ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
# |            10:  %loop.counter = phi i64 [ 0, %entry ], [ %loop.counter.next, %loop ] 
# | next:10'0      ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
# |            11:  %min.idx = phi i32 [ %initial_min_idx, %entry ], [ %min.idx.next, %loop ] 
# | next:10'0      ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
# |            12:  %indvars.iv.next.i = add nsw i64 %indvars.iv.i, -1 
# | next:10'0      ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
# |            13:  %ptr.float.iv = getelementptr float, ptr %0, i64 %indvars.iv.i 
# | next:10'0      ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
# |            14:  %ptr.first.load = getelementptr i8, ptr %ptr.float.iv, i64 -8 
# | next:10'0      ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
# |            15:  %val.first = load float, ptr %ptr.first.load, align 4 
# | next:10'0      ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
# |            16:  %min.idx.ext = sext i32 %min.idx to i64 
# | next:10'0      ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
# | next:10'2            ?                                   possible intended match
# |            17:  %ptr.float.min = getelementptr float, ptr %0, i64 %min.idx.ext 
# | next:10'0      ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
# |            18:  %ptr.second.load = getelementptr i8, ptr %ptr.float.min, i64 -4 
# | next:10'0      ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
# |            19:  %val.current.min = load float, ptr %ptr.second.load, align 4 
# | next:10'0      ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
# |            20:  %cmp = fcmp contract olt float %val.first, %val.current.min 
# | next:10'0      ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
# |            21:  %next.idx.trunc = trunc nsw i64 %indvars.iv.next.i to i32 
# | next:10'0      ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
# |             .
# |             .
# |             .
# |            27: exit: ; preds = %loop 
# | next:10'0      ~~~~~~~~~~~~~~~~~~~~~~
# |            28:  ret void 
# | next:10'0      ~~~~~~~~~~
# |            29: } 
# | next:10'0      ~~
# |            30:  
# | next:10'0      ~
# |            31: define void @test_gvn_min_pattern_i32(ptr %arr, i32 %initial_min_idx) { 
# | next:10'0      ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
# |            32: entry: 
# | next:68'0            X error: no match found
# | next:68'1              with "INITIAL_MIN_IDX" equal to "%initial_min_idx"
# |            33:  br label %loop 
# | next:68'0      ~~~~~~~~~~~~~~~~
# |            34:  
# | next:68'0      ~
# |            35: loop: ; preds = %loop, %entry 
# | next:68'0      ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
# |            36:  %indvars.iv.i = phi i64 [ 1, %entry ], [ %indvars.iv.next.i, %loop ] 
# | next:68'0      ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
# |            37:  %loop.counter = phi i64 [ 0, %entry ], [ %loop.counter.next, %loop ] 
# | next:68'0      ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
# |            38:  %min.idx = phi i32 [ %initial_min_idx, %entry ], [ %min.idx.next, %loop ] 
# | next:68'0      ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
# |            39:  %indvars.iv.next.i = add nsw i64 %indvars.iv.i, -1 
# | next:68'0      ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
# |            40:  %ptr.i32.iv = getelementptr i32, ptr %arr, i64 %indvars.iv.i 
# | next:68'0      ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
# |            41:  %ptr.first.load = getelementptr i8, ptr %ptr.i32.iv, i64 -8 
# | next:68'0      ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
# |            42:  %val.first = load i32, ptr %ptr.first.load, align 4 
# | next:68'0      ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
# |            43:  %min.idx.ext = sext i32 %min.idx to i64 
# | next:68'0      ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
# | next:68'2            ?                                   possible intended match
# |            44:  %ptr.i32.min = getelementptr i32, ptr %arr, i64 %min.idx.ext 
# | next:68'0      ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
# |            45:  %ptr.second.load = getelementptr i8, ptr %ptr.i32.min, i64 -4 
# | next:68'0      ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
# |            46:  %val.current.min = load i32, ptr %ptr.second.load, align 4 
# | next:68'0      ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
# |            47:  %cmp = icmp slt i32 %val.first, %val.current.min 
# | next:68'0      ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
# |            48:  %next.idx.trunc = trunc nsw i64 %indvars.iv.next.i to i32 
# | next:68'0      ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
# |             .
# |             .
# |             .
# |            54: exit: ; preds = %loop 
# | next:68'0      ~~~~~~~~~~~~~~~~~~~~~~
# |            55:  ret void 
# | next:68'0      ~~~~~~~~~~
# |            56: } 
# | next:68'0      ~~
# |            57:  
# | next:68'0      ~
# |            58: define void @test_gvn_min_pattern_i64(ptr %0, i32 %initial_min_idx) { 
# | next:68'0      ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
# |            59: entry: 
# | next:126'0           X error: no match found
# | next:126'1             with "INITIAL_MIN_IDX" equal to "%initial_min_idx"
# |            60:  br label %loop 
# | next:126'0     ~~~~~~~~~~~~~~~~
# |            61:  
# | next:126'0     ~
# |            62: loop: ; preds = %loop, %entry 
# | next:126'0     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
# |            63:  %indvars.iv.i = phi i64 [ 1, %entry ], [ %indvars.iv.next.i, %loop ] 
# | next:126'0     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
# |            64:  %loop.counter = phi i64 [ 0, %entry ], [ %loop.counter.next, %loop ] 
# | next:126'0     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
# |            65:  %min.idx = phi i32 [ %initial_min_idx, %entry ], [ %min.idx.next, %loop ] 
# | next:126'0     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
# |            66:  %indvars.iv.next.i = add nsw i64 %indvars.iv.i, -1 
# | next:126'0     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
# |            67:  %ptr.i64.iv = getelementptr i64, ptr %0, i64 %indvars.iv.i 
# | next:126'0     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
# |            68:  %ptr.first.load = getelementptr i8, ptr %ptr.i64.iv, i64 -8 
# | next:126'0     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
# |            69:  %val.first = load i64, ptr %ptr.first.load, align 4 
# | next:126'0     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
# |            70:  %min.idx.ext = sext i32 %min.idx to i64 
# | next:126'0     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
# | next:126'2           ?                                   possible intended match
# |            71:  %ptr.i64.min = getelementptr i64, ptr %0, i64 %min.idx.ext 
# | next:126'0     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
# |            72:  %ptr.second.load = getelementptr i8, ptr %ptr.i64.min, i64 -4 
# | next:126'0     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
# |            73:  %val.current.min = load i64, ptr %ptr.second.load, align 4 
# | next:126'0     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
# |            74:  %cmp = icmp slt i64 %val.first, %val.current.min 
# | next:126'0     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
# |            75:  %next.idx.trunc = trunc nsw i64 %indvars.iv.next.i to i32 
# | next:126'0     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
# |             .
# |             .
# |             .
# | >>>>>>
# `-----------------------------
# error: command failed with exit status: 1

--

```
</details>

If these failures are unrelated to your changes (for example tests are broken or flaky at HEAD), please open an issue at https://github.com/llvm/llvm-project/issues and add the `infrastructure` label.

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


More information about the llvm-commits mailing list