[llvm] [SimplifyCFG] Add foldCondStoreToSelect optimization (PR #207654)

via llvm-commits llvm-commits at lists.llvm.org
Sun Jul 5 23:17:31 PDT 2026


github-actions[bot] wrote:

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

The build failed before running any tests. Click on a failure below to see the details.

<details>
<summary>lib/Transforms/Utils/CMakeFiles/LLVMTransformUtils.dir/SimplifyCFG.cpp.o</summary>

```
FAILED: lib/Transforms/Utils/CMakeFiles/LLVMTransformUtils.dir/SimplifyCFG.cpp.o
sccache /opt/llvm/bin/clang++ -D_DEBUG -D_GLIBCXX_ASSERTIONS -D_GLIBCXX_USE_CXX11_ABI=1 -D_GNU_SOURCE -D_LIBCPP_HARDENING_MODE=_LIBCPP_HARDENING_MODE_EXTENSIVE -D__STDC_CONSTANT_MACROS -D__STDC_FORMAT_MACROS -D__STDC_LIMIT_MACROS -I/home/gha/actions-runner/_work/llvm-project/llvm-project/build/lib/Transforms/Utils -I/home/gha/actions-runner/_work/llvm-project/llvm-project/llvm/lib/Transforms/Utils -I/home/gha/actions-runner/_work/llvm-project/llvm-project/build/include -I/home/gha/actions-runner/_work/llvm-project/llvm-project/llvm/include -gmlt -fPIC -fno-semantic-interposition -fvisibility-inlines-hidden -Werror -Werror=date-time -Werror=unguarded-availability-new -Wall -Wextra -Wno-unused-parameter -Wwrite-strings -Wcast-qual -Wmissing-field-initializers -pedantic -Wno-long-long -Wc++98-compat-extra-semi -Wimplicit-fallthrough -Wcovered-switch-default -Wno-noexcept-type -Wnon-virtual-dtor -Wdelete-non-virtual-dtor -Wsuggest-override -Wstring-conversion -Wno-pass-failed -Wmisleading-indentation -Wctad-maybe-unsupported -fdiagnostics-color -ffunction-sections -fdata-sections -O3 -DNDEBUG -std=c++17 -UNDEBUG -fno-exceptions -funwind-tables -fno-rtti -MD -MT lib/Transforms/Utils/CMakeFiles/LLVMTransformUtils.dir/SimplifyCFG.cpp.o -MF lib/Transforms/Utils/CMakeFiles/LLVMTransformUtils.dir/SimplifyCFG.cpp.o.d -o lib/Transforms/Utils/CMakeFiles/LLVMTransformUtils.dir/SimplifyCFG.cpp.o -c /home/gha/actions-runner/_work/llvm-project/llvm-project/llvm/lib/Transforms/Utils/SimplifyCFG.cpp
/home/gha/actions-runner/_work/llvm-project/llvm-project/llvm/lib/Transforms/Utils/SimplifyCFG.cpp:4369:39: error: 'BranchInst' is deprecated: Use UncondBrInst/CondBrInst/Instruction instead [-Werror,-Wdeprecated-declarations]
4369 | static bool foldCondStoreToSelectImpl(BranchInst *BI, DomTreeUpdater *DTU,
|                                       ^
/home/gha/actions-runner/_work/llvm-project/llvm-project/llvm/include/llvm/IR/Instructions.h:3085:7: note: 'BranchInst' has been explicitly marked deprecated here
3085 | class LLVM_DEPRECATED("Use UncondBrInst/CondBrInst/Instruction instead", "")
|       ^
/home/gha/actions-runner/_work/llvm-project/llvm-project/llvm/include/llvm/Support/Compiler.h:252:50: note: expanded from macro 'LLVM_DEPRECATED'
252 | #define LLVM_DEPRECATED(MSG, FIX) __attribute__((deprecated(MSG, FIX)))
|                                                  ^
/home/gha/actions-runner/_work/llvm-project/llvm-project/llvm/lib/Transforms/Utils/SimplifyCFG.cpp:4371:12: error: 'isConditional' is deprecated: Use isa<CondBrInst> instead [-Werror,-Wdeprecated-declarations]
4371 |   if (!BI->isConditional())
|            ^~~~~~~~~~~~~
|            isa<CondBrInst>
/home/gha/actions-runner/_work/llvm-project/llvm-project/llvm/include/llvm/IR/Instructions.h:3107:3: note: 'isConditional' has been explicitly marked deprecated here
3107 |   LLVM_DEPRECATED("Use isa<CondBrInst> instead", "isa<CondBrInst>")
|   ^
/home/gha/actions-runner/_work/llvm-project/llvm-project/llvm/include/llvm/Support/Compiler.h:252:50: note: expanded from macro 'LLVM_DEPRECATED'
252 | #define LLVM_DEPRECATED(MSG, FIX) __attribute__((deprecated(MSG, FIX)))
|                                                  ^
/home/gha/actions-runner/_work/llvm-project/llvm-project/llvm/lib/Transforms/Utils/SimplifyCFG.cpp:4382:3: error: 'BranchInst' is deprecated: Use UncondBrInst/CondBrInst/Instruction instead [-Werror,-Wdeprecated-declarations]
4382 |   BranchInst *ThenTerm = dyn_cast<BranchInst>(ThenBB->getTerminator());
|   ^
/home/gha/actions-runner/_work/llvm-project/llvm-project/llvm/include/llvm/IR/Instructions.h:3085:7: note: 'BranchInst' has been explicitly marked deprecated here
3085 | class LLVM_DEPRECATED("Use UncondBrInst/CondBrInst/Instruction instead", "")
|       ^
/home/gha/actions-runner/_work/llvm-project/llvm-project/llvm/include/llvm/Support/Compiler.h:252:50: note: expanded from macro 'LLVM_DEPRECATED'
252 | #define LLVM_DEPRECATED(MSG, FIX) __attribute__((deprecated(MSG, FIX)))
|                                                  ^
/home/gha/actions-runner/_work/llvm-project/llvm-project/llvm/lib/Transforms/Utils/SimplifyCFG.cpp:4382:35: error: 'BranchInst' is deprecated: Use UncondBrInst/CondBrInst/Instruction instead [-Werror,-Wdeprecated-declarations]
4382 |   BranchInst *ThenTerm = dyn_cast<BranchInst>(ThenBB->getTerminator());
|                                   ^
/home/gha/actions-runner/_work/llvm-project/llvm-project/llvm/include/llvm/IR/Instructions.h:3085:7: note: 'BranchInst' has been explicitly marked deprecated here
3085 | class LLVM_DEPRECATED("Use UncondBrInst/CondBrInst/Instruction instead", "")
|       ^
/home/gha/actions-runner/_work/llvm-project/llvm-project/llvm/include/llvm/Support/Compiler.h:252:50: note: expanded from macro 'LLVM_DEPRECATED'
252 | #define LLVM_DEPRECATED(MSG, FIX) __attribute__((deprecated(MSG, FIX)))
|                                                  ^
/home/gha/actions-runner/_work/llvm-project/llvm-project/llvm/lib/Transforms/Utils/SimplifyCFG.cpp:4383:30: error: 'isConditional' is deprecated: Use isa<CondBrInst> instead [-Werror,-Wdeprecated-declarations]
4383 |   if (!ThenTerm || ThenTerm->isConditional())
|                              ^~~~~~~~~~~~~
|                              isa<CondBrInst>
/home/gha/actions-runner/_work/llvm-project/llvm-project/llvm/include/llvm/IR/Instructions.h:3107:3: note: 'isConditional' has been explicitly marked deprecated here
3107 |   LLVM_DEPRECATED("Use isa<CondBrInst> instead", "isa<CondBrInst>")
|   ^
/home/gha/actions-runner/_work/llvm-project/llvm-project/llvm/include/llvm/Support/Compiler.h:252:50: note: expanded from macro 'LLVM_DEPRECATED'
252 | #define LLVM_DEPRECATED(MSG, FIX) __attribute__((deprecated(MSG, FIX)))
|                                                  ^
/home/gha/actions-runner/_work/llvm-project/llvm-project/llvm/lib/Transforms/Utils/SimplifyCFG.cpp:4395:3: error: 'BranchInst' is deprecated: Use UncondBrInst/CondBrInst/Instruction instead [-Werror,-Wdeprecated-declarations]
4395 |   BranchInst *ElseTerm = dyn_cast<BranchInst>(ElseBB->getTerminator());
|   ^
/home/gha/actions-runner/_work/llvm-project/llvm-project/llvm/include/llvm/IR/Instructions.h:3085:7: note: 'BranchInst' has been explicitly marked deprecated here
3085 | class LLVM_DEPRECATED("Use UncondBrInst/CondBrInst/Instruction instead", "")
|       ^
/home/gha/actions-runner/_work/llvm-project/llvm-project/llvm/include/llvm/Support/Compiler.h:252:50: note: expanded from macro 'LLVM_DEPRECATED'
252 | #define LLVM_DEPRECATED(MSG, FIX) __attribute__((deprecated(MSG, FIX)))
|                                                  ^
/home/gha/actions-runner/_work/llvm-project/llvm-project/llvm/lib/Transforms/Utils/SimplifyCFG.cpp:4395:35: error: 'BranchInst' is deprecated: Use UncondBrInst/CondBrInst/Instruction instead [-Werror,-Wdeprecated-declarations]
4395 |   BranchInst *ElseTerm = dyn_cast<BranchInst>(ElseBB->getTerminator());
|                                   ^
/home/gha/actions-runner/_work/llvm-project/llvm-project/llvm/include/llvm/IR/Instructions.h:3085:7: note: 'BranchInst' has been explicitly marked deprecated here
3085 | class LLVM_DEPRECATED("Use UncondBrInst/CondBrInst/Instruction instead", "")
|       ^
/home/gha/actions-runner/_work/llvm-project/llvm-project/llvm/include/llvm/Support/Compiler.h:252:50: note: expanded from macro 'LLVM_DEPRECATED'
252 | #define LLVM_DEPRECATED(MSG, FIX) __attribute__((deprecated(MSG, FIX)))
|                                                  ^
/home/gha/actions-runner/_work/llvm-project/llvm-project/llvm/lib/Transforms/Utils/SimplifyCFG.cpp:4396:31: error: 'isConditional' is deprecated: Use isa<CondBrInst> instead [-Werror,-Wdeprecated-declarations]
4396 |   if (!ElseTerm || !ElseTerm->isConditional())
|                               ^~~~~~~~~~~~~
|                               isa<CondBrInst>
/home/gha/actions-runner/_work/llvm-project/llvm-project/llvm/include/llvm/IR/Instructions.h:3107:3: note: 'isConditional' has been explicitly marked deprecated here
3107 |   LLVM_DEPRECATED("Use isa<CondBrInst> instead", "isa<CondBrInst>")
|   ^
/home/gha/actions-runner/_work/llvm-project/llvm-project/llvm/include/llvm/Support/Compiler.h:252:50: note: expanded from macro 'LLVM_DEPRECATED'
252 | #define LLVM_DEPRECATED(MSG, FIX) __attribute__((deprecated(MSG, FIX)))
|                                                  ^
/home/gha/actions-runner/_work/llvm-project/llvm-project/llvm/lib/Transforms/Utils/SimplifyCFG.cpp:4418:33: error: 'BranchInst' is deprecated: Use UncondBrInst/CondBrInst/Instruction instead [-Werror,-Wdeprecated-declarations]
4418 |     BranchInst *Term = dyn_cast<BranchInst>(BB->getTerminator());
|                                 ^
/home/gha/actions-runner/_work/llvm-project/llvm-project/llvm/include/llvm/IR/Instructions.h:3085:7: note: 'BranchInst' has been explicitly marked deprecated here
3085 | class LLVM_DEPRECATED("Use UncondBrInst/CondBrInst/Instruction instead", "")
|       ^
/home/gha/actions-runner/_work/llvm-project/llvm-project/llvm/include/llvm/Support/Compiler.h:252:50: note: expanded from macro 'LLVM_DEPRECATED'
252 | #define LLVM_DEPRECATED(MSG, FIX) __attribute__((deprecated(MSG, FIX)))
|                                                  ^
/home/gha/actions-runner/_work/llvm-project/llvm-project/llvm/lib/Transforms/Utils/SimplifyCFG.cpp:4418:5: error: 'BranchInst' is deprecated: Use UncondBrInst/CondBrInst/Instruction instead [-Werror,-Wdeprecated-declarations]
4418 |     BranchInst *Term = dyn_cast<BranchInst>(BB->getTerminator());
|     ^
/home/gha/actions-runner/_work/llvm-project/llvm-project/llvm/include/llvm/IR/Instructions.h:3085:7: note: 'BranchInst' has been explicitly marked deprecated here
3085 | class LLVM_DEPRECATED("Use UncondBrInst/CondBrInst/Instruction instead", "")
|       ^
/home/gha/actions-runner/_work/llvm-project/llvm-project/llvm/include/llvm/Support/Compiler.h:252:50: note: expanded from macro 'LLVM_DEPRECATED'
252 | #define LLVM_DEPRECATED(MSG, FIX) __attribute__((deprecated(MSG, FIX)))
|                                                  ^
/home/gha/actions-runner/_work/llvm-project/llvm-project/llvm/lib/Transforms/Utils/SimplifyCFG.cpp:4419:24: error: 'isConditional' is deprecated: Use isa<CondBrInst> instead [-Werror,-Wdeprecated-declarations]
4419 |     if (!Term || Term->isConditional() || Term->getSuccessor(0) != MergeBB)
|                        ^~~~~~~~~~~~~
|                        isa<CondBrInst>
/home/gha/actions-runner/_work/llvm-project/llvm-project/llvm/include/llvm/IR/Instructions.h:3107:3: note: 'isConditional' has been explicitly marked deprecated here
3107 |   LLVM_DEPRECATED("Use isa<CondBrInst> instead", "isa<CondBrInst>")
|   ^
/home/gha/actions-runner/_work/llvm-project/llvm-project/llvm/include/llvm/Support/Compiler.h:252:50: note: expanded from macro 'LLVM_DEPRECATED'
252 | #define LLVM_DEPRECATED(MSG, FIX) __attribute__((deprecated(MSG, FIX)))
|                                                  ^
/home/gha/actions-runner/_work/llvm-project/llvm-project/llvm/lib/Transforms/Utils/SimplifyCFG.cpp:4501:22: error: 'getCondition' is deprecated: Cast to CondBrInst [-Werror,-Wdeprecated-declarations]
4501 |   Value *Cond1 = BI->getCondition();
|                      ^
/home/gha/actions-runner/_work/llvm-project/llvm-project/llvm/include/llvm/IR/Instructions.h:3110:3: note: 'getCondition' has been explicitly marked deprecated here
3110 |   LLVM_DEPRECATED("Cast to CondBrInst", "")
|   ^
/home/gha/actions-runner/_work/llvm-project/llvm-project/llvm/include/llvm/Support/Compiler.h:252:50: note: expanded from macro 'LLVM_DEPRECATED'
252 | #define LLVM_DEPRECATED(MSG, FIX) __attribute__((deprecated(MSG, FIX)))
|                                                  ^
/home/gha/actions-runner/_work/llvm-project/llvm-project/llvm/lib/Transforms/Utils/SimplifyCFG.cpp:4502:28: error: 'getCondition' is deprecated: Cast to CondBrInst [-Werror,-Wdeprecated-declarations]
4502 |   Value *Cond2 = ElseTerm->getCondition();
|                            ^
/home/gha/actions-runner/_work/llvm-project/llvm-project/llvm/include/llvm/IR/Instructions.h:3110:3: note: 'getCondition' has been explicitly marked deprecated here
3110 |   LLVM_DEPRECATED("Cast to CondBrInst", "")
|   ^
/home/gha/actions-runner/_work/llvm-project/llvm-project/llvm/include/llvm/Support/Compiler.h:252:50: note: expanded from macro 'LLVM_DEPRECATED'
252 | #define LLVM_DEPRECATED(MSG, FIX) __attribute__((deprecated(MSG, FIX)))
|                                                  ^
13 errors generated.
```
</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/207654


More information about the llvm-commits mailing list