[llvm] [IR][CodeGen] Replace constrained FP intrinsics with fp.control/fp.except operand bundles (PR #191613)
via llvm-commits
llvm-commits at lists.llvm.org
Sat Apr 11 03:14:52 PDT 2026
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/test/Assembler/fp-intrinsics-nondefault.ll llvm/test/CodeGen/SelectionDAG/sdnode-fpenv-flags.ll llvm/test/Transforms/InstSimplify/constant-fold-fp-denormal-strict.ll llvm/include/llvm/ADT/FloatingPointMode.h llvm/include/llvm/CodeGen/BasicTTIImpl.h llvm/include/llvm/CodeGen/GlobalISel/IRTranslator.h llvm/include/llvm/CodeGen/ISDOpcodes.h llvm/include/llvm/CodeGen/TargetLowering.h llvm/include/llvm/IR/FPEnv.h llvm/include/llvm/IR/IRBuilder.h llvm/include/llvm/IR/InstrTypes.h llvm/include/llvm/IR/IntrinsicInst.h llvm/include/llvm/IR/LLVMContext.h llvm/include/llvm/IR/Type.h llvm/include/llvm/Support/ModRef.h llvm/lib/Analysis/ConstantFolding.cpp llvm/lib/Analysis/InstructionSimplify.cpp llvm/lib/Analysis/ValueTracking.cpp llvm/lib/CodeGen/ExpandVectorPredication.cpp llvm/lib/CodeGen/GlobalISel/IRTranslator.cpp llvm/lib/CodeGen/SelectionDAG/LegalizeFloatTypes.cpp llvm/lib/CodeGen/SelectionDAG/LegalizeVectorTypes.cpp llvm/lib/CodeGen/SelectionDAG/SelectionDAGBuilder.cpp llvm/lib/CodeGen/SelectionDAG/SelectionDAGBuilder.h llvm/lib/CodeGen/TargetLoweringBase.cpp llvm/lib/IR/AutoUpgrade.cpp llvm/lib/IR/FPEnv.cpp llvm/lib/IR/IRBuilder.cpp llvm/lib/IR/Instructions.cpp llvm/lib/IR/IntrinsicInst.cpp llvm/lib/IR/Intrinsics.cpp llvm/lib/IR/LLVMContext.cpp llvm/lib/IR/Type.cpp llvm/lib/IR/Verifier.cpp llvm/lib/Target/SPIRV/SPIRVEmitIntrinsics.cpp llvm/lib/Target/SPIRV/SPIRVPrepareFunctions.cpp llvm/lib/Transforms/InstCombine/InstCombineCalls.cpp llvm/lib/Transforms/Scalar/EarlyCSE.cpp llvm/lib/Transforms/Utils/CloneFunction.cpp llvm/lib/Transforms/Utils/Local.cpp llvm/test/Analysis/CostModel/ARM/mve-intrinsic-cost-kinds.ll llvm/test/Analysis/CostModel/X86/intrinsic-cost-kinds.ll llvm/test/Assembler/fp-intrinsics-attr.ll llvm/test/Bitcode/operand-bundles-bc-analyzer.ll llvm/test/CodeGen/AArch64/arm64-cvt-simd-fptoi-strictfp.ll llvm/test/CodeGen/AArch64/arm64-vmul.ll llvm/test/CodeGen/AArch64/floatdp_1source.ll llvm/test/CodeGen/AArch64/floatdp_2source.ll llvm/test/CodeGen/AArch64/fp-intrinsics-fp16.ll llvm/test/CodeGen/AArch64/fp-intrinsics-vector.ll llvm/test/CodeGen/AArch64/fp-intrinsics.ll llvm/test/CodeGen/AArch64/strict-fp-int-promote.ll llvm/test/CodeGen/AArch64/strict-fp-opt.ll llvm/test/CodeGen/AArch64/sve-streaming-mode-cvt-fp-to-int.ll llvm/test/CodeGen/AMDGPU/GlobalISel/irtranslator-constrained-fp.ll llvm/test/CodeGen/AMDGPU/GlobalISel/strict_fma.f16.ll llvm/test/CodeGen/AMDGPU/GlobalISel/strict_fma.f32.ll llvm/test/CodeGen/AMDGPU/GlobalISel/strict_fma.f64.ll llvm/test/CodeGen/AMDGPU/amdgpu-simplify-libcall-pow.ll llvm/test/CodeGen/AMDGPU/amdgpu-simplify-libcall-pown.ll llvm/test/CodeGen/AMDGPU/amdgpu-simplify-libcall-rootn.ll llvm/test/CodeGen/AMDGPU/fmul-to-ldexp.ll llvm/test/CodeGen/AMDGPU/fneg-combines.f16.ll llvm/test/CodeGen/AMDGPU/fsub-as-fneg-src-modifier.ll llvm/test/CodeGen/AMDGPU/global_atomic_optimizer_fp_rtn.ll llvm/test/CodeGen/AMDGPU/global_atomics_optimizer_fp_no_rtn.ll llvm/test/CodeGen/AMDGPU/global_atomics_scan_fadd.ll llvm/test/CodeGen/AMDGPU/global_atomics_scan_fsub.ll llvm/test/CodeGen/AMDGPU/strict_fpext.ll llvm/test/CodeGen/AMDGPU/strict_ldexp.f16.ll llvm/test/CodeGen/AMDGPU/strict_ldexp.f32.ll llvm/test/CodeGen/AMDGPU/strictfp_f16_abi_promote.ll llvm/test/CodeGen/ARM/fp-intrinsics-vector.ll llvm/test/CodeGen/ARM/fp-intrinsics.ll llvm/test/CodeGen/ARM/fp16-fullfp16.ll llvm/test/CodeGen/ARM/strict-fp-int-promote.ll llvm/test/CodeGen/ARM/strict-fp-ops.ll llvm/test/CodeGen/ARM/strictfp_f16_abi_promote.ll llvm/test/CodeGen/LoongArch/lsx/issue174606.ll llvm/test/CodeGen/Mips/fp-intrinsics.ll llvm/test/CodeGen/Mips/fp-strict-fp-ops.ll llvm/test/CodeGen/PowerPC/cse-despite-rounding-mode.ll llvm/test/CodeGen/PowerPC/fmf-propagation.ll llvm/test/CodeGen/PowerPC/fp-strict-conv-f128.ll llvm/test/CodeGen/PowerPC/fp-strict-fcmp-noopt.ll llvm/test/CodeGen/PowerPC/fp-strict-fcmp.ll llvm/test/CodeGen/PowerPC/fp-strict-round.ll llvm/test/CodeGen/PowerPC/fp-strict.ll llvm/test/CodeGen/PowerPC/nofpexcept.ll llvm/test/CodeGen/PowerPC/ppcf128-constrained-fp-intrinsics.ll llvm/test/CodeGen/PowerPC/respect-rounding-mode.ll llvm/test/CodeGen/PowerPC/scalar-rounding-ops.ll llvm/test/CodeGen/PowerPC/vector-constrained-fp-intrinsics.ll llvm/test/CodeGen/RISCV/double-arith-strict.ll llvm/test/CodeGen/RISCV/double-fcmp-strict.ll llvm/test/CodeGen/RISCV/double-intrinsics-strict.ll llvm/test/CodeGen/RISCV/double-zfa.ll llvm/test/CodeGen/RISCV/float-arith-strict.ll llvm/test/CodeGen/RISCV/float-fcmp-strict.ll llvm/test/CodeGen/RISCV/float-intrinsics-strict.ll llvm/test/CodeGen/RISCV/float-zfa.ll llvm/test/CodeGen/RISCV/half-convert-strict.ll llvm/test/CodeGen/RISCV/half-fcmp-strict.ll llvm/test/CodeGen/RISCV/half-zfa.ll llvm/test/CodeGen/RISCV/rvv/fceil-constrained-sdnode.ll llvm/test/CodeGen/RISCV/rvv/ffloor-constrained-sdnode.ll llvm/test/CodeGen/RISCV/rvv/fixed-vectors-fceil-constrained-sdnode.ll llvm/test/CodeGen/RISCV/rvv/fixed-vectors-ffloor-constrained-sdnode.ll llvm/test/CodeGen/RISCV/rvv/fixed-vectors-fnearbyint-constrained-sdnode.ll llvm/test/CodeGen/RISCV/rvv/fixed-vectors-fround-constrained-sdnode.ll llvm/test/CodeGen/RISCV/rvv/fixed-vectors-froundeven-constrained-sdnode.ll llvm/test/CodeGen/RISCV/rvv/fixed-vectors-ftrunc-constrained-sdnode.ll llvm/test/CodeGen/RISCV/rvv/fixed-vectors-vfcmp-constrained-sdnode.ll llvm/test/CodeGen/RISCV/rvv/fixed-vectors-vfmadd-constrained-sdnode.ll llvm/test/CodeGen/RISCV/rvv/fixed-vectors-vfptoi-constrained-sdnode.ll llvm/test/CodeGen/RISCV/rvv/fnearbyint-constrained-sdnode.ll llvm/test/CodeGen/RISCV/rvv/fround-constrained-sdnode.ll llvm/test/CodeGen/RISCV/rvv/froundeven-constrained-sdnode.ll llvm/test/CodeGen/RISCV/rvv/ftrunc-constrained-sdnode.ll llvm/test/CodeGen/RISCV/rvv/rvv-peephole-vmerge-vops.ll llvm/test/CodeGen/RISCV/rvv/stores-of-loads-merging.ll llvm/test/CodeGen/RISCV/rvv/vfadd-constrained-sdnode.ll llvm/test/CodeGen/RISCV/rvv/vfcmp-constrained-sdnode.ll llvm/test/CodeGen/RISCV/rvv/vfdiv-constrained-sdnode.ll llvm/test/CodeGen/RISCV/rvv/vfmadd-constrained-sdnode.ll llvm/test/CodeGen/RISCV/rvv/vfmsub-constrained-sdnode.ll llvm/test/CodeGen/RISCV/rvv/vfmul-constrained-sdnode.ll llvm/test/CodeGen/RISCV/rvv/vfnmadd-constrained-sdnode.ll llvm/test/CodeGen/RISCV/rvv/vfnmsub-constrained-sdnode.ll llvm/test/CodeGen/RISCV/rvv/vfptoi-constrained-sdnode.ll llvm/test/CodeGen/RISCV/rvv/vfsub-constrained-sdnode.ll llvm/test/CodeGen/RISCV/rvv/vmv.v.v-peephole.ll llvm/test/CodeGen/RISCV/zfh-half-intrinsics-strict.ll llvm/test/CodeGen/RISCV/zfhmin-half-intrinsics-strict.ll llvm/test/CodeGen/SPIRV/llvm-intrinsics/constrained-fmuladd.ll llvm/test/CodeGen/SystemZ/fp-strict-alias.ll llvm/test/CodeGen/SystemZ/fp-strict-cmp-04.ll llvm/test/CodeGen/SystemZ/fp-strict-cmp-05.ll llvm/test/CodeGen/SystemZ/fp-strict-conv-08.ll llvm/test/CodeGen/SystemZ/fp-strict-conv-10.ll llvm/test/CodeGen/SystemZ/fp-strict-conv-12.ll llvm/test/CodeGen/SystemZ/fp-strict-mul-06.ll llvm/test/CodeGen/SystemZ/sext-zext.ll llvm/test/CodeGen/SystemZ/vector-constrained-fp-intrinsics.ll llvm/test/CodeGen/VE/Scalar/cast.ll llvm/test/CodeGen/X86/avx512fp16-frem.ll llvm/test/CodeGen/X86/bfloat-constrained.ll llvm/test/CodeGen/X86/float-strict-powi-convert.ll llvm/test/CodeGen/X86/fp-intrinsics-flags-x86_64.ll llvm/test/CodeGen/X86/fp-intrinsics-flags.ll llvm/test/CodeGen/X86/fp-intrinsics-fma.ll llvm/test/CodeGen/X86/fp-intrinsics.ll llvm/test/CodeGen/X86/fp-strict-libcalls-msvc32.ll llvm/test/CodeGen/X86/fp-strict-scalar-cmp-fp16.ll llvm/test/CodeGen/X86/fp-strict-scalar-fp16.ll llvm/test/CodeGen/X86/fp-strict-scalar-fptoint-fp16.ll llvm/test/CodeGen/X86/fp-strict-scalar-fptoint.ll llvm/test/CodeGen/X86/fp-strict-scalar-inttofp-fp16.ll llvm/test/CodeGen/X86/fp-strict-scalar-inttofp.ll llvm/test/CodeGen/X86/fp-strict-scalar-round-fp16.ll llvm/test/CodeGen/X86/fp-strict-scalar-round.ll llvm/test/CodeGen/X86/fp-strict-scalar.ll llvm/test/CodeGen/X86/fp128-cast-strict.ll llvm/test/CodeGen/X86/fp128-libcalls-strict.ll llvm/test/CodeGen/X86/fp80-strict-libcalls.ll llvm/test/CodeGen/X86/fp80-strict-scalar.ll llvm/test/CodeGen/X86/half-constrained.ll llvm/test/CodeGen/X86/half-darwin.ll llvm/test/CodeGen/X86/ldexp-strict.ll llvm/test/CodeGen/X86/llrint-conv.ll llvm/test/CodeGen/X86/lrint-conv-i32.ll llvm/test/CodeGen/X86/lrint-conv-i64.ll llvm/test/CodeGen/X86/scalarize-strict-fsetcc.ll llvm/test/CodeGen/X86/sse-scalar-fp-arith.ll llvm/test/CodeGen/X86/strict-fsub-combines.ll llvm/test/CodeGen/X86/vec-strict-128-fp16.ll llvm/test/CodeGen/X86/vec-strict-cmp-128-fp16.ll llvm/test/CodeGen/X86/vec-strict-cmp-128.ll llvm/test/CodeGen/X86/vec-strict-cmp-256-fp16.ll llvm/test/CodeGen/X86/vec-strict-cmp-256.ll llvm/test/CodeGen/X86/vec-strict-cmp-512-fp16.ll llvm/test/CodeGen/X86/vec-strict-cmp-512.ll llvm/test/CodeGen/X86/vec-strict-cmp-sub128.ll llvm/test/CodeGen/X86/vec-strict-fptoint-128-fp16.ll llvm/test/CodeGen/X86/vec-strict-fptoint-128.ll llvm/test/CodeGen/X86/vec-strict-fptoint-256-fp16.ll llvm/test/CodeGen/X86/vec-strict-fptoint-256.ll llvm/test/CodeGen/X86/vec-strict-fptoint-512.ll llvm/test/CodeGen/X86/vec-strict-inttofp-128.ll llvm/test/CodeGen/X86/vec-strict-inttofp-256.ll llvm/test/CodeGen/X86/vec-strict-inttofp-512.ll llvm/test/CodeGen/X86/vector-constrained-fp-intrinsics-flags.ll llvm/test/CodeGen/X86/vector-constrained-fp-intrinsics-fma.ll llvm/test/CodeGen/X86/vector-constrained-fp-intrinsics.ll llvm/test/CodeGen/X86/vector-half-conversions.ll llvm/test/CodeGen/X86/vector-shuffle-combining.ll llvm/test/Feature/fp-intrinsics.ll llvm/test/Instrumentation/MemorySanitizer/AArch64/arm64-vmul.ll llvm/test/Transforms/AtomicExpand/AMDGPU/expand-atomic-rmw-fadd.ll llvm/test/Transforms/AtomicExpand/AMDGPU/expand-atomic-rmw-fmax.ll llvm/test/Transforms/AtomicExpand/AMDGPU/expand-atomic-rmw-fmin.ll llvm/test/Transforms/AtomicExpand/AMDGPU/expand-atomic-rmw-fsub.ll llvm/test/Transforms/Attributor/nofpclass-log.ll llvm/test/Transforms/Attributor/nofpclass-sqrt.ll llvm/test/Transforms/Attributor/nofpclass.ll llvm/test/Transforms/EarlyCSE/defaultfp-strictfp.ll llvm/test/Transforms/EarlyCSE/ebstrict-strictfp.ll llvm/test/Transforms/EarlyCSE/mixed-strictfp.ll llvm/test/Transforms/EarlyCSE/nonmixed-strictfp.ll llvm/test/Transforms/EarlyCSE/round-dyn-strictfp.ll llvm/test/Transforms/EarlyCSE/tfpropagation.ll llvm/test/Transforms/FunctionSpecialization/solver-constant-strictfpmetadata.ll llvm/test/Transforms/Inline/inline-strictfp.ll llvm/test/Transforms/InstCombine/AMDGPU/amdgcn-intrinsics.ll llvm/test/Transforms/InstCombine/AMDGPU/fmed3-fpext-fold.ll llvm/test/Transforms/InstCombine/constrained.ll llvm/test/Transforms/InstCombine/fpclass-check-idioms.ll llvm/test/Transforms/InstCombine/fsqrtdiv-transform.ll llvm/test/Transforms/InstCombine/is_fpclass.ll llvm/test/Transforms/InstCombine/ldexp.ll llvm/test/Transforms/InstSimplify/X86/fp-nan-strictfp.ll llvm/test/Transforms/InstSimplify/constfold-constrained.ll llvm/test/Transforms/InstSimplify/fast-math-strictfp.ll llvm/test/Transforms/InstSimplify/fdiv-strictfp.ll llvm/test/Transforms/InstSimplify/floating-point-arithmetic-strictfp.ll llvm/test/Transforms/InstSimplify/fp-undef-poison-strictfp.ll llvm/test/Transforms/InstSimplify/ldexp.ll llvm/test/Transforms/InstSimplify/strictfp-fadd.ll llvm/test/Transforms/InstSimplify/strictfp-fsub.ll llvm/test/Transforms/InstSimplify/strictfp-sqrt-nonneg.ll llvm/test/Transforms/MergeFunc/merge-fp-intrinsics.ll llvm/test/Transforms/SCCP/strictfp-phis-fcmp.ll llvm/test/Transforms/SCCP/strictfp-phis-fcmps.ll llvm/test/Transforms/Util/libcalls-shrinkwrap-double.ll llvm/test/Transforms/Util/libcalls-shrinkwrap-float.ll llvm/test/Transforms/Util/libcalls-shrinkwrap-long-double.ll llvm/test/Transforms/Util/libcalls-shrinkwrap-strictfp.ll llvm/test/Verifier/fp-intrinsics-pass.ll llvm/test/Verifier/fp-intrinsics.ll llvm/test/tools/llvm-reduce/inline-call-sites.ll llvm/unittests/Bitcode/BitReaderTest.cpp llvm/unittests/IR/IRBuilderTest.cpp llvm/unittests/IR/InstructionsTest.cpp
``````````
</details>
The following files introduce new uses of undef:
- llvm/test/Transforms/InstSimplify/fp-undef-poison-strictfp.ll
- llvm/test/Transforms/InstSimplify/ldexp.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/191613
More information about the llvm-commits
mailing list