[Mlir-commits] [mlir] [mlir][Transforms][NFC] `remove-dead-values`: Split `OperationToCleanup` (PR #173542)
llvmlistbot at llvm.org
llvmlistbot at llvm.org
Fri Dec 26 03:31:26 PST 2025
github-actions[bot] wrote:
<!--LLVM CODE FORMAT COMMENT: {undef deprecator}-->
:warning: undef deprecator found issues in your code. :warning:
<details>
<summary>
You can test this locally with the following command:
</summary>
``````````bash
git diff -U0 --pickaxe-regex -S '([^a-zA-Z0-9#_-]undef([^a-zA-Z0-9_-]|$)|UndefValue::get)' 'HEAD~1' HEAD clang-tools-extra/test/clang-tidy/checkers/misc/use-internal-linkage-wrong-config.cpp libcxx/test/libcxx/input.output/iostreams.base/nodiscard.verify.cpp libcxx/test/std/thread/thread.jthread/cons.verify.cpp libcxx/test/std/thread/thread.threads/thread.thread.class/thread.thread.constr/F.verify.cpp libcxx/test/std/utilities/intseq/intseq.binding/structured_binding.pass.cpp libcxx/test/std/utilities/intseq/intseq.binding/tuple_interface.compile.pass.cpp libcxx/test/std/utilities/intseq/intseq.binding/tuple_interface.verify.cpp llvm/test/CodeGen/Mips/strict-fp-func.ll llvm/test/Transforms/LoopVectorize/step-vector-i1-wrapping.ll llvm/test/Transforms/SCCP/bitcast-vector-refinement.l.ll llvm/test/Transforms/SLPVectorizer/X86/alternate-op-constant.ll llvm/test/Transforms/SLPVectorizer/X86/non-schedulable-recalculate-deps.ll mlir/lib/Dialect/OpenACC/Transforms/ACCIfClauseLowering.cpp clang-tools-extra/clang-tidy/misc/UseInternalLinkageCheck.cpp clang-tools-extra/clang-tidy/misc/UseInternalLinkageCheck.h clang-tools-extra/clangd/AST.cpp clang-tools-extra/clangd/AST.h clang-tools-extra/clangd/ParsedAST.h clang-tools-extra/clangd/Preamble.cpp clang-tools-extra/clangd/XRefs.cpp clang-tools-extra/clangd/index/IndexAction.cpp clang-tools-extra/clangd/index/SymbolCollector.cpp clang-tools-extra/clangd/index/SymbolCollector.h clang-tools-extra/clangd/unittests/BackgroundIndexTests.cpp clang-tools-extra/clangd/unittests/XRefsTests.cpp clang-tools-extra/test/clang-tidy/checkers/misc/use-internal-linkage-func.cpp clang-tools-extra/test/clang-tidy/checkers/misc/use-internal-linkage-var.cpp clang/include/clang/Analysis/AnalysisDeclContext.h clang/include/clang/Analysis/CFGStmtMap.h clang/include/clang/Index/IndexingOptions.h clang/lib/AST/ExprConstant.cpp clang/lib/Analysis/AnalysisDeclContext.cpp clang/lib/Analysis/CFGStmtMap.cpp clang/lib/Format/TokenAnnotator.cpp clang/lib/Headers/amxavx512intrin.h clang/lib/Index/IndexingAction.cpp clang/lib/StaticAnalyzer/Checkers/AnalysisOrderChecker.cpp clang/lib/StaticAnalyzer/Core/BugReporterVisitors.cpp clang/lib/StaticAnalyzer/Core/CallEvent.cpp clang/lib/StaticAnalyzer/Core/ExplodedGraph.cpp clang/test/AST/ast-dump-APValue-addrlabeldiff.c clang/test/CodeGenCXX/const-init.cpp clang/unittests/Format/FormatTest.cpp libcxx/include/__ios/fpos.h libcxx/include/__thread/thread.h libcxx/include/__utility/integer_sequence.h libcxx/test/libcxx/utilities/intseq/nodiscard.verify.cpp libcxx/test/std/containers/sequences/array/array.cons/deduct.verify.cpp libcxx/test/std/containers/sequences/array/array.creation/to_array.verify.cpp libcxx/test/std/containers/sequences/array/array.fill/fill.verify.cpp libcxx/test/std/containers/sequences/array/array.swap/swap.verify.cpp libcxx/test/std/containers/sequences/array/array.tuple/get.verify.cpp libcxx/test/std/containers/sequences/array/compare.verify.cpp libcxx/test/std/language.support/support.limits/support.limits.general/utility.version.compile.pass.cpp libcxx/test/std/language.support/support.limits/support.limits.general/version.version.compile.pass.cpp libcxx/test/std/thread/futures/futures.async/async.pass.cpp libcxx/test/std/thread/futures/futures.async/async.verify.cpp libcxx/test/std/thread/thread.jthread/cons.func.token.pass.cpp libcxx/test/std/thread/thread.threads/thread.thread.class/thread.thread.constr/F.pass.cpp lld/ELF/SyntheticSections.h llvm/include/llvm/IR/Instruction.h llvm/include/llvm/IR/IntrinsicInst.h llvm/include/llvm/IR/PassManager.h llvm/include/llvm/Support/KnownFPClass.h llvm/lib/Analysis/ValueTracking.cpp llvm/lib/CodeGen/SelectionDAG/LegalizeVectorOps.cpp llvm/lib/IR/IRBuilder.cpp llvm/lib/IR/Instruction.cpp llvm/lib/IR/Instructions.cpp llvm/lib/Support/KnownFPClass.cpp llvm/lib/Target/AArch64/AArch64ISelLowering.cpp llvm/lib/Target/AMDGPU/SIShrinkInstructions.cpp llvm/lib/Target/AVR/AVRExpandPseudoInsts.cpp llvm/lib/Target/BPF/BPFISelLowering.cpp llvm/lib/Target/Mips/Disassembler/MipsDisassembler.cpp llvm/lib/Target/Mips/MCTargetDesc/MipsBaseInfo.h llvm/lib/Target/Mips/MipsISelLowering.cpp llvm/lib/Target/Mips/MipsISelLowering.h llvm/lib/Target/Mips/MipsInstructionSelector.cpp llvm/lib/Target/Mips/MipsRegisterBankInfo.cpp llvm/lib/Target/Mips/MipsRegisterBankInfo.h llvm/lib/Target/Mips/MipsSEISelLowering.cpp llvm/lib/Target/Mips/MipsSEInstrInfo.cpp llvm/lib/Target/PowerPC/PPCInstrInfo.cpp llvm/lib/Target/RISCV/RISCVISelLowering.cpp llvm/lib/Target/X86/X86.h llvm/lib/Target/X86/X86CodeGenPassBuilder.cpp llvm/lib/Target/X86/X86ExpandPseudo.cpp llvm/lib/Target/X86/X86InstCombineIntrinsic.cpp llvm/lib/Target/X86/X86TargetMachine.cpp llvm/lib/Transforms/InstCombine/InstCombineVectorOps.cpp llvm/lib/Transforms/Utils/SCCPSolver.cpp llvm/lib/Transforms/Vectorize/LoopVectorizationPlanner.h llvm/lib/Transforms/Vectorize/LoopVectorize.cpp llvm/lib/Transforms/Vectorize/SLPVectorizer.cpp llvm/lib/Transforms/Vectorize/VPlanConstruction.cpp llvm/lib/Transforms/Vectorize/VPlanTransforms.h llvm/lib/Transforms/Vectorize/VPlanUtils.cpp llvm/test/CodeGen/AArch64/sve-vector-compress.ll llvm/test/CodeGen/AMDGPU/fold-fabs.ll llvm/test/CodeGen/Mips/GlobalISel/llvm-ir/implicit_def.ll llvm/test/CodeGen/Mips/analyzebranch.ll llvm/test/CodeGen/Mips/fcmp.ll llvm/test/CodeGen/Mips/fpbr.ll llvm/test/CodeGen/Mips/llvm-ir/select-dbl.ll llvm/test/CodeGen/Mips/llvm-ir/select-flt.ll llvm/test/CodeGen/Mips/micromips-mtc-mfc.ll llvm/test/CodeGen/Mips/select.ll llvm/test/Transforms/Attributor/nofpclass-fmul.ll llvm/test/Transforms/Attributor/nofpclass-nan-fmul.ll llvm/test/Transforms/DFAJumpThreading/dfa-unfold-select.ll llvm/test/Transforms/InstCombine/X86/blend_x86.ll llvm/test/Transforms/InstCombine/fpcast.ll llvm/test/Transforms/InstCombine/vscale_extractelement.ll llvm/test/Transforms/JumpThreading/select.ll llvm/test/Transforms/LoopVectorize/scalable-inductions.ll llvm/test/Transforms/SLPVectorizer/AArch64/shuffle-vectors-mask-size.ll llvm/test/Transforms/SLPVectorizer/RISCV/buildvector-all-external-scalars.ll llvm/test/Transforms/SLPVectorizer/X86/bv-root-part-of-graph.ll llvm/test/Transforms/SLPVectorizer/X86/crash_smallpt.ll llvm/test/Transforms/SLPVectorizer/X86/entry-no-bundle-but-extra-use-on-vec.ll llvm/test/Transforms/SLPVectorizer/X86/extractelement-single-use-many-nodes.ll llvm/test/Transforms/SLPVectorizer/X86/multi-node-for-copyable-parent.ll llvm/test/Transforms/SLPVectorizer/X86/multi-node-user-with-copyable-ops.ll llvm/test/Transforms/SLPVectorizer/X86/non-commutative-op-in-commutative-inst.ll llvm/test/Transforms/SLPVectorizer/X86/propagate-mmra.ll llvm/test/Transforms/SLPVectorizer/X86/reused-last-instruction-in-split-node.ll llvm/test/Transforms/SLPVectorizer/X86/same-operands-but-copyable.ll llvm/test/Transforms/SLPVectorizer/X86/user-with-multi-copyable-ops.ll llvm/test/Transforms/SLPVectorizer/X86/vect_copyable_in_binops.ll llvm/test/Transforms/SLPVectorizer/alternate-non-profitable.ll llvm/test/Transforms/SLPVectorizer/crash_exceed_scheduling.ll llvm/test/Transforms/SLPVectorizer/extract-many-users-buildvector.ll llvm/test/Transforms/SLPVectorizer/insertelement-postpone.ll mlir/include/mlir-c/Rewrite.h mlir/include/mlir/Dialect/OpenACC/OpenACCUtilsLoop.h mlir/lib/AsmParser/AttributeParser.cpp mlir/lib/Bindings/Python/Rewrite.cpp mlir/lib/CAPI/Dialect/Complex.cpp mlir/lib/CAPI/Transforms/Rewrite.cpp mlir/lib/Conversion/SCFToGPU/SCFToGPU.cpp mlir/lib/Dialect/OpenACC/Transforms/ACCImplicitData.cpp mlir/lib/Dialect/OpenACC/Transforms/ACCSpecializeForHost.cpp mlir/lib/Dialect/OpenACC/Utils/OpenACCUtils.cpp mlir/lib/Dialect/OpenACC/Utils/OpenACCUtilsLoop.cpp mlir/lib/Dialect/SCF/IR/SCF.cpp mlir/lib/Target/IRDLToCpp/IRDLToCpp.cpp mlir/lib/Transforms/RemoveDeadValues.cpp mlir/unittests/Dialect/OpenACC/OpenACCUtilsLoopTest.cpp clang-tools-extra/test/clang-tidy/checkers/misc/Inputs/use-internal-linkage/type.h clang-tools-extra/test/clang-tidy/checkers/misc/use-internal-linkage-type.cpp
``````````
</details>
The following files introduce new uses of undef:
- llvm/test/Transforms/SLPVectorizer/X86/reused-last-instruction-in-split-node.ll
- llvm/test/Transforms/SLPVectorizer/crash_exceed_scheduling.ll
[Undef](https://llvm.org/docs/LangRef.html#undefined-values) is now deprecated and should only be used in the rare cases where no replacement is possible. For example, a load of uninitialized memory yields `undef`. You should use `poison` values for placeholders instead.
In tests, avoid using `undef` and having tests that trigger undefined behavior. If you need an operand with some unimportant value, you can add a new argument to the function and use that instead.
For example, this is considered a bad practice:
```llvm
define void @fn() {
...
br i1 undef, ...
}
```
Please use the following instead:
```llvm
define void @fn(i1 %cond) {
...
br i1 %cond, ...
}
```
Please refer to the [Undefined Behavior Manual](https://llvm.org/docs/UndefinedBehavior.html) for more information.
https://github.com/llvm/llvm-project/pull/173542
More information about the Mlir-commits
mailing list