[clang] [llvm] Merge llvm/main into amd-debug (PR #164641)

via llvm-commits llvm-commits at lists.llvm.org
Wed Oct 22 08:05:58 PDT 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/test/CodeGen/debug-info-block-expr-heterogeneous-dwarf.c clang/test/CodeGen/debug-info-global-constant-heterogeneous-dwarf.c clang/test/CodeGenCXX/heterogeneous-debug-info-structured-binding-bitfield.cpp clang/test/CodeGenCXX/heterogeneous-debug-info-structured-binding.cpp llvm/test/Assembler/DIExpressionNew.ll llvm/test/Assembler/DIExpressionNewDebugRecords.ll llvm/test/Bitcode/DILocalVariable-address-space.ll llvm/test/Bitcode/bcanalyzer-metadata-diexpression.ll llvm/test/CodeGen/AMDGPU/amdgpu-spill-cfi-saved-regs.ll llvm/test/CodeGen/AMDGPU/debug-frame.ll llvm/test/CodeGen/AMDGPU/debug-type-mutate.ll llvm/test/DebugInfo/AMDGPU/dwarfdump-address-spaces.ll llvm/test/DebugInfo/AMDGPU/heterogeneous-dwarf-diop-diexpression-address-spaces.ll llvm/test/DebugInfo/AMDGPU/heterogeneous-dwarf-diop-diexpression-args.ll llvm/test/DebugInfo/AMDGPU/heterogeneous-dwarf-instruction-bundle.ll llvm/test/DebugInfo/AMDGPU/heterogeneous-dwarf-pointer-parameters-isel.ll llvm/test/DebugInfo/AMDGPU/reg-sequence-salvage.ll llvm/test/DebugInfo/heterogeneous-diop-in-diexpression-conversion.ll llvm/test/DebugInfo/heterogeneous-diop-in-diexpression.ll llvm/test/DebugInfo/verify-diop-based-diexpression.ll llvm/test/Transforms/InferAddressSpaces/AMDGPU/diop-diexpression.ll llvm/test/Transforms/InstCombine/heterogeneous-poison-dbg-rauw.ll llvm/test/Transforms/InstCombine/heterogeneous-poison-lower-dbg-declare.ll llvm/test/Transforms/SROA/heterogeneous-poison.ll llvm/unittests/rocm-gdb-symbols/AsmParserTest.cpp llvm/unittests/rocm-gdb-symbols/AsmWriterTest.cpp clang/include/clang/Basic/CodeGenOptions.h clang/lib/CodeGen/CGDebugInfo.cpp clang/lib/CodeGen/CGDebugInfo.h clang/lib/Driver/ToolChains/Clang.cpp llvm/include/llvm-c/DebugInfo.h llvm/include/llvm/ADT/Hashing.h llvm/include/llvm/AsmParser/LLParser.h llvm/include/llvm/AsmParser/LLToken.h llvm/include/llvm/BinaryFormat/Dwarf.h llvm/include/llvm/CodeGen/AsmPrinter.h llvm/include/llvm/CodeGen/MachineFunction.h llvm/include/llvm/CodeGen/TargetFrameLowering.h llvm/include/llvm/CodeGen/TargetRegisterInfo.h llvm/include/llvm/DebugInfo/DIContext.h llvm/include/llvm/IR/DIBuilder.h llvm/include/llvm/IR/DebugInfoMetadata.h llvm/include/llvm/MC/MCAsmInfo.h llvm/include/llvm/MC/MCDwarf.h llvm/include/llvm/MC/MCStreamer.h llvm/include/llvm/Target/TargetMachine.h llvm/include/llvm/Transforms/Utils/Local.h llvm/lib/AsmParser/LLLexer.cpp llvm/lib/AsmParser/LLParser.cpp llvm/lib/BinaryFormat/Dwarf.cpp llvm/lib/Bitcode/Reader/MetadataLoader.cpp llvm/lib/Bitcode/Writer/BitcodeWriter.cpp llvm/lib/Bitcode/Writer/ValueEnumerator.cpp llvm/lib/CodeGen/AsmPrinter/AsmPrinter.cpp llvm/lib/CodeGen/AsmPrinter/AsmPrinterDwarf.cpp llvm/lib/CodeGen/AsmPrinter/DebugLocEntry.h llvm/lib/CodeGen/AsmPrinter/DebugLocStream.cpp llvm/lib/CodeGen/AsmPrinter/DebugLocStream.h llvm/lib/CodeGen/AsmPrinter/DwarfCompileUnit.cpp llvm/lib/CodeGen/AsmPrinter/DwarfDebug.cpp llvm/lib/CodeGen/AsmPrinter/DwarfDebug.h llvm/lib/CodeGen/AsmPrinter/DwarfExpression.cpp llvm/lib/CodeGen/AsmPrinter/DwarfExpression.h llvm/lib/CodeGen/AsmPrinter/DwarfUnit.cpp llvm/lib/CodeGen/AsmPrinter/DwarfUnit.h llvm/lib/CodeGen/CFIInstrInserter.cpp llvm/lib/CodeGen/CodeGenPrepare.cpp llvm/lib/CodeGen/LiveDebugValues/InstrRefBasedImpl.cpp llvm/lib/CodeGen/LiveDebugValues/InstrRefBasedImpl.h llvm/lib/CodeGen/LiveDebugValues/LiveDebugValues.cpp llvm/lib/CodeGen/MIRParser/MILexer.cpp llvm/lib/CodeGen/MIRParser/MILexer.h llvm/lib/CodeGen/MIRParser/MIParser.cpp llvm/lib/CodeGen/MachineFunction.cpp llvm/lib/CodeGen/MachineInstr.cpp llvm/lib/CodeGen/MachineOperand.cpp llvm/lib/CodeGen/PrologEpilogInserter.cpp llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp llvm/lib/CodeGen/SelectionDAG/InstrEmitter.cpp llvm/lib/CodeGen/SelectionDAG/SelectionDAG.cpp llvm/lib/CodeGen/SelectionDAG/SelectionDAGBuilder.cpp llvm/lib/CodeGen/TargetFrameLoweringImpl.cpp llvm/lib/DWARFCFIChecker/DWARFCFIState.cpp llvm/lib/DebugInfo/DWARF/DWARFDie.cpp llvm/lib/DebugInfo/DWARF/DWARFExpressionPrinter.cpp llvm/lib/Frontend/OpenMP/OMPIRBuilder.cpp llvm/lib/IR/AsmWriter.cpp llvm/lib/IR/DIBuilder.cpp llvm/lib/IR/DIExpressionOptimizer.cpp llvm/lib/IR/DebugInfo.cpp llvm/lib/IR/DebugInfoMetadata.cpp llvm/lib/IR/LLVMContextImpl.h llvm/lib/IR/TypeFinder.cpp llvm/lib/IR/Verifier.cpp llvm/lib/MC/MCAsmStreamer.cpp llvm/lib/MC/MCDwarf.cpp llvm/lib/MC/MCParser/AsmParser.cpp llvm/lib/MC/MCParser/MasmParser.cpp llvm/lib/MC/MCStreamer.cpp llvm/lib/Target/AMDGPU/AMDGPUFrameLowering.cpp llvm/lib/Target/AMDGPU/AMDGPUFrameLowering.h llvm/lib/Target/AMDGPU/AMDGPULowerModuleLDSPass.cpp llvm/lib/Target/AMDGPU/AMDGPUMCInstLower.cpp llvm/lib/Target/AMDGPU/AMDGPUTargetMachine.cpp llvm/lib/Target/AMDGPU/AMDGPUTargetMachine.h llvm/lib/Target/AMDGPU/MCTargetDesc/AMDGPUMCAsmInfo.cpp llvm/lib/Target/AMDGPU/SIFrameLowering.cpp llvm/lib/Target/AMDGPU/SIFrameLowering.h llvm/lib/Target/AMDGPU/SIInsertHardClauses.cpp llvm/lib/Target/AMDGPU/SIInstrInfo.cpp llvm/lib/Target/AMDGPU/SIInstrInfo.h llvm/lib/Target/AMDGPU/SILowerSGPRSpills.cpp llvm/lib/Target/AMDGPU/SIMachineFunctionInfo.cpp llvm/lib/Target/AMDGPU/SIMachineFunctionInfo.h llvm/lib/Target/AMDGPU/SIRegisterInfo.cpp llvm/lib/Target/AMDGPU/SIRegisterInfo.h llvm/lib/Transforms/Coroutines/CoroFrame.cpp llvm/lib/Transforms/Instrumentation/InstrProfiling.cpp llvm/lib/Transforms/Scalar/InferAddressSpaces.cpp llvm/lib/Transforms/Scalar/SROA.cpp llvm/lib/Transforms/Utils/CodeExtractor.cpp llvm/lib/Transforms/Utils/Debugify.cpp llvm/lib/Transforms/Utils/Local.cpp llvm/test/Assembler/debug-info.ll llvm/test/Bindings/llvm-c/debug_info_new_format.ll llvm/test/CodeGen/AArch64/GlobalISel/irtranslator-extract-used-by-dbg.ll llvm/test/CodeGen/AArch64/dwarf-eh-prepare-dbg.ll llvm/test/CodeGen/AMDGPU/GlobalISel/assert-align.ll llvm/test/CodeGen/AMDGPU/GlobalISel/call-outgoing-stack-args.ll llvm/test/CodeGen/AMDGPU/GlobalISel/dynamic-alloca-uniform.ll llvm/test/CodeGen/AMDGPU/GlobalISel/localizer.ll llvm/test/CodeGen/AMDGPU/GlobalISel/memory-legalizer-atomic-fence.ll llvm/test/CodeGen/AMDGPU/GlobalISel/non-entry-alloca.ll llvm/test/CodeGen/AMDGPU/a-v-flat-atomicrmw.ll llvm/test/CodeGen/AMDGPU/a-v-global-atomicrmw.ll llvm/test/CodeGen/AMDGPU/abi-attribute-hints-undefined-behavior.ll llvm/test/CodeGen/AMDGPU/agpr-copy-no-free-registers.ll llvm/test/CodeGen/AMDGPU/amdgcn-call-whole-wave.ll llvm/test/CodeGen/AMDGPU/amdgcn.bitcast.1024bit.ll llvm/test/CodeGen/AMDGPU/amdgcn.bitcast.256bit.ll llvm/test/CodeGen/AMDGPU/amdgcn.bitcast.320bit.ll llvm/test/CodeGen/AMDGPU/amdgcn.bitcast.512bit.ll llvm/test/CodeGen/AMDGPU/amdgcn.bitcast.576bit.ll llvm/test/CodeGen/AMDGPU/amdgcn.bitcast.640bit.ll llvm/test/CodeGen/AMDGPU/amdgcn.bitcast.704bit.ll llvm/test/CodeGen/AMDGPU/amdgcn.bitcast.768bit.ll llvm/test/CodeGen/AMDGPU/amdgcn.bitcast.832bit.ll llvm/test/CodeGen/AMDGPU/amdgcn.bitcast.896bit.ll llvm/test/CodeGen/AMDGPU/amdgcn.bitcast.960bit.ll llvm/test/CodeGen/AMDGPU/amdgpu-cs-chain-cc.ll llvm/test/CodeGen/AMDGPU/amdgpu-cs-chain-preserve-cc.ll llvm/test/CodeGen/AMDGPU/amdgpu-simplify-libcall-pow-codegen.ll llvm/test/CodeGen/AMDGPU/attributor-flatscratchinit-undefined-behavior2.ll llvm/test/CodeGen/AMDGPU/bf16.ll llvm/test/CodeGen/AMDGPU/branch-folding-implicit-def-subreg.ll llvm/test/CodeGen/AMDGPU/branch-relax-spill.ll llvm/test/CodeGen/AMDGPU/call-args-inreg.ll llvm/test/CodeGen/AMDGPU/call-argument-types.ll llvm/test/CodeGen/AMDGPU/call-graph-register-usage.ll llvm/test/CodeGen/AMDGPU/call-preserved-registers.ll llvm/test/CodeGen/AMDGPU/callee-frame-setup.ll llvm/test/CodeGen/AMDGPU/callee-special-input-vgprs-packed.ll llvm/test/CodeGen/AMDGPU/callee-special-input-vgprs.ll llvm/test/CodeGen/AMDGPU/cross-block-use-is-not-abi-copy.ll llvm/test/CodeGen/AMDGPU/dbg-info-inline-at.ll llvm/test/CodeGen/AMDGPU/debug-value.ll llvm/test/CodeGen/AMDGPU/debug-value2.ll llvm/test/CodeGen/AMDGPU/dwarf-multi-register-use-crash.ll llvm/test/CodeGen/AMDGPU/dynamic-vgpr-reserve-stack-for-cwsr.ll llvm/test/CodeGen/AMDGPU/dynamic_stackalloc.ll llvm/test/CodeGen/AMDGPU/fix-frame-reg-in-custom-csr-spills.ll llvm/test/CodeGen/AMDGPU/frame-setup-without-sgpr-to-vgpr-spills.ll llvm/test/CodeGen/AMDGPU/function-args-inreg.ll llvm/test/CodeGen/AMDGPU/gfx-call-non-gfx-func.ll llvm/test/CodeGen/AMDGPU/gfx-callable-argument-types.ll llvm/test/CodeGen/AMDGPU/gfx-callable-preserved-registers.ll llvm/test/CodeGen/AMDGPU/gfx-callable-return-types.ll llvm/test/CodeGen/AMDGPU/global-alias.ll llvm/test/CodeGen/AMDGPU/identical-subrange-spill-infloop.ll llvm/test/CodeGen/AMDGPU/indirect-call.ll llvm/test/CodeGen/AMDGPU/insert-delay-alu-bug.ll llvm/test/CodeGen/AMDGPU/insert-waitcnts-crash.ll llvm/test/CodeGen/AMDGPU/llvm.amdgcn.readfirstlane.ll llvm/test/CodeGen/AMDGPU/llvm.dbg.value.ll llvm/test/CodeGen/AMDGPU/llvm.maximum.f64.ll llvm/test/CodeGen/AMDGPU/llvm.minimum.f64.ll llvm/test/CodeGen/AMDGPU/local-stack-alloc-block-sp-reference.ll llvm/test/CodeGen/AMDGPU/materialize-frame-index-sgpr.gfx10.ll llvm/test/CodeGen/AMDGPU/materialize-frame-index-sgpr.ll llvm/test/CodeGen/AMDGPU/maximumnum.bf16.ll llvm/test/CodeGen/AMDGPU/memintrinsic-unroll.ll llvm/test/CodeGen/AMDGPU/minimumnum.bf16.ll llvm/test/CodeGen/AMDGPU/mul24-pass-ordering.ll llvm/test/CodeGen/AMDGPU/need-fp-from-vgpr-spills.ll llvm/test/CodeGen/AMDGPU/nested-calls.ll llvm/test/CodeGen/AMDGPU/no-source-locations-in-prologue.ll llvm/test/CodeGen/AMDGPU/non-entry-alloca.ll llvm/test/CodeGen/AMDGPU/partial-regcopy-and-spill-missed-at-regalloc.ll llvm/test/CodeGen/AMDGPU/post-ra-soft-clause-dbg-info.ll llvm/test/CodeGen/AMDGPU/preserve-wwm-copy-dst-reg.ll llvm/test/CodeGen/AMDGPU/prologue-epilogue-markers.ll llvm/test/CodeGen/AMDGPU/ptr-arg-dbg-value.ll llvm/test/CodeGen/AMDGPU/s-getpc-b64-remat.ll llvm/test/CodeGen/AMDGPU/sgpr-spills-split-regalloc.ll llvm/test/CodeGen/AMDGPU/shufflevector.v2i64.v8i64.ll llvm/test/CodeGen/AMDGPU/si-optimize-vgpr-live-range-dbg-instr.ll llvm/test/CodeGen/AMDGPU/sibling-call.ll llvm/test/CodeGen/AMDGPU/spill-vgpr-block.ll llvm/test/CodeGen/AMDGPU/spill_more_than_wavesize_csr_sgprs.ll llvm/test/CodeGen/AMDGPU/split-arg-dbg-value.ll llvm/test/CodeGen/AMDGPU/stack-realign.ll llvm/test/CodeGen/AMDGPU/stacksave_stackrestore.ll llvm/test/CodeGen/AMDGPU/strictfp_f16_abi_promote.ll llvm/test/CodeGen/AMDGPU/swdev504645-global-fold.ll llvm/test/CodeGen/AMDGPU/tail-call-inreg-arguments.error.ll llvm/test/CodeGen/AMDGPU/transform-block-with-return-to-epilog.ll llvm/test/CodeGen/AMDGPU/tuple-allocation-failure.ll llvm/test/CodeGen/AMDGPU/unfold-masked-merge-scalar-variablemask.ll llvm/test/CodeGen/AMDGPU/unspill-vgpr-after-rewrite-vgpr-mfma.ll llvm/test/CodeGen/AMDGPU/unstructured-cfg-def-use-issue.ll llvm/test/CodeGen/AMDGPU/vgpr-tuple-allocation.ll llvm/test/CodeGen/AMDGPU/wave32.ll llvm/test/CodeGen/AMDGPU/whole-wave-functions.ll llvm/test/CodeGen/AMDGPU/whole-wave-register-copy.ll llvm/test/CodeGen/AMDGPU/whole-wave-register-spill.ll llvm/test/CodeGen/AMDGPU/wwm-reserved-spill.ll llvm/test/CodeGen/PowerPC/regalloc-fast-debug-spill.ll llvm/test/CodeGen/SPIRV/debug-info/debug-type-pointer.ll llvm/test/DebugInfo/AMDGPU/cfi.ll llvm/test/DebugInfo/AMDGPU/debug-loc-copy.ll llvm/test/DebugInfo/AMDGPU/pointer-address-space.ll llvm/test/DebugInfo/COFF/global_rust.ll llvm/test/DebugInfo/Generic/address_space_rvalue.ll llvm/test/DebugInfo/NVPTX/debug-info.ll llvm/test/DebugInfo/X86/dbg-rust-valid-enum-as-scope.ll llvm/test/DebugInfo/X86/stack_adjustments_trigger_cfa_frame_base.ll llvm/test/Transforms/InstCombine/cast-mul-select.ll llvm/test/Transforms/InstCombine/debuginfo-variables.ll llvm/test/Verifier/diderivedtype-address-space-atomic-type.ll llvm/test/Verifier/diderivedtype-address-space-const-type.ll llvm/test/Verifier/diderivedtype-address-space-friend.ll llvm/test/Verifier/diderivedtype-address-space-inheritance.ll llvm/test/Verifier/diderivedtype-address-space-member.ll llvm/test/Verifier/diderivedtype-address-space-ptr-to-member-type.ll llvm/test/Verifier/diderivedtype-address-space-restrict-type.ll llvm/test/Verifier/diderivedtype-address-space-rvalue-reference-type.ll llvm/test/Verifier/diderivedtype-address-space-typedef.ll llvm/test/Verifier/diderivedtype-address-space-volatile-type.ll llvm/tools/llvm-c-test/debuginfo.c llvm/tools/llvm-dwarfdump/llvm-dwarfdump.cpp llvm/unittests/IR/DebugInfoTest.cpp llvm/unittests/IR/MetadataTest.cpp mlir/lib/Target/LLVMIR/DebugTranslation.cpp mlir/lib/Target/LLVMIR/Dialect/OpenMP/OpenMPToLLVMIRTranslation.cpp mlir/test/Target/LLVMIR/Import/debug-info.ll
``````````

</details>


The following files introduce new uses of undef:
 - llvm/test/Assembler/DIExpressionNew.ll
 - llvm/test/CodeGen/AMDGPU/dwarf-multi-register-use-crash.ll
 - llvm/test/DebugInfo/verify-diop-based-diexpression.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/164641


More information about the llvm-commits mailing list