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 
llvm/include/llvm/IR/Instructions.h llvm/lib/IR/Instructions.cpp 
llvm/lib/SandboxIR/Tracker.cpp llvm/test/CodeGen/WinEH/wineh-no-demotion.ll 
llvm/test/Examples/IRTransforms/SimplifyCFG/tut-simplify-cfg5-del-phis-for-dead-block.ll
 llvm/test/Transforms/CodeGenPrepare/X86/sink-addrmode-base.ll 
llvm/test/Transforms/Coroutines/coro-catchswitch.ll 
llvm/test/Transforms/DFAJumpThreading/dfa-jump-threading-transform.ll 
llvm/test/Transforms/DFAJumpThreading/dfa-unfold-select.ll 
llvm/test/Transforms/DFAJumpThreading/equivalent-states.ll 
llvm/test/Transforms/IndVarSimplify/eliminate-backedge.ll 
llvm/test/Transforms/Inline/inline_invoke.ll 
llvm/test/Transforms/JumpThreading/ddt-crash.ll 
llvm/test/Transforms/JumpThreading/fold-not-thread.ll 
llvm/test/Transforms/JumpThreading/invalidate-lvi.ll 
llvm/test/Transforms/LoopSimplifyCFG/phi_with_duplicating_inputs.ll 
llvm/test/Transforms/LoopUnroll/AArch64/apple-unrolling-multi-exit.ll 
llvm/test/Transforms/LoopUnroll/AArch64/unrolling-multi-exit.ll 
llvm/test/Transforms/LoopUnroll/full-unroll-one-unpredictable-exit.ll 
llvm/test/Transforms/LoopUnroll/partial-unroll-non-latch-exit.ll 
llvm/test/Transforms/LoopUnroll/peel-loop.ll 
llvm/test/Transforms/LoopUnroll/runtime-loop-multiple-exits.ll 
llvm/test/Transforms/LoopUnroll/scevunroll.ll 
llvm/test/Transforms/LoopUnroll/unroll-header-exiting-with-phis-multiple-exiting-blocks.ll
 llvm/test/Transforms/LoopVectorize/AArch64/simple_early_exit.ll 
llvm/test/Transforms/LoopVectorize/single-early-exit-deref-assumptions.ll 
llvm/test/Transforms/LoopVectorize/single-early-exit-interleave.ll 
llvm/test/Transforms/LoopVectorize/single_early_exit.ll 
llvm/test/Transforms/LoopVectorize/single_early_exit_live_outs.ll 
llvm/test/Transforms/LoopVectorize/trip-count-expansion-may-introduce-ub.ll 
llvm/test/Transforms/LoopVectorize/vector-loop-backedge-elimination-early-exit.ll
 llvm/test/Transforms/LowerSwitch/2014-06-23-PHIlowering.ll 
llvm/test/Transforms/LowerSwitch/do-not-handle-impossible-values.ll 
llvm/test/Transforms/MergeICmps/X86/alias-merge-blocks.ll 
llvm/test/Transforms/MergeICmps/X86/entry-block-shuffled-2.ll 
llvm/test/Transforms/MergeICmps/X86/entry-block-shuffled.ll 
llvm/test/Transforms/MergeICmps/X86/pr59740.ll 
llvm/test/Transforms/PGOProfile/chr.ll 
llvm/test/Transforms/PhaseOrdering/AArch64/std-find.ll 
llvm/test/Transforms/PhaseOrdering/X86/vector-reductions-logical.ll 
llvm/test/Transforms/PhaseOrdering/switch-sext.ll 
llvm/test/Transforms/SimpleLoopUnswitch/inject-invariant-conditions.ll 
llvm/test/Transforms/SimpleLoopUnswitch/nontrivial-unswitch-freeze.ll 
llvm/test/Transforms/SimpleLoopUnswitch/nontrivial-unswitch.ll 
llvm/test/Transforms/SimplifyCFG/EqualPHIEdgeBlockMerge.ll 
llvm/test/Transforms/SimplifyCFG/ForwardSwitchConditionToPHI.ll 
llvm/test/Transforms/SimplifyCFG/Hexagon/switch-to-lookup-table.ll 
llvm/test/Transforms/SimplifyCFG/HoistCode.ll 
llvm/test/Transforms/SimplifyCFG/RISCV/switch-of-powers-of-two.ll 
llvm/test/Transforms/SimplifyCFG/UnreachableEliminate.ll 
llvm/test/Transforms/SimplifyCFG/X86/debugloc-switch-powers-of-two.ll 
llvm/test/Transforms/SimplifyCFG/X86/empty-cleanuppad.ll 
llvm/test/Transforms/SimplifyCFG/X86/switch-of-powers-of-two.ll 
llvm/test/Transforms/SimplifyCFG/X86/switch-to-lookup-gep.ll 
llvm/test/Transforms/SimplifyCFG/X86/switch-to-lookup-globals.ll 
llvm/test/Transforms/SimplifyCFG/X86/switch_to_lookup_table.ll 
llvm/test/Transforms/SimplifyCFG/X86/switch_to_lookup_table_big.ll 
llvm/test/Transforms/SimplifyCFG/avoid-complex-phi.ll 
llvm/test/Transforms/SimplifyCFG/branch-fold-threshold.ll 
llvm/test/Transforms/SimplifyCFG/branch-fold.ll 
llvm/test/Transforms/SimplifyCFG/merge-phis-in-switch.ll 
llvm/test/Transforms/SimplifyCFG/multiple-phis.ll 
llvm/test/Transforms/SimplifyCFG/rangereduce.ll 
llvm/test/Transforms/SimplifyCFG/switch-dup-bbs.ll 
llvm/test/Transforms/SimplifyCFG/switch-on-const.ll 
llvm/test/Transforms/SimplifyCFG/switch-simplify-crash2.ll 
llvm/test/Transforms/SimplifyCFG/switch-to-select-two-case.ll 
llvm/test/Transforms/SimplifyCFG/switch-transformations-no-lut.ll 
llvm/test/Transforms/SimplifyCFG/switch_create-custom-dl.ll 
llvm/test/Transforms/SimplifyCFG/switch_create.ll 
llvm/test/Transforms/Util/lowerswitch.ll 
llvm/unittests/SandboxIR/SandboxIRTest.cpp
``````````

</details>


The following files introduce new uses of undef:
 - llvm/test/Transforms/DFAJumpThreading/dfa-unfold-select.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/173893
_______________________________________________
cfe-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to