[llvm] extend SimplifyCFG to lower s/ucmp + 3-arm switch (PR #222786)

via llvm-commits llvm-commits at lists.llvm.org
Fri Sep 11 15:48:43 PDT 2026


github-actions[bot] wrote:

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

* 153127 tests passed
* 3317 tests skipped
* 1 test failed

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

### Flang
<details>
<summary>Flang.Driver/flang-f-opts.f90</summary>

```
Exit Code: 1

Command Output (stdout):
--
# RUN: at line 4
/home/gha/actions-runner/_work/llvm-project/llvm-project/build/bin/flang -### -S -O4 -ffp-contract=on /home/gha/actions-runner/_work/llvm-project/llvm-project/flang/test/Driver/flang-f-opts.f90 2>&1 | /home/gha/actions-runner/_work/llvm-project/llvm-project/build/bin/FileCheck /home/gha/actions-runner/_work/llvm-project/llvm-project/flang/test/Driver/flang-f-opts.f90
# executed command: /home/gha/actions-runner/_work/llvm-project/llvm-project/build/bin/flang '-###' -S -O4 -ffp-contract=on /home/gha/actions-runner/_work/llvm-project/llvm-project/flang/test/Driver/flang-f-opts.f90
# 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/flang/test/Driver/flang-f-opts.f90
# note: command had no output on stdout or stderr
# RUN: at line 12
/home/gha/actions-runner/_work/llvm-project/llvm-project/build/bin/flang -### -S -fprofile-generate /home/gha/actions-runner/_work/llvm-project/llvm-project/flang/test/Driver/flang-f-opts.f90 2>&1 | /home/gha/actions-runner/_work/llvm-project/llvm-project/build/bin/FileCheck -check-prefix=CHECK-PROFILE-GENERATE-LLVM /home/gha/actions-runner/_work/llvm-project/llvm-project/flang/test/Driver/flang-f-opts.f90
# executed command: /home/gha/actions-runner/_work/llvm-project/llvm-project/build/bin/flang '-###' -S -fprofile-generate /home/gha/actions-runner/_work/llvm-project/llvm-project/flang/test/Driver/flang-f-opts.f90
# note: command had no output on stdout or stderr
# executed command: /home/gha/actions-runner/_work/llvm-project/llvm-project/build/bin/FileCheck -check-prefix=CHECK-PROFILE-GENERATE-LLVM /home/gha/actions-runner/_work/llvm-project/llvm-project/flang/test/Driver/flang-f-opts.f90
# note: command had no output on stdout or stderr
# RUN: at line 15
rm -rf /home/gha/actions-runner/_work/llvm-project/llvm-project/build/tools/flang/test/Driver/Output/flang-f-opts.f90.tmp.pgodir && mkdir -p /home/gha/actions-runner/_work/llvm-project/llvm-project/build/tools/flang/test/Driver/Output/flang-f-opts.f90.tmp.pgodir
# executed command: rm -rf /home/gha/actions-runner/_work/llvm-project/llvm-project/build/tools/flang/test/Driver/Output/flang-f-opts.f90.tmp.pgodir
# note: command had no output on stdout or stderr
# executed command: mkdir -p /home/gha/actions-runner/_work/llvm-project/llvm-project/build/tools/flang/test/Driver/Output/flang-f-opts.f90.tmp.pgodir
# note: command had no output on stdout or stderr
# RUN: at line 16
/home/gha/actions-runner/_work/llvm-project/llvm-project/build/bin/flang -### -fprofile-generate=/home/gha/actions-runner/_work/llvm-project/llvm-project/build/tools/flang/test/Driver/Output/flang-f-opts.f90.tmp.pgodir /home/gha/actions-runner/_work/llvm-project/llvm-project/flang/test/Driver/flang-f-opts.f90 2>&1| /home/gha/actions-runner/_work/llvm-project/llvm-project/build/bin/FileCheck -check-prefix=PROFILE-GENERATE-EQ /home/gha/actions-runner/_work/llvm-project/llvm-project/flang/test/Driver/flang-f-opts.f90
# executed command: /home/gha/actions-runner/_work/llvm-project/llvm-project/build/bin/flang '-###' -fprofile-generate=/home/gha/actions-runner/_work/llvm-project/llvm-project/build/tools/flang/test/Driver/Output/flang-f-opts.f90.tmp.pgodir /home/gha/actions-runner/_work/llvm-project/llvm-project/flang/test/Driver/flang-f-opts.f90
# note: command had no output on stdout or stderr
# executed command: /home/gha/actions-runner/_work/llvm-project/llvm-project/build/bin/FileCheck -check-prefix=PROFILE-GENERATE-EQ /home/gha/actions-runner/_work/llvm-project/llvm-project/flang/test/Driver/flang-f-opts.f90
# note: command had no output on stdout or stderr
# RUN: at line 19
/home/gha/actions-runner/_work/llvm-project/llvm-project/build/bin/flang -### -fprofile-generate -fno-profile-generate /home/gha/actions-runner/_work/llvm-project/llvm-project/flang/test/Driver/flang-f-opts.f90 2>&1 | /home/gha/actions-runner/_work/llvm-project/llvm-project/build/bin/FileCheck -check-prefix=NO-PROFILE-GENERATE /home/gha/actions-runner/_work/llvm-project/llvm-project/flang/test/Driver/flang-f-opts.f90
# executed command: /home/gha/actions-runner/_work/llvm-project/llvm-project/build/bin/flang '-###' -fprofile-generate -fno-profile-generate /home/gha/actions-runner/_work/llvm-project/llvm-project/flang/test/Driver/flang-f-opts.f90
# note: command had no output on stdout or stderr
# executed command: /home/gha/actions-runner/_work/llvm-project/llvm-project/build/bin/FileCheck -check-prefix=NO-PROFILE-GENERATE /home/gha/actions-runner/_work/llvm-project/llvm-project/flang/test/Driver/flang-f-opts.f90
# note: command had no output on stdout or stderr
# RUN: at line 23
/home/gha/actions-runner/_work/llvm-project/llvm-project/build/bin/flang -### -fno-profile-generate -fprofile-generate /home/gha/actions-runner/_work/llvm-project/llvm-project/flang/test/Driver/flang-f-opts.f90 2>&1 | /home/gha/actions-runner/_work/llvm-project/llvm-project/build/bin/FileCheck -check-prefix=PROFILE-GENERATE /home/gha/actions-runner/_work/llvm-project/llvm-project/flang/test/Driver/flang-f-opts.f90
# executed command: /home/gha/actions-runner/_work/llvm-project/llvm-project/build/bin/flang '-###' -fno-profile-generate -fprofile-generate /home/gha/actions-runner/_work/llvm-project/llvm-project/flang/test/Driver/flang-f-opts.f90
# note: command had no output on stdout or stderr
# executed command: /home/gha/actions-runner/_work/llvm-project/llvm-project/build/bin/FileCheck -check-prefix=PROFILE-GENERATE /home/gha/actions-runner/_work/llvm-project/llvm-project/flang/test/Driver/flang-f-opts.f90
# note: command had no output on stdout or stderr
# RUN: at line 26
/home/gha/actions-runner/_work/llvm-project/llvm-project/build/bin/flang -### -S -fprofile-use=/home/gha/actions-runner/_work/llvm-project/llvm-project/flang/test/Driver /home/gha/actions-runner/_work/llvm-project/llvm-project/flang/test/Driver/flang-f-opts.f90 2>&1 | /home/gha/actions-runner/_work/llvm-project/llvm-project/build/bin/FileCheck -check-prefix=CHECK-PROFILE-USE-DIR /home/gha/actions-runner/_work/llvm-project/llvm-project/flang/test/Driver/flang-f-opts.f90
# executed command: /home/gha/actions-runner/_work/llvm-project/llvm-project/build/bin/flang '-###' -S -fprofile-use=/home/gha/actions-runner/_work/llvm-project/llvm-project/flang/test/Driver /home/gha/actions-runner/_work/llvm-project/llvm-project/flang/test/Driver/flang-f-opts.f90
# note: command had no output on stdout or stderr
# executed command: /home/gha/actions-runner/_work/llvm-project/llvm-project/build/bin/FileCheck -check-prefix=CHECK-PROFILE-USE-DIR /home/gha/actions-runner/_work/llvm-project/llvm-project/flang/test/Driver/flang-f-opts.f90
# note: command had no output on stdout or stderr
# RUN: at line 30
/home/gha/actions-runner/_work/llvm-project/llvm-project/build/bin/flang -### -fbuiltin /home/gha/actions-runner/_work/llvm-project/llvm-project/flang/test/Driver/flang-f-opts.f90 2>&1      | /home/gha/actions-runner/_work/llvm-project/llvm-project/build/bin/FileCheck /home/gha/actions-runner/_work/llvm-project/llvm-project/flang/test/Driver/flang-f-opts.f90 -check-prefix=WARN-BUILTIN
# executed command: /home/gha/actions-runner/_work/llvm-project/llvm-project/build/bin/flang '-###' -fbuiltin /home/gha/actions-runner/_work/llvm-project/llvm-project/flang/test/Driver/flang-f-opts.f90
# 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/flang/test/Driver/flang-f-opts.f90 -check-prefix=WARN-BUILTIN
# note: command had no output on stdout or stderr
# RUN: at line 34
/home/gha/actions-runner/_work/llvm-project/llvm-project/build/bin/flang -### -fno-builtin /home/gha/actions-runner/_work/llvm-project/llvm-project/flang/test/Driver/flang-f-opts.f90 2>&1      | /home/gha/actions-runner/_work/llvm-project/llvm-project/build/bin/FileCheck /home/gha/actions-runner/_work/llvm-project/llvm-project/flang/test/Driver/flang-f-opts.f90 -check-prefix=WARN-NO-BUILTIN
# executed command: /home/gha/actions-runner/_work/llvm-project/llvm-project/build/bin/flang '-###' -fno-builtin /home/gha/actions-runner/_work/llvm-project/llvm-project/flang/test/Driver/flang-f-opts.f90
# 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/flang/test/Driver/flang-f-opts.f90 -check-prefix=WARN-NO-BUILTIN
# note: command had no output on stdout or stderr
# RUN: at line 38
/home/gha/actions-runner/_work/llvm-project/llvm-project/build/bin/flang -### -fbuiltin -fno-builtin /home/gha/actions-runner/_work/llvm-project/llvm-project/flang/test/Driver/flang-f-opts.f90 2>&1      | /home/gha/actions-runner/_work/llvm-project/llvm-project/build/bin/FileCheck /home/gha/actions-runner/_work/llvm-project/llvm-project/flang/test/Driver/flang-f-opts.f90 -check-prefix=WARN-BUILTIN-MULTIPLE
# executed command: /home/gha/actions-runner/_work/llvm-project/llvm-project/build/bin/flang '-###' -fbuiltin -fno-builtin /home/gha/actions-runner/_work/llvm-project/llvm-project/flang/test/Driver/flang-f-opts.f90
# 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/flang/test/Driver/flang-f-opts.f90 -check-prefix=WARN-BUILTIN-MULTIPLE
# note: command had no output on stdout or stderr
# RUN: at line 50
not /home/gha/actions-runner/_work/llvm-project/llvm-project/build/bin/flang -### -complex-range=full /home/gha/actions-runner/_work/llvm-project/llvm-project/flang/test/Driver/flang-f-opts.f90 2>&1      | /home/gha/actions-runner/_work/llvm-project/llvm-project/build/bin/FileCheck /home/gha/actions-runner/_work/llvm-project/llvm-project/flang/test/Driver/flang-f-opts.f90 -check-prefix UNKNOWN-SUGGEST
# executed command: not /home/gha/actions-runner/_work/llvm-project/llvm-project/build/bin/flang '-###' -complex-range=full /home/gha/actions-runner/_work/llvm-project/llvm-project/flang/test/Driver/flang-f-opts.f90
# 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/flang/test/Driver/flang-f-opts.f90 -check-prefix UNKNOWN-SUGGEST
# note: command had no output on stdout or stderr
# RUN: at line 56
not /home/gha/actions-runner/_work/llvm-project/llvm-project/build/bin/flang -### -not-an-option /home/gha/actions-runner/_work/llvm-project/llvm-project/flang/test/Driver/flang-f-opts.f90 2>&1      | /home/gha/actions-runner/_work/llvm-project/llvm-project/build/bin/FileCheck /home/gha/actions-runner/_work/llvm-project/llvm-project/flang/test/Driver/flang-f-opts.f90 -check-prefix UNKNOWN-NO-SUGGEST
# executed command: not /home/gha/actions-runner/_work/llvm-project/llvm-project/build/bin/flang '-###' -not-an-option /home/gha/actions-runner/_work/llvm-project/llvm-project/flang/test/Driver/flang-f-opts.f90
# 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/flang/test/Driver/flang-f-opts.f90 -check-prefix UNKNOWN-NO-SUGGEST
# note: command had no output on stdout or stderr
# RUN: at line 65
/home/gha/actions-runner/_work/llvm-project/llvm-project/build/bin/flang -### /home/gha/actions-runner/_work/llvm-project/llvm-project/flang/test/Driver/flang-f-opts.f90                                                            -finline-limit=1000                                                   -finline-limit                                                        -fexpensive-optimizations                                             -fno-expensive-optimizations                                          -fno-defer-pop                                                        -fkeep-inline-functions                                               -fno-keep-inline-functions                                            -freorder-blocks                                                      -ffloat-store                                                         -fgcse                                                                -fivopts                                                              -fprefetch-loop-arrays                                                -fprofile-correction                                                  -fprofile-values                                                      -fschedule-insns                                                      -fsignaling-nans                                                      -fstrength-reduce                                                     -ftracer                                                              -funroll-all-loops                                                    -funswitch-loops                                                      -falign-labels                                                        -falign-labels=100                                                    -falign-jumps                                                         -falign-jumps=100                                                     -fbranch-count-reg                                                    -fcaller-saves                                                        -fno-default-inline                                                   -fgcse-after-reload                                                   -fgcse-las                                                            -fgcse-sm                                                             -fipa-cp                                                              -finline-functions-called-once                                        -fmodulo-sched                                                        -fmodulo-sched-allow-regmoves                                         -fpeel-loops                                                          -frename-registers                                                    -fschedule-insns2                                                     -fsingle-precision-constant                                           -funsafe-loop-optimizations                                           -fuse-linker-plugin                                                   -fvect-cost-model                                                     -fvariable-expansion-in-unroller                                      -fweb                                                                 -fwhole-program                                                       -fcaller-saves                                                        -freorder-blocks                                                      -ffat-lto-objects                                                     -fmerge-constants                                                     -finline-small-functions                                              -ftree-dce                                                            -ftree-ter                                                            -ftree-vrp                                                            -fno-devirtualize 2>&1                                                | /home/gha/actions-runner/_work/llvm-project/llvm-project/build/bin/FileCheck --check-prefix=CHECK-WARNING /home/gha/actions-runner/_work/llvm-project/llvm-project/flang/test/Driver/flang-f-opts.f90
# executed command: /home/gha/actions-runner/_work/llvm-project/llvm-project/build/bin/flang '-###' /home/gha/actions-runner/_work/llvm-project/llvm-project/flang/test/Driver/flang-f-opts.f90 -finline-limit=1000 -finline-limit -fexpensive-optimizations -fno-expensive-optimizations -fno-defer-pop -fkeep-inline-functions -fno-keep-inline-functions -freorder-blocks -ffloat-store -fgcse -fivopts -fprefetch-loop-arrays -fprofile-correction -fprofile-values -fschedule-insns -fsignaling-nans -fstrength-reduce -ftracer -funroll-all-loops -funswitch-loops -falign-labels -falign-labels=100 -falign-jumps -falign-jumps=100 -fbranch-count-reg -fcaller-saves -fno-default-inline -fgcse-after-reload -fgcse-las -fgcse-sm -fipa-cp -finline-functions-called-once -fmodulo-sched -fmodulo-sched-allow-regmoves -fpeel-loops -frename-registers -fschedule-insns2 -fsingle-precision-constant -funsafe-loop-optimizations -fuse-linker-plugin -fvect-cost-model -fvariable-expansion-in-unroller -fweb -fwhole-program -fcaller-saves -freorder-blocks -ffat-lto-objects -fmerge-constants -finline-small-functions -ftree-dce -ftree-ter -ftree-vrp -fno-devirtualize
# note: command had no output on stdout or stderr
# error: command failed with exit status: 1
# executed command: /home/gha/actions-runner/_work/llvm-project/llvm-project/build/bin/FileCheck --check-prefix=CHECK-WARNING /home/gha/actions-runner/_work/llvm-project/llvm-project/flang/test/Driver/flang-f-opts.f90
# .---command stderr------------
# | /home/gha/actions-runner/_work/llvm-project/llvm-project/flang/test/Driver/flang-f-opts.f90:125:22: error: CHECK-WARNING-DAG: expected string not found in input
# | ! CHECK-WARNING-DAG: optimization flag '-fkeep-inline-functions' is not supported
# |                      ^
# | <stdin>:1:1: note: scanning from here
# | flang-24: error: unknown argument: '-fkeep-inline-functions'
# | ^
# | <stdin>:10:20: note: possible intended match here
# | flang-24: warning: optimization flag '-fexpensive-optimizations' is not supported [-Wignored-optimization-argument]
# |                    ^
# | 
# | Input file: <stdin>
# | Check file: /home/gha/actions-runner/_work/llvm-project/llvm-project/flang/test/Driver/flang-f-opts.f90
# | 
# | -dump-input=help explains the following input dump.
# | 
# | Input was:
# | <<<<<<
# |            1: flang-24: error: unknown argument: '-fkeep-inline-functions' 
# | dag:125'0    {                                                               search range start (exclusive)
# | dag:125'1                                                                    error: no match found in search range
# |            2: flang-24: error: unknown argument: '-fno-keep-inline-functions' 
# |            3: flang version 24.0.0git (https://github.com/llvm/llvm-project fc63e692ad377bd841518a929bf19bbfd0c54b13) 
# |            4: Target: x86_64-unknown-linux-gnu 
# |            5: Thread model: posix 
# |            6: InstalledDir: /home/gha/actions-runner/_work/llvm-project/llvm-project/build/bin 
# |            7: Build config: +assertions 
# |            8: flang-24: warning: optimization flag '-finline-limit=1000' is not supported [-Wignored-optimization-argument] 
# |            9: flang-24: warning: optimization flag '-finline-limit' is not supported [-Wignored-optimization-argument] 
# |           10: flang-24: warning: optimization flag '-fexpensive-optimizations' is not supported [-Wignored-optimization-argument] 
# | dag:125'2                        ?                                                                                                  possible intended match
# |           11: flang-24: warning: optimization flag '-fno-expensive-optimizations' is not supported [-Wignored-optimization-argument] 
# |           12: flang-24: warning: optimization flag '-fno-defer-pop' is not supported [-Wignored-optimization-argument] 
# |           13: flang-24: warning: optimization flag '-freorder-blocks' is not supported [-Wignored-optimization-argument] 
# |           14: flang-24: warning: optimization flag '-ffloat-store' is not supported [-Wignored-optimization-argument] 
# |           15: flang-24: warning: optimization flag '-fgcse' is not supported [-Wignored-optimization-argument] 
# |            .
# |            .
# |            .
# |           54: flang-24: warning: optimization flag '-ftree-dce' is not supported [-Wignored-optimization-argument] 
# |           55: flang-24: warning: optimization flag '-ftree-ter' is not supported [-Wignored-optimization-argument] 
# |           56: flang-24: warning: optimization flag '-ftree-vrp' is not supported [-Wignored-optimization-argument] 
# |           57: flang-24: warning: optimization flag '-fno-devirtualize' is not supported [-Wignored-optimization-argument] 
# |           58:  "/home/gha/actions-runner/_work/llvm-project/llvm-project/build/bin/flang-24" "-fc1" "-triple" "x86_64-unknown-linux-gnu" "-emit-obj" "-fno-color-diagnostics" "-ffat-lto-objects" "-mrelocation-model" "pic" "-pic-level" "2" "-pic-is-pie" "-target-cpu" "x86-64" "-resource-dir" "/home/gha/actions-runner/_work/llvm-project/llvm-project/build/lib/clang/24" "-fintrinsic-modules-path" "/home/gha/actions-runner/_work/llvm-project/llvm-project/build/lib/clang/24/finclude/flang/x86_64-unknown-linux-gnu" "-mframe-pointer=all" "-o" "/tmp/lit-tmp-zjepcoq7/flang-f-opts-8c17f8.o" "-x" "f95" "/home/gha/actions-runner/_work/llvm-project/llvm-project/flang/test/Driver/flang-f-opts.f90" 
# |           59:  "/usr/bin/ld" "-z" "relro" "--hash-style=gnu" "--eh-frame-hdr" "-m" "elf_x86_64" "-pie" "-dynamic-linker" "/lib64/ld-linux-x86-64.so.2" "-o" "a.out" "/lib/x86_64-linux-gnu/Scrt1.o" "/lib/x86_64-linux-gnu/crti.o" "/usr/lib/gcc/x86_64-linux-gnu/13/crtbeginS.o" "-L/home/gha/actions-runner/_work/llvm-project/llvm-project/build/bin/../lib/x86_64-unknown-linux-gnu" "-L/home/gha/actions-runner/_work/llvm-project/llvm-project/build/lib/clang/24/lib/x86_64-unknown-linux-gnu" "-L/usr/lib/gcc/x86_64-linux-gnu/13" "-L/usr/lib/gcc/x86_64-linux-gnu/13/../../../../lib64" "-L/lib/x86_64-linux-gnu" "-L/lib/../lib64" "-L/usr/lib/x86_64-linux-gnu" "-L/usr/lib64" "-L/lib" "-L/usr/lib" "/tmp/lit-tmp-zjepcoq7/flang-f-opts-8c17f8.o" "-L/home/gha/actions-runner/_work/llvm-project/llvm-project/build/lib" "-lflang_rt.runtime" "-lm" "-lgcc" "--as-needed" "-lgcc_s" "--no-as-needed" "-lc" "-lgcc" "--as-needed" "-lgcc_s" "--no-as-needed" "/usr/lib/gcc/x86_64-linux-gnu/13/crtendS.o" "/lib/x86_64-linux-gnu/crtn.o" 
# | dag:125'3                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            } search range end (exclusive)
# | >>>>>>
# `-----------------------------
# 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/222786


More information about the llvm-commits mailing list