Skip to content

Conversation

@paperchalice
Copy link
Contributor

@paperchalice paperchalice commented Oct 21, 2025

These global flags block furthur improvements for clang, users should always use fast-math flags
see also https://discourse.llvm.org/t/rfc-honor-pragmas-with-ffp-contract-fast/80797

@paperchalice paperchalice force-pushed the rm-unsafe-fp-math branch 3 times, most recently from 4cb6f92 to 05163b1 Compare October 21, 2025 13:04
@llvmbot llvmbot added backend:SPIR-V LTO Link time optimization (regular/full LTO or ThinLTO) backend:NVPTX coroutines C++20 coroutines llvm:SelectionDAG SelectionDAGISel as well compiler-rt:sanitizer llvm:ir llvm:analysis Includes value tracking, cost tables and constant folding llvm:transforms llvm:binary-utilities clang:openmp OpenMP related changes to Clang labels Oct 21, 2025
@llvmbot
Copy link
Member

llvmbot commented Oct 21, 2025

@llvm/pr-subscribers-llvm-ir
@llvm/pr-subscribers-coroutines
@llvm/pr-subscribers-lld-wasm
@llvm/pr-subscribers-llvm-transforms
@llvm/pr-subscribers-backend-risc-v
@llvm/pr-subscribers-backend-x86
@llvm/pr-subscribers-backend-aarch64
@llvm/pr-subscribers-compiler-rt-sanitizer
@llvm/pr-subscribers-lld

@llvm/pr-subscribers-backend-hexagon

Author: None (paperchalice)

Changes

These global flags block furthur improvements for clang, users should always use fast-math flags
see also https://discourse.llvm.org/t/rfc-honor-pragmas-with-ffp-contract-fast/80797


Patch is 1.41 MiB, truncated to 20.00 KiB below, full version: https://github.com/llvm/llvm-project/pull/164400.diff

1005 Files Affected:

  • (modified) clang/lib/CodeGen/BackendUtil.cpp (-6)
  • (modified) lld/test/COFF/Inputs/undefined-symbol-lto-a.ll (+2-2)
  • (modified) lld/test/COFF/Inputs/undefined-symbol-lto-b.ll (+1-1)
  • (modified) lld/test/COFF/Inputs/undefined-symbol-multi-lto.ll (+2-2)
  • (modified) lld/test/MachO/lto-mattrs.ll (+1-1)
  • (modified) lld/test/wasm/Inputs/debuginfo1.ll (+3-3)
  • (modified) lld/test/wasm/Inputs/debuginfo2.ll (+1-1)
  • (modified) lld/test/wasm/debug-removed-fn.ll (+1-1)
  • (modified) llvm/docs/CommandGuide/llc.rst (-7)
  • (modified) llvm/docs/CommandGuide/lli.rst (-5)
  • (modified) llvm/docs/SourceLevelDebugging.rst (+1-1)
  • (modified) llvm/include/llvm/CodeGen/CommandFlags.h (-2)
  • (modified) llvm/include/llvm/IR/Attributes.td (-2)
  • (modified) llvm/include/llvm/Target/TargetOptions.h (+2-10)
  • (modified) llvm/lib/CodeGen/CommandFlags.cpp (-9)
  • (modified) llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp (+6-6)
  • (modified) llvm/lib/CodeGen/TargetOptionsImpl.cpp (+1-1)
  • (modified) llvm/lib/Target/TargetMachine.cpp (-1)
  • (modified) llvm/lib/Transforms/Instrumentation/NumericalStabilitySanitizer.cpp (-1)
  • (modified) llvm/test/Analysis/BranchProbabilityInfo/pr22718.ll (+3-3)
  • (modified) llvm/test/Analysis/CostModel/SystemZ/intrinsic-cost-crash.ll (+1-1)
  • (modified) llvm/test/Analysis/Delinearization/constant_functions_multi_dim.ll (+2-2)
  • (modified) llvm/test/Analysis/DependenceAnalysis/MIVCheckConst.ll (+1-1)
  • (modified) llvm/test/Analysis/DependenceAnalysis/NonCanonicalizedSubscript.ll (+1-1)
  • (modified) llvm/test/Analysis/MemoryDependenceAnalysis/invariant.group-bug.ll (+2-2)
  • (modified) llvm/test/Analysis/MemorySSA/pr28880.ll (+1-1)
  • (modified) llvm/test/Analysis/MemorySSA/pr39197.ll (+1-1)
  • (modified) llvm/test/Analysis/MemorySSA/pr40038.ll (+1-1)
  • (modified) llvm/test/Analysis/MemorySSA/pr43569.ll (+1-1)
  • (modified) llvm/test/Analysis/ScalarEvolution/pr22674.ll (+1-1)
  • (modified) llvm/test/Analysis/ScalarEvolution/scev-canonical-mode.ll (+1-1)
  • (modified) llvm/test/Analysis/TypeBasedAliasAnalysis/PR17620.ll (+2-2)
  • (modified) llvm/test/Analysis/TypeBasedAliasAnalysis/tbaa-path.ll (+1-1)
  • (modified) llvm/test/Bitcode/DILocation-implicit-code.ll (+2-2)
  • (modified) llvm/test/Bitcode/drop-debug-info.3.5.ll (+1-1)
  • (modified) llvm/test/Bitcode/upgrade-tbaa.ll (+1-1)
  • (modified) llvm/test/CodeGen/AArch64/GlobalISel/inline-memcpy.mir (+1-1)
  • (modified) llvm/test/CodeGen/AArch64/GlobalISel/inline-memmove.mir (+1-1)
  • (modified) llvm/test/CodeGen/AArch64/GlobalISel/inline-memset.mir (+1-1)
  • (modified) llvm/test/CodeGen/AArch64/aarch64-2014-08-11-MachineCombinerCrash.ll (+1-1)
  • (modified) llvm/test/CodeGen/AArch64/aarch64-a57-fp-load-balancing.ll (+2-2)
  • (modified) llvm/test/CodeGen/AArch64/aarch64-dynamic-stack-layout.ll (+2-2)
  • (modified) llvm/test/CodeGen/AArch64/aarch64-fix-cortex-a53-835769.ll (+2-2)
  • (modified) llvm/test/CodeGen/AArch64/aarch64-mov-debug-locs.mir (+2-2)
  • (modified) llvm/test/CodeGen/AArch64/arm64-detect-vec-redux.ll (+1-1)
  • (modified) llvm/test/CodeGen/AArch64/arm64-fma-combine-with-fpfusion.ll (+1-1)
  • (modified) llvm/test/CodeGen/AArch64/arm64-fma-combines.ll (+1-1)
  • (modified) llvm/test/CodeGen/AArch64/arm64-indexed-vector-ldst-2.ll (+1-1)
  • (modified) llvm/test/CodeGen/AArch64/arm64-misched-basic-A53.ll (+1-1)
  • (modified) llvm/test/CodeGen/AArch64/arm64-misched-basic-A57.ll (+1-1)
  • (modified) llvm/test/CodeGen/AArch64/arm64-rounding.ll (+1-1)
  • (modified) llvm/test/CodeGen/AArch64/arm64-storebytesmerge.ll (+2-2)
  • (modified) llvm/test/CodeGen/AArch64/arm64-triv-disjoint-mem-access.ll (+1-1)
  • (modified) llvm/test/CodeGen/AArch64/bti-branch-relaxation.ll (+1-1)
  • (modified) llvm/test/CodeGen/AArch64/consthoist-gep.ll (+1-1)
  • (modified) llvm/test/CodeGen/AArch64/csel-zero-float.ll (+1-1)
  • (modified) llvm/test/CodeGen/AArch64/dag-combine-invaraints.ll (+2-2)
  • (modified) llvm/test/CodeGen/AArch64/partial-pipeline-execution.ll (+1-1)
  • (modified) llvm/test/CodeGen/AArch64/recp-fastmath.ll (+2-2)
  • (modified) llvm/test/CodeGen/AArch64/stack-tagging-ex-1.ll (+1-1)
  • (modified) llvm/test/CodeGen/AArch64/stack-tagging-ex-2.ll (+2-2)
  • (modified) llvm/test/CodeGen/AArch64/stack-tagging-untag-placement.ll (+1-1)
  • (modified) llvm/test/CodeGen/AArch64/stack_guard_remat.ll (+1-1)
  • (modified) llvm/test/CodeGen/AArch64/svtcf-fmul-fdiv-combine.ll (+1-1)
  • (modified) llvm/test/CodeGen/AArch64/vector_merge_dep_check.ll (+1-1)
  • (modified) llvm/test/CodeGen/AArch64/wineh-frame5.mir (+2-2)
  • (modified) llvm/test/CodeGen/AArch64/wineh-frame6.mir (+2-2)
  • (modified) llvm/test/CodeGen/AArch64/wineh-frame7.mir (+2-2)
  • (modified) llvm/test/CodeGen/AArch64/wineh-frame8.mir (+1-1)
  • (modified) llvm/test/CodeGen/AArch64/wineh5.mir (+2-2)
  • (modified) llvm/test/CodeGen/AArch64/wineh_shrinkwrap.mir (+2-2)
  • (modified) llvm/test/CodeGen/AMDGPU/GlobalISel/combine-fma-unmerge-values.mir (+1-1)
  • (modified) llvm/test/CodeGen/AMDGPU/GlobalISel/inst-select-fract.f64.mir (+2-2)
  • (modified) llvm/test/CodeGen/AMDGPU/combine_andor_with_cmps.ll (+1-1)
  • (modified) llvm/test/CodeGen/AMDGPU/fadd-fma-fmul-combine.ll (+4-4)
  • (modified) llvm/test/CodeGen/AMDGPU/fdiv.f64.ll (+1-1)
  • (modified) llvm/test/CodeGen/AMDGPU/fmad-formation-fmul-distribute-denormal-mode.ll (+1-1)
  • (modified) llvm/test/CodeGen/AMDGPU/fmed3.bf16.ll (+2-2)
  • (modified) llvm/test/CodeGen/AMDGPU/fmed3.ll (+1-1)
  • (modified) llvm/test/CodeGen/AMDGPU/fneg-combines.legal.f16.ll (+1-1)
  • (modified) llvm/test/CodeGen/AMDGPU/fneg-combines.ll (+1-1)
  • (modified) llvm/test/CodeGen/AMDGPU/fpext.f16.ll (+5-5)
  • (modified) llvm/test/CodeGen/AMDGPU/fptosi.f16.ll (+4-4)
  • (modified) llvm/test/CodeGen/AMDGPU/fptoui.f16.ll (+4-4)
  • (modified) llvm/test/CodeGen/AMDGPU/fptrunc.ll (+4-4)
  • (modified) llvm/test/CodeGen/AMDGPU/fract.f64.ll (+2-2)
  • (modified) llvm/test/CodeGen/AMDGPU/fract.ll (+2-2)
  • (modified) llvm/test/CodeGen/AMDGPU/frem.ll (+2-2)
  • (modified) llvm/test/CodeGen/AMDGPU/fsqrt.f64.ll (+1-2)
  • (modified) llvm/test/CodeGen/AMDGPU/fsqrt.r600.ll (+1-1)
  • (modified) llvm/test/CodeGen/AMDGPU/inline-attr.ll (+9-9)
  • (modified) llvm/test/CodeGen/AMDGPU/llvm.exp2.ll (+1-1)
  • (modified) llvm/test/CodeGen/AMDGPU/llvm.log2.ll (+1-1)
  • (modified) llvm/test/CodeGen/AMDGPU/minmax.ll (+1-1)
  • (modified) llvm/test/CodeGen/AMDGPU/prevent-fmul-hoist-ir.ll (+1-1)
  • (modified) llvm/test/CodeGen/AMDGPU/sitofp.f16.ll (+4-4)
  • (modified) llvm/test/CodeGen/AMDGPU/uitofp.f16.ll (+4-4)
  • (modified) llvm/test/CodeGen/ARM/2014-05-14-DwarfEHCrash.ll (+1-1)
  • (modified) llvm/test/CodeGen/ARM/ARMLoadStoreDBG.mir (+2-2)
  • (modified) llvm/test/CodeGen/ARM/Windows/wineh-basic.ll (+2-2)
  • (modified) llvm/test/CodeGen/ARM/byval_load_align.ll (+2-2)
  • (modified) llvm/test/CodeGen/ARM/cfguard-module-flag.ll (+1-1)
  • (modified) llvm/test/CodeGen/ARM/clang-section.ll (+2-2)
  • (modified) llvm/test/CodeGen/ARM/cmse-clear-float-bigend.mir (+1-1)
  • (modified) llvm/test/CodeGen/ARM/coalesce-dbgvalue.ll (+2-2)
  • (modified) llvm/test/CodeGen/ARM/constantpool-promote-dbg.ll (+1-1)
  • (modified) llvm/test/CodeGen/ARM/constantpool-promote.ll (+2-2)
  • (modified) llvm/test/CodeGen/ARM/early-cfi-sections.ll (+1-1)
  • (modified) llvm/test/CodeGen/ARM/fp16-vld.ll (+1-1)
  • (modified) llvm/test/CodeGen/ARM/global-merge-1.ll (+3-3)
  • (modified) llvm/test/CodeGen/ARM/isel-v8i32-crash.ll (+1-1)
  • (modified) llvm/test/CodeGen/ARM/out-of-registers.ll (+1-1)
  • (modified) llvm/test/CodeGen/ARM/relax-per-target-feature.ll (+1-1)
  • (modified) llvm/test/CodeGen/ARM/softfp-constant-comparison.ll (+1-1)
  • (modified) llvm/test/CodeGen/ARM/stack-protector-bmovpcb_call.ll (+2-2)
  • (modified) llvm/test/CodeGen/ARM/stack_guard_remat.ll (+1-1)
  • (modified) llvm/test/CodeGen/ARM/struct-byval-frame-index.ll (+1-1)
  • (modified) llvm/test/CodeGen/ARM/subtarget-align.ll (+1-1)
  • (modified) llvm/test/CodeGen/ARM/unschedule-first-call.ll (+1-1)
  • (modified) llvm/test/CodeGen/ARM/vector-spilling.ll (+1-1)
  • (modified) llvm/test/CodeGen/ARM/vldm-sched-a9.ll (+1-1)
  • (modified) llvm/test/CodeGen/BPF/BTF/binary-format.ll (+1-1)
  • (modified) llvm/test/CodeGen/BPF/BTF/builtin-btf-type-id.ll (+1-1)
  • (modified) llvm/test/CodeGen/BPF/BTF/char-no-debuginfo.ll (+1-1)
  • (modified) llvm/test/CodeGen/BPF/BTF/extern-builtin.ll (+1-1)
  • (modified) llvm/test/CodeGen/BPF/BTF/extern-func-arg.ll (+2-2)
  • (modified) llvm/test/CodeGen/BPF/BTF/extern-global-var.ll (+1-1)
  • (modified) llvm/test/CodeGen/BPF/BTF/extern-var-func-weak-section.ll (+2-2)
  • (modified) llvm/test/CodeGen/BPF/BTF/extern-var-func-weak.ll (+2-2)
  • (modified) llvm/test/CodeGen/BPF/BTF/extern-var-func.ll (+2-2)
  • (modified) llvm/test/CodeGen/BPF/BTF/extern-var-section.ll (+2-2)
  • (modified) llvm/test/CodeGen/BPF/BTF/extern-var-struct-weak.ll (+1-1)
  • (modified) llvm/test/CodeGen/BPF/BTF/extern-var-struct.ll (+1-1)
  • (modified) llvm/test/CodeGen/BPF/BTF/extern-var-weak-section.ll (+2-2)
  • (modified) llvm/test/CodeGen/BPF/BTF/filename.ll (+1-1)
  • (modified) llvm/test/CodeGen/BPF/BTF/func-func-ptr.ll (+1-1)
  • (modified) llvm/test/CodeGen/BPF/BTF/func-non-void.ll (+1-1)
  • (modified) llvm/test/CodeGen/BPF/BTF/func-source.ll (+1-1)
  • (modified) llvm/test/CodeGen/BPF/BTF/func-typedef.ll (+1-1)
  • (modified) llvm/test/CodeGen/BPF/BTF/func-unused-arg.ll (+1-1)
  • (modified) llvm/test/CodeGen/BPF/BTF/func-void.ll (+1-1)
  • (modified) llvm/test/CodeGen/BPF/BTF/local-var-readonly-1.ll (+2-2)
  • (modified) llvm/test/CodeGen/BPF/BTF/local-var-readonly-2.ll (+2-2)
  • (modified) llvm/test/CodeGen/BPF/BTF/local-var.ll (+1-1)
  • (modified) llvm/test/CodeGen/BPF/BTF/pruning-const.ll (+2-2)
  • (modified) llvm/test/CodeGen/BPF/BTF/pruning-typedef.ll (+2-2)
  • (modified) llvm/test/CodeGen/BPF/BTF/static-func.ll (+3-3)
  • (modified) llvm/test/CodeGen/BPF/BTF/static-var-derived-type.ll (+1-1)
  • (modified) llvm/test/CodeGen/BPF/BTF/static-var-inited-sec.ll (+1-1)
  • (modified) llvm/test/CodeGen/BPF/BTF/static-var-inited.ll (+1-1)
  • (modified) llvm/test/CodeGen/BPF/BTF/static-var-readonly-sec.ll (+1-1)
  • (modified) llvm/test/CodeGen/BPF/BTF/static-var-readonly.ll (+1-1)
  • (modified) llvm/test/CodeGen/BPF/BTF/static-var-sec.ll (+1-1)
  • (modified) llvm/test/CodeGen/BPF/BTF/static-var-zerolen-array.ll (+1-1)
  • (modified) llvm/test/CodeGen/BPF/BTF/static-var.ll (+1-1)
  • (modified) llvm/test/CodeGen/BPF/BTF/struct-anon-2.ll (+1-1)
  • (modified) llvm/test/CodeGen/BPF/BTF/weak-global-2.ll (+1-1)
  • (modified) llvm/test/CodeGen/BPF/BTF/weak-global.ll (+1-1)
  • (modified) llvm/test/CodeGen/BPF/CORE/btf-id-duplicate.ll (+1-1)
  • (modified) llvm/test/CodeGen/BPF/CORE/field-reloc-alu32.ll (+1-1)
  • (modified) llvm/test/CodeGen/BPF/CORE/field-reloc-bitfield-1-bpfeb.ll (+1-1)
  • (modified) llvm/test/CodeGen/BPF/CORE/field-reloc-bitfield-1.ll (+1-1)
  • (modified) llvm/test/CodeGen/BPF/CORE/field-reloc-bitfield-2-bpfeb.ll (+1-1)
  • (modified) llvm/test/CodeGen/BPF/CORE/field-reloc-bitfield-2.ll (+1-1)
  • (modified) llvm/test/CodeGen/BPF/CORE/field-reloc-duplicate.ll (+1-1)
  • (modified) llvm/test/CodeGen/BPF/CORE/intrinsic-array-2.ll (+1-1)
  • (modified) llvm/test/CodeGen/BPF/CORE/intrinsic-array.ll (+2-2)
  • (modified) llvm/test/CodeGen/BPF/CORE/intrinsic-fieldinfo-byte-size-1.ll (+1-1)
  • (modified) llvm/test/CodeGen/BPF/CORE/intrinsic-fieldinfo-byte-size-2.ll (+1-1)
  • (modified) llvm/test/CodeGen/BPF/CORE/intrinsic-fieldinfo-byte-size-3.ll (+1-1)
  • (modified) llvm/test/CodeGen/BPF/CORE/intrinsic-fieldinfo-byte-size-4.ll (+1-1)
  • (modified) llvm/test/CodeGen/BPF/CORE/intrinsic-fieldinfo-existence-1.ll (+1-1)
  • (modified) llvm/test/CodeGen/BPF/CORE/intrinsic-fieldinfo-existence-2.ll (+1-1)
  • (modified) llvm/test/CodeGen/BPF/CORE/intrinsic-fieldinfo-existence-3.ll (+1-1)
  • (modified) llvm/test/CodeGen/BPF/CORE/intrinsic-fieldinfo-lshift-1-bpfeb.ll (+1-1)
  • (modified) llvm/test/CodeGen/BPF/CORE/intrinsic-fieldinfo-lshift-1.ll (+1-1)
  • (modified) llvm/test/CodeGen/BPF/CORE/intrinsic-fieldinfo-lshift-2.ll (+1-1)
  • (modified) llvm/test/CodeGen/BPF/CORE/intrinsic-fieldinfo-rshift-1.ll (+1-1)
  • (modified) llvm/test/CodeGen/BPF/CORE/intrinsic-fieldinfo-rshift-2.ll (+1-1)
  • (modified) llvm/test/CodeGen/BPF/CORE/intrinsic-fieldinfo-rshift-3.ll (+1-1)
  • (modified) llvm/test/CodeGen/BPF/CORE/intrinsic-fieldinfo-signedness-1.ll (+1-1)
  • (modified) llvm/test/CodeGen/BPF/CORE/intrinsic-fieldinfo-signedness-2.ll (+1-1)
  • (modified) llvm/test/CodeGen/BPF/CORE/intrinsic-fieldinfo-signedness-3.ll (+1-1)
  • (modified) llvm/test/CodeGen/BPF/CORE/intrinsic-struct.ll (+2-2)
  • (modified) llvm/test/CodeGen/BPF/CORE/intrinsic-typeinfo-enum-value.ll (+1-1)
  • (modified) llvm/test/CodeGen/BPF/CORE/intrinsic-typeinfo-type-exist.ll (+1-1)
  • (modified) llvm/test/CodeGen/BPF/CORE/intrinsic-typeinfo-type-size-1.ll (+1-1)
  • (modified) llvm/test/CodeGen/BPF/CORE/intrinsic-typeinfo-type-size-2.ll (+1-1)
  • (modified) llvm/test/CodeGen/BPF/CORE/intrinsic-union.ll (+2-2)
  • (modified) llvm/test/CodeGen/BPF/CORE/no-elf-ama-symbol.ll (+1-1)
  • (modified) llvm/test/CodeGen/BPF/CORE/no-narrow-load.ll (+2-2)
  • (modified) llvm/test/CodeGen/BPF/CORE/offset-reloc-access-str.ll (+2-2)
  • (modified) llvm/test/CodeGen/BPF/CORE/offset-reloc-basic.ll (+1-1)
  • (modified) llvm/test/CodeGen/BPF/CORE/offset-reloc-cast-array-1.ll (+2-2)
  • (modified) llvm/test/CodeGen/BPF/CORE/offset-reloc-cast-array-2.ll (+2-2)
  • (modified) llvm/test/CodeGen/BPF/CORE/offset-reloc-cast-struct-1.ll (+2-2)
  • (modified) llvm/test/CodeGen/BPF/CORE/offset-reloc-cast-struct-2.ll (+2-2)
  • (modified) llvm/test/CodeGen/BPF/CORE/offset-reloc-cast-struct-3.ll (+2-2)
  • (modified) llvm/test/CodeGen/BPF/CORE/offset-reloc-cast-union-1.ll (+2-2)
  • (modified) llvm/test/CodeGen/BPF/CORE/offset-reloc-cast-union-2.ll (+2-2)
  • (modified) llvm/test/CodeGen/BPF/CORE/offset-reloc-end-load.ll (+1-1)
  • (modified) llvm/test/CodeGen/BPF/CORE/offset-reloc-end-ret.ll (+1-1)
  • (modified) llvm/test/CodeGen/BPF/CORE/offset-reloc-fieldinfo-1.ll (+2-2)
  • (modified) llvm/test/CodeGen/BPF/CORE/offset-reloc-fieldinfo-2-bpfeb.ll (+1-1)
  • (modified) llvm/test/CodeGen/BPF/CORE/offset-reloc-fieldinfo-2.ll (+1-1)
  • (modified) llvm/test/CodeGen/BPF/CORE/offset-reloc-global-1.ll (+2-2)
  • (modified) llvm/test/CodeGen/BPF/CORE/offset-reloc-global-2.ll (+2-2)
  • (modified) llvm/test/CodeGen/BPF/CORE/offset-reloc-global-3.ll (+2-2)
  • (modified) llvm/test/CodeGen/BPF/CORE/offset-reloc-ignore.ll (+2-2)
  • (modified) llvm/test/CodeGen/BPF/CORE/offset-reloc-middle-chain.ll (+2-2)
  • (modified) llvm/test/CodeGen/BPF/CORE/offset-reloc-multi-array-1.ll (+2-2)
  • (modified) llvm/test/CodeGen/BPF/CORE/offset-reloc-multi-array-2.ll (+2-2)
  • (modified) llvm/test/CodeGen/BPF/CORE/offset-reloc-multilevel.ll (+1-1)
  • (modified) llvm/test/CodeGen/BPF/CORE/offset-reloc-pointer-1.ll (+2-2)
  • (modified) llvm/test/CodeGen/BPF/CORE/offset-reloc-pointer-2.ll (+2-2)
  • (modified) llvm/test/CodeGen/BPF/CORE/offset-reloc-struct-anonymous.ll (+1-1)
  • (modified) llvm/test/CodeGen/BPF/CORE/offset-reloc-struct-array.ll (+1-1)
  • (modified) llvm/test/CodeGen/BPF/CORE/offset-reloc-typedef-array.ll (+2-2)
  • (modified) llvm/test/CodeGen/BPF/CORE/offset-reloc-typedef-struct-2.ll (+1-1)
  • (modified) llvm/test/CodeGen/BPF/CORE/offset-reloc-typedef-struct.ll (+2-2)
  • (modified) llvm/test/CodeGen/BPF/CORE/offset-reloc-typedef-union-2.ll (+1-1)
  • (modified) llvm/test/CodeGen/BPF/CORE/offset-reloc-typedef-union.ll (+2-2)
  • (modified) llvm/test/CodeGen/BPF/CORE/offset-reloc-typedef.ll (+2-2)
  • (modified) llvm/test/CodeGen/BPF/CORE/offset-reloc-union.ll (+1-1)
  • (modified) llvm/test/CodeGen/BPF/CORE/store-addr.ll (+2-2)
  • (modified) llvm/test/CodeGen/BPF/adjust-opt-icmp1.ll (+2-2)
  • (modified) llvm/test/CodeGen/BPF/adjust-opt-icmp2.ll (+2-2)
  • (modified) llvm/test/CodeGen/BPF/adjust-opt-speculative1.ll (+2-2)
  • (modified) llvm/test/CodeGen/BPF/adjust-opt-speculative2.ll (+2-2)
  • (modified) llvm/test/CodeGen/BPF/callx.ll (+1-1)
  • (modified) llvm/test/CodeGen/BPF/dwarfdump.ll (+1-1)
  • (modified) llvm/test/CodeGen/BPF/i128.ll (+2-2)
  • (modified) llvm/test/CodeGen/BPF/is_trunc_free.ll (+2-2)
  • (modified) llvm/test/CodeGen/BPF/is_zext_free.ll (+1-1)
  • (modified) llvm/test/CodeGen/BPF/objdump_two_funcs.ll (+1-1)
  • (modified) llvm/test/CodeGen/BPF/optnone-1.ll (+1-1)
  • (modified) llvm/test/CodeGen/BPF/reloc-btf-2.ll (+1-1)
  • (modified) llvm/test/CodeGen/BPF/reloc-btf.ll (+1-1)
  • (modified) llvm/test/CodeGen/BPF/simplifycfg.ll (+2-2)
  • (modified) llvm/test/CodeGen/BPF/warn-stack.ll (+2-2)
  • (modified) llvm/test/CodeGen/BPF/xadd.ll (+1-1)
  • (modified) llvm/test/CodeGen/Generic/cfi-sections.ll (+2-2)
  • (modified) llvm/test/CodeGen/Hexagon/NVJumpCmp.ll (+1-1)
  • (modified) llvm/test/CodeGen/Hexagon/addh-sext-trunc.ll (+1-1)
  • (modified) llvm/test/CodeGen/Hexagon/alu64.ll (+1-1)
  • (modified) llvm/test/CodeGen/Hexagon/autohvx/fsplat.ll (+1-1)
  • (modified) llvm/test/CodeGen/Hexagon/autohvx/hfinsert.ll (+1-1)
  • (modified) llvm/test/CodeGen/Hexagon/autohvx/hfnosplat_cp.ll (+1-1)
  • (modified) llvm/test/CodeGen/Hexagon/autohvx/hfsplat.ll (+1-1)
  • (modified) llvm/test/CodeGen/Hexagon/base-offset-addr.ll (+1-1)
  • (modified) llvm/test/CodeGen/Hexagon/base-offset-post.ll (+1-1)
  • (modified) llvm/test/CodeGen/Hexagon/bit-loop-rc-mismatch.ll (+2-2)
  • (modified) llvm/test/CodeGen/Hexagon/bit-rie.ll (+1-1)
  • (modified) llvm/test/CodeGen/Hexagon/builtin-prefetch.ll (+1-1)
  • (modified) llvm/test/CodeGen/Hexagon/cfi-offset.ll (+1-1)
  • (modified) llvm/test/CodeGen/Hexagon/cmp-extend.ll (+1-1)
  • (modified) llvm/test/CodeGen/Hexagon/cmp.ll (+1-1)
  • (modified) llvm/test/CodeGen/Hexagon/constp-combine-neg.ll (+1-1)
  • (modified) llvm/test/CodeGen/Hexagon/constp-extract.ll (+1-1)
  • (modified) llvm/test/CodeGen/Hexagon/constp-physreg.ll (+1-1)
  • (modified) llvm/test/CodeGen/Hexagon/dead-store-stack.ll (+2-2)
  • (modified) llvm/test/CodeGen/Hexagon/early-if-conversion-bug1.ll (+2-2)
  • (modified) llvm/test/CodeGen/Hexagon/fminmax.ll (+1-1)
  • (modified) llvm/test/CodeGen/Hexagon/hexagon_vector_loop_carried_reuse.ll (+1-1)
  • (modified) llvm/test/CodeGen/Hexagon/hexagon_vector_loop_carried_reuse_constant.ll (+1-1)
  • (modified) llvm/test/CodeGen/Hexagon/hwloop-crit-edge.ll (+1-1)
  • (modified) llvm/test/CodeGen/Hexagon/hwloop-preheader.ll (+1-1)
  • (modified) llvm/test/CodeGen/Hexagon/intrinsics-v67.ll (+1-1)
  • (modified) llvm/test/CodeGen/Hexagon/jt-in-text.ll (+1-1)
  • (modified) llvm/test/CodeGen/Hexagon/ldst_vector_offset.ll (+1-1)
  • (modified) llvm/test/CodeGen/Hexagon/loopIdiom.ll (+1-1)
  • (modified) llvm/test/CodeGen/Hexagon/loop_align_count.ll (+1-1)
  • (modified) llvm/test/CodeGen/Hexagon/mem-fi-add.ll (+2-2)
  • (modified) llvm/test/CodeGen/Hexagon/memops-stack.ll (+2-2)
  • (modified) llvm/test/CodeGen/Hexagon/pic-regusage.ll (+1-1)
  • (modified) llvm/test/CodeGen/Hexagon/postinc-offset.ll (+1-1)
  • (modified) llvm/test/CodeGen/Hexagon/rdf-dead-loop.ll (+1-1)
  • (modified) llvm/test/CodeGen/Hexagon/rdf-inline-asm-fixed.ll (+1-1)
  • (modified) llvm/test/CodeGen/Hexagon/rdf-inline-asm.ll (+1-1)
  • (modified) llvm/test/CodeGen/Hexagon/reg-scavengebug-3.ll (+2-2)
  • (modified) llvm/test/CodeGen/Hexagon/runtime-stkchk.ll (+2-2)
  • (modified) llvm/test/CodeGen/Hexagon/sdr-shr32.ll (+1-1)
  • (modified) llvm/test/CodeGen/Hexagon/switch-lut-explicit-section.ll (+1-1)
  • (modified) llvm/test/CodeGen/Hexagon/switch-lut-function-section.ll (+1-1)
  • (modified) llvm/test/CodeGen/Hexagon/switch-lut-multiple-functions.ll (+1-1)
  • (modified) llvm/test/CodeGen/Hexagon/switch-lut-text-section.ll (+1-1)
  • (modified) llvm/test/CodeGen/Hexagon/swp-epilog-phi10.ll (+1-1)
  • (modified) llvm/test/CodeGen/Hexagon/swp-phi.ll (+1-1)
  • (modified) llvm/test/CodeGen/Hexagon/swp-pragma-disable-bug.ll (+1-1)
  • (modified) llvm/test/CodeGen/Hexagon/swp-prolog-phi4.ll (+1-1)
  • (modified) llvm/test/CodeGen/Hexagon/swp-stages4.ll (+1-1)
  • (modified) llvm/test/CodeGen/Hexagon/usr-ovf-dep.ll (+1-1)
  • (modified) llvm/test/CodeGen/Hexagon/v6-haar-balign32.ll (+1-1)
  • (modified) llvm/test/CodeGen/Hexagon/v60Intrins.ll (+1-1)
  • (modified) llvm/test/CodeGen/Hexagon/v60small.ll (+1-1)
  • (modified) llvm/test/CodeGen/Hexagon/v6vec-vprint.ll (+1-1)
  • (modified) llvm/test/CodeGen/Hexagon/vec-pred-spill1.ll (+2-2)
  • (modified) llvm/test/CodeGen/Hexagon/vect-regpairs.ll (+1-1)
diff --git a/clang/lib/CodeGen/BackendUtil.cpp b/clang/lib/CodeGen/BackendUtil.cpp
index 602068436101b..ecfbcb5970092 100644
--- a/clang/lib/CodeGen/BackendUtil.cpp
+++ b/clang/lib/CodeGen/BackendUtil.cpp
@@ -430,12 +430,6 @@ static bool initTargetOptions(const CompilerInstance &CI,
   Options.NoInfsFPMath = LangOpts.NoHonorInfs;
   Options.NoNaNsFPMath = LangOpts.NoHonorNaNs;
   Options.NoZerosInBSS = CodeGenOpts.NoZeroInitializedInBSS;
-  Options.UnsafeFPMath = LangOpts.AllowFPReassoc && LangOpts.AllowRecip &&
-                         LangOpts.NoSignedZero && LangOpts.ApproxFunc &&
-                         (LangOpts.getDefaultFPContractMode() ==
-                              LangOptions::FPModeKind::FPM_Fast ||
-                          LangOpts.getDefaultFPContractMode() ==
-                              LangOptions::FPModeKind::FPM_FastHonorPragmas);
 
   Options.BBAddrMap = CodeGenOpts.BBAddrMap;
   Options.BBSections =
diff --git a/lld/test/COFF/Inputs/undefined-symbol-lto-a.ll b/lld/test/COFF/Inputs/undefined-symbol-lto-a.ll
index 7e29044ebe00d..f57a3e3c1ede4 100644
--- a/lld/test/COFF/Inputs/undefined-symbol-lto-a.ll
+++ b/lld/test/COFF/Inputs/undefined-symbol-lto-a.ll
@@ -47,8 +47,8 @@ entry:
   ret void
 }
 
-attributes #0 = { "correctly-rounded-divide-sqrt-fp-math"="false" "disable-tail-calls"="false" "less-precise-fpmad"="false" "frame-pointer"="none" "no-infs-fp-math"="false" "no-nans-fp-math"="false" "no-signed-zeros-fp-math"="false" "no-trapping-math"="false" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "unsafe-fp-math"="false" "use-soft-float"="false" }
-attributes #1 = { nounwind sspstrong uwtable "correctly-rounded-divide-sqrt-fp-math"="false" "disable-tail-calls"="false" "less-precise-fpmad"="false" "min-legal-vector-width"="0" "frame-pointer"="none" "no-infs-fp-math"="false" "no-jump-tables"="false" "no-nans-fp-math"="false" "no-signed-zeros-fp-math"="false" "no-trapping-math"="false" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "unsafe-fp-math"="false" "use-soft-float"="false" }
+attributes #0 = { "correctly-rounded-divide-sqrt-fp-math"="false" "disable-tail-calls"="false" "less-precise-fpmad"="false" "frame-pointer"="none" "no-infs-fp-math"="false" "no-nans-fp-math"="false" "no-signed-zeros-fp-math"="false" "no-trapping-math"="false" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "use-soft-float"="false" }
+attributes #1 = { nounwind sspstrong uwtable "correctly-rounded-divide-sqrt-fp-math"="false" "disable-tail-calls"="false" "less-precise-fpmad"="false" "min-legal-vector-width"="0" "frame-pointer"="none" "no-infs-fp-math"="false" "no-jump-tables"="false" "no-nans-fp-math"="false" "no-signed-zeros-fp-math"="false" "no-trapping-math"="false" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "use-soft-float"="false" }
 attributes #2 = { nounwind }
 
 !llvm.linker.options = !{!1, !2}
diff --git a/lld/test/COFF/Inputs/undefined-symbol-lto-b.ll b/lld/test/COFF/Inputs/undefined-symbol-lto-b.ll
index 0f64e236a1f47..7347fde7a9dee 100644
--- a/lld/test/COFF/Inputs/undefined-symbol-lto-b.ll
+++ b/lld/test/COFF/Inputs/undefined-symbol-lto-b.ll
@@ -11,7 +11,7 @@ entry:
   ret void
 }
 
-attributes #0 = { norecurse nounwind readnone sspstrong uwtable "correctly-rounded-divide-sqrt-fp-math"="false" "disable-tail-calls"="false" "less-precise-fpmad"="false" "min-legal-vector-width"="0" "frame-pointer"="none" "no-infs-fp-math"="false" "no-jump-tables"="false" "no-nans-fp-math"="false" "no-signed-zeros-fp-math"="false" "no-trapping-math"="false" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "unsafe-fp-math"="false" "use-soft-float"="false" }
+attributes #0 = { norecurse nounwind readnone sspstrong uwtable "correctly-rounded-divide-sqrt-fp-math"="false" "disable-tail-calls"="false" "less-precise-fpmad"="false" "min-legal-vector-width"="0" "frame-pointer"="none" "no-infs-fp-math"="false" "no-jump-tables"="false" "no-nans-fp-math"="false" "no-signed-zeros-fp-math"="false" "no-trapping-math"="false" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "use-soft-float"="false" }
 
 !llvm.linker.options = !{!0, !1}
 !llvm.module.flags = !{!2, !3, !4, !5}
diff --git a/lld/test/COFF/Inputs/undefined-symbol-multi-lto.ll b/lld/test/COFF/Inputs/undefined-symbol-multi-lto.ll
index 5f6730272e610..61828cae7ea58 100644
--- a/lld/test/COFF/Inputs/undefined-symbol-multi-lto.ll
+++ b/lld/test/COFF/Inputs/undefined-symbol-multi-lto.ll
@@ -13,8 +13,8 @@ declare dso_local i32 @"?foo@@YAHXZ"() #1
 
 declare dso_local i32 @"?bar@@YAHXZ"() #1
 
-attributes #0 = { noinline optnone uwtable "correctly-rounded-divide-sqrt-fp-math"="false" "disable-tail-calls"="false" "frame-pointer"="all" "less-precise-fpmad"="false" "min-legal-vector-width"="0" "no-infs-fp-math"="false" "no-jump-tables"="false" "no-nans-fp-math"="false" "no-signed-zeros-fp-math"="false" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "unsafe-fp-math"="false" "use-soft-float"="false" }
-attributes #1 = { "correctly-rounded-divide-sqrt-fp-math"="false" "disable-tail-calls"="false" "frame-pointer"="all" "less-precise-fpmad"="false" "no-infs-fp-math"="false" "no-nans-fp-math"="false" "no-signed-zeros-fp-math"="false" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "unsafe-fp-math"="false" "use-soft-float"="false" }
+attributes #0 = { noinline optnone uwtable "correctly-rounded-divide-sqrt-fp-math"="false" "disable-tail-calls"="false" "frame-pointer"="all" "less-precise-fpmad"="false" "min-legal-vector-width"="0" "no-infs-fp-math"="false" "no-jump-tables"="false" "no-nans-fp-math"="false" "no-signed-zeros-fp-math"="false" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "use-soft-float"="false" }
+attributes #1 = { "correctly-rounded-divide-sqrt-fp-math"="false" "disable-tail-calls"="false" "frame-pointer"="all" "less-precise-fpmad"="false" "no-infs-fp-math"="false" "no-nans-fp-math"="false" "no-signed-zeros-fp-math"="false" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "use-soft-float"="false" }
 
 !llvm.module.flags = !{!0}
 !llvm.ident = !{!1}
diff --git a/lld/test/MachO/lto-mattrs.ll b/lld/test/MachO/lto-mattrs.ll
index f658b485a1792..41313296dc269 100644
--- a/lld/test/MachO/lto-mattrs.ll
+++ b/lld/test/MachO/lto-mattrs.ll
@@ -33,4 +33,4 @@ define float @foo(float %x) #0 {
   ret float %div
 }
 
-attributes #0 = { "unsafe-fp-math"="true" "reciprocal-estimates"="divf,vec-divf" }
+attributes #0 = { "reciprocal-estimates"="divf,vec-divf" }
diff --git a/lld/test/wasm/Inputs/debuginfo1.ll b/lld/test/wasm/Inputs/debuginfo1.ll
index d6db88002ce1e..0a1c42a214f2c 100644
--- a/lld/test/wasm/Inputs/debuginfo1.ll
+++ b/lld/test/wasm/Inputs/debuginfo1.ll
@@ -35,9 +35,9 @@ declare void @foo(i32) local_unnamed_addr #2
 ; Function Attrs: nounwind readnone speculatable
 declare void @llvm.dbg.value(metadata, metadata, metadata) #3
 
-attributes #0 = { nounwind readnone "correctly-rounded-divide-sqrt-fp-math"="false" "disable-tail-calls"="false" "less-precise-fpmad"="false" "frame-pointer"="none" "no-infs-fp-math"="false" "no-jump-tables"="false" "no-nans-fp-math"="false" "no-signed-zeros-fp-math"="false" "no-trapping-math"="false" "stack-protector-buffer-size"="8" "target-cpu"="generic" "unsafe-fp-math"="false" "use-soft-float"="false" }
-attributes #1 = { nounwind "correctly-rounded-divide-sqrt-fp-math"="false" "disable-tail-calls"="false" "less-precise-fpmad"="false" "frame-pointer"="none" "no-infs-fp-math"="false" "no-jump-tables"="false" "no-nans-fp-math"="false" "no-signed-zeros-fp-math"="false" "no-trapping-math"="false" "stack-protector-buffer-size"="8" "target-cpu"="generic" "unsafe-fp-math"="false" "use-soft-float"="false" }
-attributes #2 = { "correctly-rounded-divide-sqrt-fp-math"="false" "disable-tail-calls"="false" "less-precise-fpmad"="false" "frame-pointer"="none" "no-infs-fp-math"="false" "no-nans-fp-math"="false" "no-signed-zeros-fp-math"="false" "no-trapping-math"="false" "stack-protector-buffer-size"="8" "target-cpu"="generic" "unsafe-fp-math"="false" "use-soft-float"="false" }
+attributes #0 = { nounwind readnone "correctly-rounded-divide-sqrt-fp-math"="false" "disable-tail-calls"="false" "less-precise-fpmad"="false" "frame-pointer"="none" "no-infs-fp-math"="false" "no-jump-tables"="false" "no-nans-fp-math"="false" "no-signed-zeros-fp-math"="false" "no-trapping-math"="false" "stack-protector-buffer-size"="8" "target-cpu"="generic" "use-soft-float"="false" }
+attributes #1 = { nounwind "correctly-rounded-divide-sqrt-fp-math"="false" "disable-tail-calls"="false" "less-precise-fpmad"="false" "frame-pointer"="none" "no-infs-fp-math"="false" "no-jump-tables"="false" "no-nans-fp-math"="false" "no-signed-zeros-fp-math"="false" "no-trapping-math"="false" "stack-protector-buffer-size"="8" "target-cpu"="generic" "use-soft-float"="false" }
+attributes #2 = { "correctly-rounded-divide-sqrt-fp-math"="false" "disable-tail-calls"="false" "less-precise-fpmad"="false" "frame-pointer"="none" "no-infs-fp-math"="false" "no-nans-fp-math"="false" "no-signed-zeros-fp-math"="false" "no-trapping-math"="false" "stack-protector-buffer-size"="8" "target-cpu"="generic" "use-soft-float"="false" }
 attributes #3 = { nounwind readnone speculatable }
 attributes #4 = { nounwind }
 
diff --git a/lld/test/wasm/Inputs/debuginfo2.ll b/lld/test/wasm/Inputs/debuginfo2.ll
index 1b63dd57474e5..c832be521e325 100644
--- a/lld/test/wasm/Inputs/debuginfo2.ll
+++ b/lld/test/wasm/Inputs/debuginfo2.ll
@@ -31,7 +31,7 @@ entry:
 ; Function Attrs: nounwind readnone speculatable
 declare void @llvm.dbg.value(metadata, metadata, metadata) #1
 
-attributes #0 = { nounwind "correctly-rounded-divide-sqrt-fp-math"="false" "disable-tail-calls"="false" "less-precise-fpmad"="false" "frame-pointer"="none" "no-infs-fp-math"="false" "no-jump-tables"="false" "no-nans-fp-math"="false" "no-signed-zeros-fp-math"="false" "no-trapping-math"="false" "stack-protector-buffer-size"="8" "target-cpu"="generic" "unsafe-fp-math"="false" "use-soft-float"="false" }
+attributes #0 = { nounwind "correctly-rounded-divide-sqrt-fp-math"="false" "disable-tail-calls"="false" "less-precise-fpmad"="false" "frame-pointer"="none" "no-infs-fp-math"="false" "no-jump-tables"="false" "no-nans-fp-math"="false" "no-signed-zeros-fp-math"="false" "no-trapping-math"="false" "stack-protector-buffer-size"="8" "target-cpu"="generic" "use-soft-float"="false" }
 attributes #1 = { nounwind readnone speculatable }
 
 !llvm.dbg.cu = !{!2}
diff --git a/lld/test/wasm/debug-removed-fn.ll b/lld/test/wasm/debug-removed-fn.ll
index 8dae48a136dc4..20c30346cc0e7 100644
--- a/lld/test/wasm/debug-removed-fn.ll
+++ b/lld/test/wasm/debug-removed-fn.ll
@@ -28,7 +28,7 @@ entry:
   ret i32 6, !dbg !13
 }
 
-attributes #0 = { noinline nounwind optnone "correctly-rounded-divide-sqrt-fp-math"="false" "disable-tail-calls"="false" "less-precise-fpmad"="false" "frame-pointer"="none" "no-infs-fp-math"="false" "no-jump-tables"="false" "no-nans-fp-math"="false" "no-signed-zeros-fp-math"="false" "no-trapping-math"="false" "stack-protector-buffer-size"="8" "target-cpu"="generic" "unsafe-fp-math"="false" "use-soft-float"="false" }
+attributes #0 = { noinline nounwind optnone "correctly-rounded-divide-sqrt-fp-math"="false" "disable-tail-calls"="false" "less-precise-fpmad"="false" "frame-pointer"="none" "no-infs-fp-math"="false" "no-jump-tables"="false" "no-nans-fp-math"="false" "no-signed-zeros-fp-math"="false" "no-trapping-math"="false" "stack-protector-buffer-size"="8" "target-cpu"="generic" "use-soft-float"="false" }
 
 !llvm.dbg.cu = !{!0}
 !llvm.module.flags = !{!3, !4, !5}
diff --git a/llvm/docs/CommandGuide/llc.rst b/llvm/docs/CommandGuide/llc.rst
index 900649f59c401..cc670f6043656 100644
--- a/llvm/docs/CommandGuide/llc.rst
+++ b/llvm/docs/CommandGuide/llc.rst
@@ -125,13 +125,6 @@ End-user Options
 
  Enable setting the FP exceptions build attribute not to use exceptions.
 
-.. option:: --enable-unsafe-fp-math
-
- Enable optimizations that make unsafe assumptions about IEEE math (e.g. that
- addition is associative) or may not work for all input ranges.  These
- optimizations allow the code generator to make use of some instructions which
- would otherwise not be usable (such as ``fsin`` on X86).
-
 .. option:: --stats
 
  Print statistics recorded by code-generation passes.
diff --git a/llvm/docs/CommandGuide/lli.rst b/llvm/docs/CommandGuide/lli.rst
index 94c001380441f..8afe10db05d48 100644
--- a/llvm/docs/CommandGuide/lli.rst
+++ b/llvm/docs/CommandGuide/lli.rst
@@ -107,11 +107,6 @@ FLOATING POINT OPTIONS
 
  Enable optimizations that assume no NAN values.
 
-.. option:: -enable-unsafe-fp-math
-
- Causes :program:`lli` to enable optimizations that may decrease floating point
- precision.
-
 .. option:: -soft-float
 
  Causes :program:`lli` to generate software floating point library calls instead of
diff --git a/llvm/docs/SourceLevelDebugging.rst b/llvm/docs/SourceLevelDebugging.rst
index f057b2d2d2e36..12b5e3e549df7 100644
--- a/llvm/docs/SourceLevelDebugging.rst
+++ b/llvm/docs/SourceLevelDebugging.rst
@@ -674,7 +674,7 @@ Compiled to LLVM, this function would be represented like this:
     ret void, !dbg !24
   }
 
-  attributes #0 = { nounwind ssp uwtable "less-precise-fpmad"="false" "frame-pointer"="all" "no-infs-fp-math"="false" "no-nans-fp-math"="false" "stack-protector-buffer-size"="8" "unsafe-fp-math"="false" "use-soft-float"="false" }
+  attributes #0 = { nounwind ssp uwtable "less-precise-fpmad"="false" "frame-pointer"="all" "no-infs-fp-math"="false" "no-nans-fp-math"="false" "stack-protector-buffer-size"="8" "use-soft-float"="false" }
   attributes #1 = { nounwind readnone }
 
   !llvm.dbg.cu = !{!0}
diff --git a/llvm/include/llvm/CodeGen/CommandFlags.h b/llvm/include/llvm/CodeGen/CommandFlags.h
index 39c5a8d479a5f..af66f2d5776ba 100644
--- a/llvm/include/llvm/CodeGen/CommandFlags.h
+++ b/llvm/include/llvm/CodeGen/CommandFlags.h
@@ -58,8 +58,6 @@ LLVM_ABI CodeGenFileType getFileType();
 
 LLVM_ABI FramePointerKind getFramePointerUsage();
 
-LLVM_ABI bool getEnableUnsafeFPMath();
-
 LLVM_ABI bool getEnableNoInfsFPMath();
 
 LLVM_ABI bool getEnableNoNaNsFPMath();
diff --git a/llvm/include/llvm/IR/Attributes.td b/llvm/include/llvm/IR/Attributes.td
index 8e7d9dcebfe2a..8ce2b1bea8fac 100644
--- a/llvm/include/llvm/IR/Attributes.td
+++ b/llvm/include/llvm/IR/Attributes.td
@@ -410,7 +410,6 @@ def LessPreciseFPMAD : StrBoolAttr<"less-precise-fpmad">;
 def NoInfsFPMath : StrBoolAttr<"no-infs-fp-math">;
 def NoNansFPMath : StrBoolAttr<"no-nans-fp-math">;
 def NoSignedZerosFPMath : StrBoolAttr<"no-signed-zeros-fp-math">;
-def UnsafeFPMath : StrBoolAttr<"unsafe-fp-math">;
 def NoJumpTables : StrBoolAttr<"no-jump-tables">;
 def NoInlineLineTables : StrBoolAttr<"no-inline-line-tables">;
 def ProfileSampleAccurate : StrBoolAttr<"profile-sample-accurate">;
@@ -474,7 +473,6 @@ def : MergeRule<"setAND<LessPreciseFPMADAttr>">;
 def : MergeRule<"setAND<NoInfsFPMathAttr>">;
 def : MergeRule<"setAND<NoNansFPMathAttr>">;
 def : MergeRule<"setAND<NoSignedZerosFPMathAttr>">;
-def : MergeRule<"setAND<UnsafeFPMathAttr>">;
 def : MergeRule<"setOR<NoImplicitFloatAttr>">;
 def : MergeRule<"setOR<NoJumpTablesAttr>">;
 def : MergeRule<"setOR<ProfileSampleAccurateAttr>">;
diff --git a/llvm/include/llvm/Target/TargetOptions.h b/llvm/include/llvm/Target/TargetOptions.h
index 2c2122a7b204f..bfd2817b8d1f5 100644
--- a/llvm/include/llvm/Target/TargetOptions.h
+++ b/llvm/include/llvm/Target/TargetOptions.h
@@ -118,9 +118,8 @@ enum CodeObjectVersionKind {
 class TargetOptions {
 public:
   TargetOptions()
-      : UnsafeFPMath(false), NoInfsFPMath(false), NoNaNsFPMath(false),
-        NoTrappingFPMath(true), NoSignedZerosFPMath(false),
-        EnableAIXExtendedAltivecABI(false),
+      : NoInfsFPMath(false), NoNaNsFPMath(false), NoTrappingFPMath(true),
+        NoSignedZerosFPMath(false), EnableAIXExtendedAltivecABI(false),
         HonorSignDependentRoundingFPMathOption(false), NoZerosInBSS(false),
         GuaranteedTailCallOpt(false), StackSymbolOrdering(true),
         EnableFastISel(false), EnableGlobalISel(false), UseInitArray(false),
@@ -156,13 +155,6 @@ class TargetOptions {
   /// MCAsmInfo::BinutilsVersion.
   std::pair<int, int> BinutilsVersion{0, 0};
 
-  /// UnsafeFPMath - This flag is enabled when the
-  /// -enable-unsafe-fp-math flag is specified on the command line.  When
-  /// this flag is off (the default), the code generator is not allowed to
-  /// produce results that are "less precise" than IEEE allows.  This includes
-  /// use of X86 instructions like FSIN and FCOS instead of libcalls.
-  unsigned UnsafeFPMath : 1;
-
   /// NoInfsFPMath - This flag is enabled when the
   /// -enable-no-infs-fp-math flag is specified on the command line. When
   /// this flag is off (the default), the code generator is not allowed to
diff --git a/llvm/lib/CodeGen/CommandFlags.cpp b/llvm/lib/CodeGen/CommandFlags.cpp
index 0522698adf183..c1365f499dcf5 100644
--- a/llvm/lib/CodeGen/CommandFlags.cpp
+++ b/llvm/lib/CodeGen/CommandFlags.cpp
@@ -64,7 +64,6 @@ CGOPT_EXP(uint64_t, LargeDataThreshold)
 CGOPT(ExceptionHandling, ExceptionModel)
 CGOPT_EXP(CodeGenFileType, FileType)
 CGOPT(FramePointerKind, FramePointerUsage)
-CGOPT(bool, EnableUnsafeFPMath)
 CGOPT(bool, EnableNoInfsFPMath)
 CGOPT(bool, EnableNoNaNsFPMath)
 CGOPT(bool, EnableNoSignedZerosFPMath)
@@ -219,12 +218,6 @@ codegen::RegisterCodeGenFlags::RegisterCodeGenFlags() {
                      "Enable frame pointer elimination")));
   CGBINDOPT(FramePointerUsage);
 
-  static cl::opt<bool> EnableUnsafeFPMath(
-      "enable-unsafe-fp-math",
-      cl::desc("Enable optimizations that may decrease FP precision"),
-      cl::init(false));
-  CGBINDOPT(EnableUnsafeFPMath);
-
   static cl::opt<bool> EnableNoInfsFPMath(
       "enable-no-infs-fp-math",
       cl::desc("Enable FP math optimizations that assume no +-Infs"),
@@ -552,7 +545,6 @@ TargetOptions
 codegen::InitTargetOptionsFromCodeGenFlags(const Triple &TheTriple) {
   TargetOptions Options;
   Options.AllowFPOpFusion = getFuseFPOps();
-  Options.UnsafeFPMath = getEnableUnsafeFPMath();
   Options.NoInfsFPMath = getEnableNoInfsFPMath();
   Options.NoNaNsFPMath = getEnableNoNaNsFPMath();
   Options.NoSignedZerosFPMath = getEnableNoSignedZerosFPMath();
@@ -706,7 +698,6 @@ void codegen::setFunctionAttributes(StringRef CPU, StringRef Features,
   if (getStackRealign())
     NewAttrs.addAttribute("stackrealign");
 
-  HANDLE_BOOL_ATTR(EnableUnsafeFPMathView, "unsafe-fp-math");
   HANDLE_BOOL_ATTR(EnableNoInfsFPMathView, "no-infs-fp-math");
   HANDLE_BOOL_ATTR(EnableNoNaNsFPMathView, "no-nans-fp-math");
   HANDLE_BOOL_ATTR(EnableNoSignedZerosFPMathView, "no-signed-zeros-fp-math");
diff --git a/llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp b/llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp
index 310d35d9b1d1e..d05a6506f9677 100644
--- a/llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp
+++ b/llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp
@@ -17462,9 +17462,9 @@ SDValue DAGCombiner::visitFSUBForFMACombine(SDNode *N) {
   // fold (fsub (fpext (fneg (fmul, x, y))), z)
   //   -> (fneg (fma (fpext x), (fpext y), z))
   // Note: This could be removed with appropriate canonicalization of the
-  // input expression into (fneg (fadd (fpext (fmul, x, y)), z). However, the
-  // orthogonal flags -fp-contract=fast and -enable-unsafe-fp-math prevent
-  // from implementing the canonicalization in visitFSUB.
+  // input expression into (fneg (fadd (fpext (fmul, x, y)), z). However,
+  // -fp-contract=fast prevent from implementing the canonicalization
+  // in visitFSUB.
   if (matcher.match(N0, ISD::FP_EXTEND)) {
     SDValue N00 = N0.getOperand(0);
     if (matcher.match(N00, ISD::FNEG)) {
@@ -17486,9 +17486,9 @@ SDValue DAGCombiner::visitFSUBForFMACombine(SDNode *N) {
   // fold (fsub (fneg (fpext (f...
[truncated]

@llvmbot
Copy link
Member

llvmbot commented Oct 21, 2025

@llvm/pr-subscribers-backend-powerpc

Author: None (paperchalice)

Changes

These global flags block furthur improvements for clang, users should always use fast-math flags
see also https://discourse.llvm.org/t/rfc-honor-pragmas-with-ffp-contract-fast/80797


Patch is 1.41 MiB, truncated to 20.00 KiB below, full version: https://github.com/llvm/llvm-project/pull/164400.diff

1005 Files Affected:

  • (modified) clang/lib/CodeGen/BackendUtil.cpp (-6)
  • (modified) lld/test/COFF/Inputs/undefined-symbol-lto-a.ll (+2-2)
  • (modified) lld/test/COFF/Inputs/undefined-symbol-lto-b.ll (+1-1)
  • (modified) lld/test/COFF/Inputs/undefined-symbol-multi-lto.ll (+2-2)
  • (modified) lld/test/MachO/lto-mattrs.ll (+1-1)
  • (modified) lld/test/wasm/Inputs/debuginfo1.ll (+3-3)
  • (modified) lld/test/wasm/Inputs/debuginfo2.ll (+1-1)
  • (modified) lld/test/wasm/debug-removed-fn.ll (+1-1)
  • (modified) llvm/docs/CommandGuide/llc.rst (-7)
  • (modified) llvm/docs/CommandGuide/lli.rst (-5)
  • (modified) llvm/docs/SourceLevelDebugging.rst (+1-1)
  • (modified) llvm/include/llvm/CodeGen/CommandFlags.h (-2)
  • (modified) llvm/include/llvm/IR/Attributes.td (-2)
  • (modified) llvm/include/llvm/Target/TargetOptions.h (+2-10)
  • (modified) llvm/lib/CodeGen/CommandFlags.cpp (-9)
  • (modified) llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp (+6-6)
  • (modified) llvm/lib/CodeGen/TargetOptionsImpl.cpp (+1-1)
  • (modified) llvm/lib/Target/TargetMachine.cpp (-1)
  • (modified) llvm/lib/Transforms/Instrumentation/NumericalStabilitySanitizer.cpp (-1)
  • (modified) llvm/test/Analysis/BranchProbabilityInfo/pr22718.ll (+3-3)
  • (modified) llvm/test/Analysis/CostModel/SystemZ/intrinsic-cost-crash.ll (+1-1)
  • (modified) llvm/test/Analysis/Delinearization/constant_functions_multi_dim.ll (+2-2)
  • (modified) llvm/test/Analysis/DependenceAnalysis/MIVCheckConst.ll (+1-1)
  • (modified) llvm/test/Analysis/DependenceAnalysis/NonCanonicalizedSubscript.ll (+1-1)
  • (modified) llvm/test/Analysis/MemoryDependenceAnalysis/invariant.group-bug.ll (+2-2)
  • (modified) llvm/test/Analysis/MemorySSA/pr28880.ll (+1-1)
  • (modified) llvm/test/Analysis/MemorySSA/pr39197.ll (+1-1)
  • (modified) llvm/test/Analysis/MemorySSA/pr40038.ll (+1-1)
  • (modified) llvm/test/Analysis/MemorySSA/pr43569.ll (+1-1)
  • (modified) llvm/test/Analysis/ScalarEvolution/pr22674.ll (+1-1)
  • (modified) llvm/test/Analysis/ScalarEvolution/scev-canonical-mode.ll (+1-1)
  • (modified) llvm/test/Analysis/TypeBasedAliasAnalysis/PR17620.ll (+2-2)
  • (modified) llvm/test/Analysis/TypeBasedAliasAnalysis/tbaa-path.ll (+1-1)
  • (modified) llvm/test/Bitcode/DILocation-implicit-code.ll (+2-2)
  • (modified) llvm/test/Bitcode/drop-debug-info.3.5.ll (+1-1)
  • (modified) llvm/test/Bitcode/upgrade-tbaa.ll (+1-1)
  • (modified) llvm/test/CodeGen/AArch64/GlobalISel/inline-memcpy.mir (+1-1)
  • (modified) llvm/test/CodeGen/AArch64/GlobalISel/inline-memmove.mir (+1-1)
  • (modified) llvm/test/CodeGen/AArch64/GlobalISel/inline-memset.mir (+1-1)
  • (modified) llvm/test/CodeGen/AArch64/aarch64-2014-08-11-MachineCombinerCrash.ll (+1-1)
  • (modified) llvm/test/CodeGen/AArch64/aarch64-a57-fp-load-balancing.ll (+2-2)
  • (modified) llvm/test/CodeGen/AArch64/aarch64-dynamic-stack-layout.ll (+2-2)
  • (modified) llvm/test/CodeGen/AArch64/aarch64-fix-cortex-a53-835769.ll (+2-2)
  • (modified) llvm/test/CodeGen/AArch64/aarch64-mov-debug-locs.mir (+2-2)
  • (modified) llvm/test/CodeGen/AArch64/arm64-detect-vec-redux.ll (+1-1)
  • (modified) llvm/test/CodeGen/AArch64/arm64-fma-combine-with-fpfusion.ll (+1-1)
  • (modified) llvm/test/CodeGen/AArch64/arm64-fma-combines.ll (+1-1)
  • (modified) llvm/test/CodeGen/AArch64/arm64-indexed-vector-ldst-2.ll (+1-1)
  • (modified) llvm/test/CodeGen/AArch64/arm64-misched-basic-A53.ll (+1-1)
  • (modified) llvm/test/CodeGen/AArch64/arm64-misched-basic-A57.ll (+1-1)
  • (modified) llvm/test/CodeGen/AArch64/arm64-rounding.ll (+1-1)
  • (modified) llvm/test/CodeGen/AArch64/arm64-storebytesmerge.ll (+2-2)
  • (modified) llvm/test/CodeGen/AArch64/arm64-triv-disjoint-mem-access.ll (+1-1)
  • (modified) llvm/test/CodeGen/AArch64/bti-branch-relaxation.ll (+1-1)
  • (modified) llvm/test/CodeGen/AArch64/consthoist-gep.ll (+1-1)
  • (modified) llvm/test/CodeGen/AArch64/csel-zero-float.ll (+1-1)
  • (modified) llvm/test/CodeGen/AArch64/dag-combine-invaraints.ll (+2-2)
  • (modified) llvm/test/CodeGen/AArch64/partial-pipeline-execution.ll (+1-1)
  • (modified) llvm/test/CodeGen/AArch64/recp-fastmath.ll (+2-2)
  • (modified) llvm/test/CodeGen/AArch64/stack-tagging-ex-1.ll (+1-1)
  • (modified) llvm/test/CodeGen/AArch64/stack-tagging-ex-2.ll (+2-2)
  • (modified) llvm/test/CodeGen/AArch64/stack-tagging-untag-placement.ll (+1-1)
  • (modified) llvm/test/CodeGen/AArch64/stack_guard_remat.ll (+1-1)
  • (modified) llvm/test/CodeGen/AArch64/svtcf-fmul-fdiv-combine.ll (+1-1)
  • (modified) llvm/test/CodeGen/AArch64/vector_merge_dep_check.ll (+1-1)
  • (modified) llvm/test/CodeGen/AArch64/wineh-frame5.mir (+2-2)
  • (modified) llvm/test/CodeGen/AArch64/wineh-frame6.mir (+2-2)
  • (modified) llvm/test/CodeGen/AArch64/wineh-frame7.mir (+2-2)
  • (modified) llvm/test/CodeGen/AArch64/wineh-frame8.mir (+1-1)
  • (modified) llvm/test/CodeGen/AArch64/wineh5.mir (+2-2)
  • (modified) llvm/test/CodeGen/AArch64/wineh_shrinkwrap.mir (+2-2)
  • (modified) llvm/test/CodeGen/AMDGPU/GlobalISel/combine-fma-unmerge-values.mir (+1-1)
  • (modified) llvm/test/CodeGen/AMDGPU/GlobalISel/inst-select-fract.f64.mir (+2-2)
  • (modified) llvm/test/CodeGen/AMDGPU/combine_andor_with_cmps.ll (+1-1)
  • (modified) llvm/test/CodeGen/AMDGPU/fadd-fma-fmul-combine.ll (+4-4)
  • (modified) llvm/test/CodeGen/AMDGPU/fdiv.f64.ll (+1-1)
  • (modified) llvm/test/CodeGen/AMDGPU/fmad-formation-fmul-distribute-denormal-mode.ll (+1-1)
  • (modified) llvm/test/CodeGen/AMDGPU/fmed3.bf16.ll (+2-2)
  • (modified) llvm/test/CodeGen/AMDGPU/fmed3.ll (+1-1)
  • (modified) llvm/test/CodeGen/AMDGPU/fneg-combines.legal.f16.ll (+1-1)
  • (modified) llvm/test/CodeGen/AMDGPU/fneg-combines.ll (+1-1)
  • (modified) llvm/test/CodeGen/AMDGPU/fpext.f16.ll (+5-5)
  • (modified) llvm/test/CodeGen/AMDGPU/fptosi.f16.ll (+4-4)
  • (modified) llvm/test/CodeGen/AMDGPU/fptoui.f16.ll (+4-4)
  • (modified) llvm/test/CodeGen/AMDGPU/fptrunc.ll (+4-4)
  • (modified) llvm/test/CodeGen/AMDGPU/fract.f64.ll (+2-2)
  • (modified) llvm/test/CodeGen/AMDGPU/fract.ll (+2-2)
  • (modified) llvm/test/CodeGen/AMDGPU/frem.ll (+2-2)
  • (modified) llvm/test/CodeGen/AMDGPU/fsqrt.f64.ll (+1-2)
  • (modified) llvm/test/CodeGen/AMDGPU/fsqrt.r600.ll (+1-1)
  • (modified) llvm/test/CodeGen/AMDGPU/inline-attr.ll (+9-9)
  • (modified) llvm/test/CodeGen/AMDGPU/llvm.exp2.ll (+1-1)
  • (modified) llvm/test/CodeGen/AMDGPU/llvm.log2.ll (+1-1)
  • (modified) llvm/test/CodeGen/AMDGPU/minmax.ll (+1-1)
  • (modified) llvm/test/CodeGen/AMDGPU/prevent-fmul-hoist-ir.ll (+1-1)
  • (modified) llvm/test/CodeGen/AMDGPU/sitofp.f16.ll (+4-4)
  • (modified) llvm/test/CodeGen/AMDGPU/uitofp.f16.ll (+4-4)
  • (modified) llvm/test/CodeGen/ARM/2014-05-14-DwarfEHCrash.ll (+1-1)
  • (modified) llvm/test/CodeGen/ARM/ARMLoadStoreDBG.mir (+2-2)
  • (modified) llvm/test/CodeGen/ARM/Windows/wineh-basic.ll (+2-2)
  • (modified) llvm/test/CodeGen/ARM/byval_load_align.ll (+2-2)
  • (modified) llvm/test/CodeGen/ARM/cfguard-module-flag.ll (+1-1)
  • (modified) llvm/test/CodeGen/ARM/clang-section.ll (+2-2)
  • (modified) llvm/test/CodeGen/ARM/cmse-clear-float-bigend.mir (+1-1)
  • (modified) llvm/test/CodeGen/ARM/coalesce-dbgvalue.ll (+2-2)
  • (modified) llvm/test/CodeGen/ARM/constantpool-promote-dbg.ll (+1-1)
  • (modified) llvm/test/CodeGen/ARM/constantpool-promote.ll (+2-2)
  • (modified) llvm/test/CodeGen/ARM/early-cfi-sections.ll (+1-1)
  • (modified) llvm/test/CodeGen/ARM/fp16-vld.ll (+1-1)
  • (modified) llvm/test/CodeGen/ARM/global-merge-1.ll (+3-3)
  • (modified) llvm/test/CodeGen/ARM/isel-v8i32-crash.ll (+1-1)
  • (modified) llvm/test/CodeGen/ARM/out-of-registers.ll (+1-1)
  • (modified) llvm/test/CodeGen/ARM/relax-per-target-feature.ll (+1-1)
  • (modified) llvm/test/CodeGen/ARM/softfp-constant-comparison.ll (+1-1)
  • (modified) llvm/test/CodeGen/ARM/stack-protector-bmovpcb_call.ll (+2-2)
  • (modified) llvm/test/CodeGen/ARM/stack_guard_remat.ll (+1-1)
  • (modified) llvm/test/CodeGen/ARM/struct-byval-frame-index.ll (+1-1)
  • (modified) llvm/test/CodeGen/ARM/subtarget-align.ll (+1-1)
  • (modified) llvm/test/CodeGen/ARM/unschedule-first-call.ll (+1-1)
  • (modified) llvm/test/CodeGen/ARM/vector-spilling.ll (+1-1)
  • (modified) llvm/test/CodeGen/ARM/vldm-sched-a9.ll (+1-1)
  • (modified) llvm/test/CodeGen/BPF/BTF/binary-format.ll (+1-1)
  • (modified) llvm/test/CodeGen/BPF/BTF/builtin-btf-type-id.ll (+1-1)
  • (modified) llvm/test/CodeGen/BPF/BTF/char-no-debuginfo.ll (+1-1)
  • (modified) llvm/test/CodeGen/BPF/BTF/extern-builtin.ll (+1-1)
  • (modified) llvm/test/CodeGen/BPF/BTF/extern-func-arg.ll (+2-2)
  • (modified) llvm/test/CodeGen/BPF/BTF/extern-global-var.ll (+1-1)
  • (modified) llvm/test/CodeGen/BPF/BTF/extern-var-func-weak-section.ll (+2-2)
  • (modified) llvm/test/CodeGen/BPF/BTF/extern-var-func-weak.ll (+2-2)
  • (modified) llvm/test/CodeGen/BPF/BTF/extern-var-func.ll (+2-2)
  • (modified) llvm/test/CodeGen/BPF/BTF/extern-var-section.ll (+2-2)
  • (modified) llvm/test/CodeGen/BPF/BTF/extern-var-struct-weak.ll (+1-1)
  • (modified) llvm/test/CodeGen/BPF/BTF/extern-var-struct.ll (+1-1)
  • (modified) llvm/test/CodeGen/BPF/BTF/extern-var-weak-section.ll (+2-2)
  • (modified) llvm/test/CodeGen/BPF/BTF/filename.ll (+1-1)
  • (modified) llvm/test/CodeGen/BPF/BTF/func-func-ptr.ll (+1-1)
  • (modified) llvm/test/CodeGen/BPF/BTF/func-non-void.ll (+1-1)
  • (modified) llvm/test/CodeGen/BPF/BTF/func-source.ll (+1-1)
  • (modified) llvm/test/CodeGen/BPF/BTF/func-typedef.ll (+1-1)
  • (modified) llvm/test/CodeGen/BPF/BTF/func-unused-arg.ll (+1-1)
  • (modified) llvm/test/CodeGen/BPF/BTF/func-void.ll (+1-1)
  • (modified) llvm/test/CodeGen/BPF/BTF/local-var-readonly-1.ll (+2-2)
  • (modified) llvm/test/CodeGen/BPF/BTF/local-var-readonly-2.ll (+2-2)
  • (modified) llvm/test/CodeGen/BPF/BTF/local-var.ll (+1-1)
  • (modified) llvm/test/CodeGen/BPF/BTF/pruning-const.ll (+2-2)
  • (modified) llvm/test/CodeGen/BPF/BTF/pruning-typedef.ll (+2-2)
  • (modified) llvm/test/CodeGen/BPF/BTF/static-func.ll (+3-3)
  • (modified) llvm/test/CodeGen/BPF/BTF/static-var-derived-type.ll (+1-1)
  • (modified) llvm/test/CodeGen/BPF/BTF/static-var-inited-sec.ll (+1-1)
  • (modified) llvm/test/CodeGen/BPF/BTF/static-var-inited.ll (+1-1)
  • (modified) llvm/test/CodeGen/BPF/BTF/static-var-readonly-sec.ll (+1-1)
  • (modified) llvm/test/CodeGen/BPF/BTF/static-var-readonly.ll (+1-1)
  • (modified) llvm/test/CodeGen/BPF/BTF/static-var-sec.ll (+1-1)
  • (modified) llvm/test/CodeGen/BPF/BTF/static-var-zerolen-array.ll (+1-1)
  • (modified) llvm/test/CodeGen/BPF/BTF/static-var.ll (+1-1)
  • (modified) llvm/test/CodeGen/BPF/BTF/struct-anon-2.ll (+1-1)
  • (modified) llvm/test/CodeGen/BPF/BTF/weak-global-2.ll (+1-1)
  • (modified) llvm/test/CodeGen/BPF/BTF/weak-global.ll (+1-1)
  • (modified) llvm/test/CodeGen/BPF/CORE/btf-id-duplicate.ll (+1-1)
  • (modified) llvm/test/CodeGen/BPF/CORE/field-reloc-alu32.ll (+1-1)
  • (modified) llvm/test/CodeGen/BPF/CORE/field-reloc-bitfield-1-bpfeb.ll (+1-1)
  • (modified) llvm/test/CodeGen/BPF/CORE/field-reloc-bitfield-1.ll (+1-1)
  • (modified) llvm/test/CodeGen/BPF/CORE/field-reloc-bitfield-2-bpfeb.ll (+1-1)
  • (modified) llvm/test/CodeGen/BPF/CORE/field-reloc-bitfield-2.ll (+1-1)
  • (modified) llvm/test/CodeGen/BPF/CORE/field-reloc-duplicate.ll (+1-1)
  • (modified) llvm/test/CodeGen/BPF/CORE/intrinsic-array-2.ll (+1-1)
  • (modified) llvm/test/CodeGen/BPF/CORE/intrinsic-array.ll (+2-2)
  • (modified) llvm/test/CodeGen/BPF/CORE/intrinsic-fieldinfo-byte-size-1.ll (+1-1)
  • (modified) llvm/test/CodeGen/BPF/CORE/intrinsic-fieldinfo-byte-size-2.ll (+1-1)
  • (modified) llvm/test/CodeGen/BPF/CORE/intrinsic-fieldinfo-byte-size-3.ll (+1-1)
  • (modified) llvm/test/CodeGen/BPF/CORE/intrinsic-fieldinfo-byte-size-4.ll (+1-1)
  • (modified) llvm/test/CodeGen/BPF/CORE/intrinsic-fieldinfo-existence-1.ll (+1-1)
  • (modified) llvm/test/CodeGen/BPF/CORE/intrinsic-fieldinfo-existence-2.ll (+1-1)
  • (modified) llvm/test/CodeGen/BPF/CORE/intrinsic-fieldinfo-existence-3.ll (+1-1)
  • (modified) llvm/test/CodeGen/BPF/CORE/intrinsic-fieldinfo-lshift-1-bpfeb.ll (+1-1)
  • (modified) llvm/test/CodeGen/BPF/CORE/intrinsic-fieldinfo-lshift-1.ll (+1-1)
  • (modified) llvm/test/CodeGen/BPF/CORE/intrinsic-fieldinfo-lshift-2.ll (+1-1)
  • (modified) llvm/test/CodeGen/BPF/CORE/intrinsic-fieldinfo-rshift-1.ll (+1-1)
  • (modified) llvm/test/CodeGen/BPF/CORE/intrinsic-fieldinfo-rshift-2.ll (+1-1)
  • (modified) llvm/test/CodeGen/BPF/CORE/intrinsic-fieldinfo-rshift-3.ll (+1-1)
  • (modified) llvm/test/CodeGen/BPF/CORE/intrinsic-fieldinfo-signedness-1.ll (+1-1)
  • (modified) llvm/test/CodeGen/BPF/CORE/intrinsic-fieldinfo-signedness-2.ll (+1-1)
  • (modified) llvm/test/CodeGen/BPF/CORE/intrinsic-fieldinfo-signedness-3.ll (+1-1)
  • (modified) llvm/test/CodeGen/BPF/CORE/intrinsic-struct.ll (+2-2)
  • (modified) llvm/test/CodeGen/BPF/CORE/intrinsic-typeinfo-enum-value.ll (+1-1)
  • (modified) llvm/test/CodeGen/BPF/CORE/intrinsic-typeinfo-type-exist.ll (+1-1)
  • (modified) llvm/test/CodeGen/BPF/CORE/intrinsic-typeinfo-type-size-1.ll (+1-1)
  • (modified) llvm/test/CodeGen/BPF/CORE/intrinsic-typeinfo-type-size-2.ll (+1-1)
  • (modified) llvm/test/CodeGen/BPF/CORE/intrinsic-union.ll (+2-2)
  • (modified) llvm/test/CodeGen/BPF/CORE/no-elf-ama-symbol.ll (+1-1)
  • (modified) llvm/test/CodeGen/BPF/CORE/no-narrow-load.ll (+2-2)
  • (modified) llvm/test/CodeGen/BPF/CORE/offset-reloc-access-str.ll (+2-2)
  • (modified) llvm/test/CodeGen/BPF/CORE/offset-reloc-basic.ll (+1-1)
  • (modified) llvm/test/CodeGen/BPF/CORE/offset-reloc-cast-array-1.ll (+2-2)
  • (modified) llvm/test/CodeGen/BPF/CORE/offset-reloc-cast-array-2.ll (+2-2)
  • (modified) llvm/test/CodeGen/BPF/CORE/offset-reloc-cast-struct-1.ll (+2-2)
  • (modified) llvm/test/CodeGen/BPF/CORE/offset-reloc-cast-struct-2.ll (+2-2)
  • (modified) llvm/test/CodeGen/BPF/CORE/offset-reloc-cast-struct-3.ll (+2-2)
  • (modified) llvm/test/CodeGen/BPF/CORE/offset-reloc-cast-union-1.ll (+2-2)
  • (modified) llvm/test/CodeGen/BPF/CORE/offset-reloc-cast-union-2.ll (+2-2)
  • (modified) llvm/test/CodeGen/BPF/CORE/offset-reloc-end-load.ll (+1-1)
  • (modified) llvm/test/CodeGen/BPF/CORE/offset-reloc-end-ret.ll (+1-1)
  • (modified) llvm/test/CodeGen/BPF/CORE/offset-reloc-fieldinfo-1.ll (+2-2)
  • (modified) llvm/test/CodeGen/BPF/CORE/offset-reloc-fieldinfo-2-bpfeb.ll (+1-1)
  • (modified) llvm/test/CodeGen/BPF/CORE/offset-reloc-fieldinfo-2.ll (+1-1)
  • (modified) llvm/test/CodeGen/BPF/CORE/offset-reloc-global-1.ll (+2-2)
  • (modified) llvm/test/CodeGen/BPF/CORE/offset-reloc-global-2.ll (+2-2)
  • (modified) llvm/test/CodeGen/BPF/CORE/offset-reloc-global-3.ll (+2-2)
  • (modified) llvm/test/CodeGen/BPF/CORE/offset-reloc-ignore.ll (+2-2)
  • (modified) llvm/test/CodeGen/BPF/CORE/offset-reloc-middle-chain.ll (+2-2)
  • (modified) llvm/test/CodeGen/BPF/CORE/offset-reloc-multi-array-1.ll (+2-2)
  • (modified) llvm/test/CodeGen/BPF/CORE/offset-reloc-multi-array-2.ll (+2-2)
  • (modified) llvm/test/CodeGen/BPF/CORE/offset-reloc-multilevel.ll (+1-1)
  • (modified) llvm/test/CodeGen/BPF/CORE/offset-reloc-pointer-1.ll (+2-2)
  • (modified) llvm/test/CodeGen/BPF/CORE/offset-reloc-pointer-2.ll (+2-2)
  • (modified) llvm/test/CodeGen/BPF/CORE/offset-reloc-struct-anonymous.ll (+1-1)
  • (modified) llvm/test/CodeGen/BPF/CORE/offset-reloc-struct-array.ll (+1-1)
  • (modified) llvm/test/CodeGen/BPF/CORE/offset-reloc-typedef-array.ll (+2-2)
  • (modified) llvm/test/CodeGen/BPF/CORE/offset-reloc-typedef-struct-2.ll (+1-1)
  • (modified) llvm/test/CodeGen/BPF/CORE/offset-reloc-typedef-struct.ll (+2-2)
  • (modified) llvm/test/CodeGen/BPF/CORE/offset-reloc-typedef-union-2.ll (+1-1)
  • (modified) llvm/test/CodeGen/BPF/CORE/offset-reloc-typedef-union.ll (+2-2)
  • (modified) llvm/test/CodeGen/BPF/CORE/offset-reloc-typedef.ll (+2-2)
  • (modified) llvm/test/CodeGen/BPF/CORE/offset-reloc-union.ll (+1-1)
  • (modified) llvm/test/CodeGen/BPF/CORE/store-addr.ll (+2-2)
  • (modified) llvm/test/CodeGen/BPF/adjust-opt-icmp1.ll (+2-2)
  • (modified) llvm/test/CodeGen/BPF/adjust-opt-icmp2.ll (+2-2)
  • (modified) llvm/test/CodeGen/BPF/adjust-opt-speculative1.ll (+2-2)
  • (modified) llvm/test/CodeGen/BPF/adjust-opt-speculative2.ll (+2-2)
  • (modified) llvm/test/CodeGen/BPF/callx.ll (+1-1)
  • (modified) llvm/test/CodeGen/BPF/dwarfdump.ll (+1-1)
  • (modified) llvm/test/CodeGen/BPF/i128.ll (+2-2)
  • (modified) llvm/test/CodeGen/BPF/is_trunc_free.ll (+2-2)
  • (modified) llvm/test/CodeGen/BPF/is_zext_free.ll (+1-1)
  • (modified) llvm/test/CodeGen/BPF/objdump_two_funcs.ll (+1-1)
  • (modified) llvm/test/CodeGen/BPF/optnone-1.ll (+1-1)
  • (modified) llvm/test/CodeGen/BPF/reloc-btf-2.ll (+1-1)
  • (modified) llvm/test/CodeGen/BPF/reloc-btf.ll (+1-1)
  • (modified) llvm/test/CodeGen/BPF/simplifycfg.ll (+2-2)
  • (modified) llvm/test/CodeGen/BPF/warn-stack.ll (+2-2)
  • (modified) llvm/test/CodeGen/BPF/xadd.ll (+1-1)
  • (modified) llvm/test/CodeGen/Generic/cfi-sections.ll (+2-2)
  • (modified) llvm/test/CodeGen/Hexagon/NVJumpCmp.ll (+1-1)
  • (modified) llvm/test/CodeGen/Hexagon/addh-sext-trunc.ll (+1-1)
  • (modified) llvm/test/CodeGen/Hexagon/alu64.ll (+1-1)
  • (modified) llvm/test/CodeGen/Hexagon/autohvx/fsplat.ll (+1-1)
  • (modified) llvm/test/CodeGen/Hexagon/autohvx/hfinsert.ll (+1-1)
  • (modified) llvm/test/CodeGen/Hexagon/autohvx/hfnosplat_cp.ll (+1-1)
  • (modified) llvm/test/CodeGen/Hexagon/autohvx/hfsplat.ll (+1-1)
  • (modified) llvm/test/CodeGen/Hexagon/base-offset-addr.ll (+1-1)
  • (modified) llvm/test/CodeGen/Hexagon/base-offset-post.ll (+1-1)
  • (modified) llvm/test/CodeGen/Hexagon/bit-loop-rc-mismatch.ll (+2-2)
  • (modified) llvm/test/CodeGen/Hexagon/bit-rie.ll (+1-1)
  • (modified) llvm/test/CodeGen/Hexagon/builtin-prefetch.ll (+1-1)
  • (modified) llvm/test/CodeGen/Hexagon/cfi-offset.ll (+1-1)
  • (modified) llvm/test/CodeGen/Hexagon/cmp-extend.ll (+1-1)
  • (modified) llvm/test/CodeGen/Hexagon/cmp.ll (+1-1)
  • (modified) llvm/test/CodeGen/Hexagon/constp-combine-neg.ll (+1-1)
  • (modified) llvm/test/CodeGen/Hexagon/constp-extract.ll (+1-1)
  • (modified) llvm/test/CodeGen/Hexagon/constp-physreg.ll (+1-1)
  • (modified) llvm/test/CodeGen/Hexagon/dead-store-stack.ll (+2-2)
  • (modified) llvm/test/CodeGen/Hexagon/early-if-conversion-bug1.ll (+2-2)
  • (modified) llvm/test/CodeGen/Hexagon/fminmax.ll (+1-1)
  • (modified) llvm/test/CodeGen/Hexagon/hexagon_vector_loop_carried_reuse.ll (+1-1)
  • (modified) llvm/test/CodeGen/Hexagon/hexagon_vector_loop_carried_reuse_constant.ll (+1-1)
  • (modified) llvm/test/CodeGen/Hexagon/hwloop-crit-edge.ll (+1-1)
  • (modified) llvm/test/CodeGen/Hexagon/hwloop-preheader.ll (+1-1)
  • (modified) llvm/test/CodeGen/Hexagon/intrinsics-v67.ll (+1-1)
  • (modified) llvm/test/CodeGen/Hexagon/jt-in-text.ll (+1-1)
  • (modified) llvm/test/CodeGen/Hexagon/ldst_vector_offset.ll (+1-1)
  • (modified) llvm/test/CodeGen/Hexagon/loopIdiom.ll (+1-1)
  • (modified) llvm/test/CodeGen/Hexagon/loop_align_count.ll (+1-1)
  • (modified) llvm/test/CodeGen/Hexagon/mem-fi-add.ll (+2-2)
  • (modified) llvm/test/CodeGen/Hexagon/memops-stack.ll (+2-2)
  • (modified) llvm/test/CodeGen/Hexagon/pic-regusage.ll (+1-1)
  • (modified) llvm/test/CodeGen/Hexagon/postinc-offset.ll (+1-1)
  • (modified) llvm/test/CodeGen/Hexagon/rdf-dead-loop.ll (+1-1)
  • (modified) llvm/test/CodeGen/Hexagon/rdf-inline-asm-fixed.ll (+1-1)
  • (modified) llvm/test/CodeGen/Hexagon/rdf-inline-asm.ll (+1-1)
  • (modified) llvm/test/CodeGen/Hexagon/reg-scavengebug-3.ll (+2-2)
  • (modified) llvm/test/CodeGen/Hexagon/runtime-stkchk.ll (+2-2)
  • (modified) llvm/test/CodeGen/Hexagon/sdr-shr32.ll (+1-1)
  • (modified) llvm/test/CodeGen/Hexagon/switch-lut-explicit-section.ll (+1-1)
  • (modified) llvm/test/CodeGen/Hexagon/switch-lut-function-section.ll (+1-1)
  • (modified) llvm/test/CodeGen/Hexagon/switch-lut-multiple-functions.ll (+1-1)
  • (modified) llvm/test/CodeGen/Hexagon/switch-lut-text-section.ll (+1-1)
  • (modified) llvm/test/CodeGen/Hexagon/swp-epilog-phi10.ll (+1-1)
  • (modified) llvm/test/CodeGen/Hexagon/swp-phi.ll (+1-1)
  • (modified) llvm/test/CodeGen/Hexagon/swp-pragma-disable-bug.ll (+1-1)
  • (modified) llvm/test/CodeGen/Hexagon/swp-prolog-phi4.ll (+1-1)
  • (modified) llvm/test/CodeGen/Hexagon/swp-stages4.ll (+1-1)
  • (modified) llvm/test/CodeGen/Hexagon/usr-ovf-dep.ll (+1-1)
  • (modified) llvm/test/CodeGen/Hexagon/v6-haar-balign32.ll (+1-1)
  • (modified) llvm/test/CodeGen/Hexagon/v60Intrins.ll (+1-1)
  • (modified) llvm/test/CodeGen/Hexagon/v60small.ll (+1-1)
  • (modified) llvm/test/CodeGen/Hexagon/v6vec-vprint.ll (+1-1)
  • (modified) llvm/test/CodeGen/Hexagon/vec-pred-spill1.ll (+2-2)
  • (modified) llvm/test/CodeGen/Hexagon/vect-regpairs.ll (+1-1)
diff --git a/clang/lib/CodeGen/BackendUtil.cpp b/clang/lib/CodeGen/BackendUtil.cpp
index 602068436101b..ecfbcb5970092 100644
--- a/clang/lib/CodeGen/BackendUtil.cpp
+++ b/clang/lib/CodeGen/BackendUtil.cpp
@@ -430,12 +430,6 @@ static bool initTargetOptions(const CompilerInstance &CI,
   Options.NoInfsFPMath = LangOpts.NoHonorInfs;
   Options.NoNaNsFPMath = LangOpts.NoHonorNaNs;
   Options.NoZerosInBSS = CodeGenOpts.NoZeroInitializedInBSS;
-  Options.UnsafeFPMath = LangOpts.AllowFPReassoc && LangOpts.AllowRecip &&
-                         LangOpts.NoSignedZero && LangOpts.ApproxFunc &&
-                         (LangOpts.getDefaultFPContractMode() ==
-                              LangOptions::FPModeKind::FPM_Fast ||
-                          LangOpts.getDefaultFPContractMode() ==
-                              LangOptions::FPModeKind::FPM_FastHonorPragmas);
 
   Options.BBAddrMap = CodeGenOpts.BBAddrMap;
   Options.BBSections =
diff --git a/lld/test/COFF/Inputs/undefined-symbol-lto-a.ll b/lld/test/COFF/Inputs/undefined-symbol-lto-a.ll
index 7e29044ebe00d..f57a3e3c1ede4 100644
--- a/lld/test/COFF/Inputs/undefined-symbol-lto-a.ll
+++ b/lld/test/COFF/Inputs/undefined-symbol-lto-a.ll
@@ -47,8 +47,8 @@ entry:
   ret void
 }
 
-attributes #0 = { "correctly-rounded-divide-sqrt-fp-math"="false" "disable-tail-calls"="false" "less-precise-fpmad"="false" "frame-pointer"="none" "no-infs-fp-math"="false" "no-nans-fp-math"="false" "no-signed-zeros-fp-math"="false" "no-trapping-math"="false" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "unsafe-fp-math"="false" "use-soft-float"="false" }
-attributes #1 = { nounwind sspstrong uwtable "correctly-rounded-divide-sqrt-fp-math"="false" "disable-tail-calls"="false" "less-precise-fpmad"="false" "min-legal-vector-width"="0" "frame-pointer"="none" "no-infs-fp-math"="false" "no-jump-tables"="false" "no-nans-fp-math"="false" "no-signed-zeros-fp-math"="false" "no-trapping-math"="false" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "unsafe-fp-math"="false" "use-soft-float"="false" }
+attributes #0 = { "correctly-rounded-divide-sqrt-fp-math"="false" "disable-tail-calls"="false" "less-precise-fpmad"="false" "frame-pointer"="none" "no-infs-fp-math"="false" "no-nans-fp-math"="false" "no-signed-zeros-fp-math"="false" "no-trapping-math"="false" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "use-soft-float"="false" }
+attributes #1 = { nounwind sspstrong uwtable "correctly-rounded-divide-sqrt-fp-math"="false" "disable-tail-calls"="false" "less-precise-fpmad"="false" "min-legal-vector-width"="0" "frame-pointer"="none" "no-infs-fp-math"="false" "no-jump-tables"="false" "no-nans-fp-math"="false" "no-signed-zeros-fp-math"="false" "no-trapping-math"="false" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "use-soft-float"="false" }
 attributes #2 = { nounwind }
 
 !llvm.linker.options = !{!1, !2}
diff --git a/lld/test/COFF/Inputs/undefined-symbol-lto-b.ll b/lld/test/COFF/Inputs/undefined-symbol-lto-b.ll
index 0f64e236a1f47..7347fde7a9dee 100644
--- a/lld/test/COFF/Inputs/undefined-symbol-lto-b.ll
+++ b/lld/test/COFF/Inputs/undefined-symbol-lto-b.ll
@@ -11,7 +11,7 @@ entry:
   ret void
 }
 
-attributes #0 = { norecurse nounwind readnone sspstrong uwtable "correctly-rounded-divide-sqrt-fp-math"="false" "disable-tail-calls"="false" "less-precise-fpmad"="false" "min-legal-vector-width"="0" "frame-pointer"="none" "no-infs-fp-math"="false" "no-jump-tables"="false" "no-nans-fp-math"="false" "no-signed-zeros-fp-math"="false" "no-trapping-math"="false" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "unsafe-fp-math"="false" "use-soft-float"="false" }
+attributes #0 = { norecurse nounwind readnone sspstrong uwtable "correctly-rounded-divide-sqrt-fp-math"="false" "disable-tail-calls"="false" "less-precise-fpmad"="false" "min-legal-vector-width"="0" "frame-pointer"="none" "no-infs-fp-math"="false" "no-jump-tables"="false" "no-nans-fp-math"="false" "no-signed-zeros-fp-math"="false" "no-trapping-math"="false" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "use-soft-float"="false" }
 
 !llvm.linker.options = !{!0, !1}
 !llvm.module.flags = !{!2, !3, !4, !5}
diff --git a/lld/test/COFF/Inputs/undefined-symbol-multi-lto.ll b/lld/test/COFF/Inputs/undefined-symbol-multi-lto.ll
index 5f6730272e610..61828cae7ea58 100644
--- a/lld/test/COFF/Inputs/undefined-symbol-multi-lto.ll
+++ b/lld/test/COFF/Inputs/undefined-symbol-multi-lto.ll
@@ -13,8 +13,8 @@ declare dso_local i32 @"?foo@@YAHXZ"() #1
 
 declare dso_local i32 @"?bar@@YAHXZ"() #1
 
-attributes #0 = { noinline optnone uwtable "correctly-rounded-divide-sqrt-fp-math"="false" "disable-tail-calls"="false" "frame-pointer"="all" "less-precise-fpmad"="false" "min-legal-vector-width"="0" "no-infs-fp-math"="false" "no-jump-tables"="false" "no-nans-fp-math"="false" "no-signed-zeros-fp-math"="false" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "unsafe-fp-math"="false" "use-soft-float"="false" }
-attributes #1 = { "correctly-rounded-divide-sqrt-fp-math"="false" "disable-tail-calls"="false" "frame-pointer"="all" "less-precise-fpmad"="false" "no-infs-fp-math"="false" "no-nans-fp-math"="false" "no-signed-zeros-fp-math"="false" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "unsafe-fp-math"="false" "use-soft-float"="false" }
+attributes #0 = { noinline optnone uwtable "correctly-rounded-divide-sqrt-fp-math"="false" "disable-tail-calls"="false" "frame-pointer"="all" "less-precise-fpmad"="false" "min-legal-vector-width"="0" "no-infs-fp-math"="false" "no-jump-tables"="false" "no-nans-fp-math"="false" "no-signed-zeros-fp-math"="false" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "use-soft-float"="false" }
+attributes #1 = { "correctly-rounded-divide-sqrt-fp-math"="false" "disable-tail-calls"="false" "frame-pointer"="all" "less-precise-fpmad"="false" "no-infs-fp-math"="false" "no-nans-fp-math"="false" "no-signed-zeros-fp-math"="false" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "use-soft-float"="false" }
 
 !llvm.module.flags = !{!0}
 !llvm.ident = !{!1}
diff --git a/lld/test/MachO/lto-mattrs.ll b/lld/test/MachO/lto-mattrs.ll
index f658b485a1792..41313296dc269 100644
--- a/lld/test/MachO/lto-mattrs.ll
+++ b/lld/test/MachO/lto-mattrs.ll
@@ -33,4 +33,4 @@ define float @foo(float %x) #0 {
   ret float %div
 }
 
-attributes #0 = { "unsafe-fp-math"="true" "reciprocal-estimates"="divf,vec-divf" }
+attributes #0 = { "reciprocal-estimates"="divf,vec-divf" }
diff --git a/lld/test/wasm/Inputs/debuginfo1.ll b/lld/test/wasm/Inputs/debuginfo1.ll
index d6db88002ce1e..0a1c42a214f2c 100644
--- a/lld/test/wasm/Inputs/debuginfo1.ll
+++ b/lld/test/wasm/Inputs/debuginfo1.ll
@@ -35,9 +35,9 @@ declare void @foo(i32) local_unnamed_addr #2
 ; Function Attrs: nounwind readnone speculatable
 declare void @llvm.dbg.value(metadata, metadata, metadata) #3
 
-attributes #0 = { nounwind readnone "correctly-rounded-divide-sqrt-fp-math"="false" "disable-tail-calls"="false" "less-precise-fpmad"="false" "frame-pointer"="none" "no-infs-fp-math"="false" "no-jump-tables"="false" "no-nans-fp-math"="false" "no-signed-zeros-fp-math"="false" "no-trapping-math"="false" "stack-protector-buffer-size"="8" "target-cpu"="generic" "unsafe-fp-math"="false" "use-soft-float"="false" }
-attributes #1 = { nounwind "correctly-rounded-divide-sqrt-fp-math"="false" "disable-tail-calls"="false" "less-precise-fpmad"="false" "frame-pointer"="none" "no-infs-fp-math"="false" "no-jump-tables"="false" "no-nans-fp-math"="false" "no-signed-zeros-fp-math"="false" "no-trapping-math"="false" "stack-protector-buffer-size"="8" "target-cpu"="generic" "unsafe-fp-math"="false" "use-soft-float"="false" }
-attributes #2 = { "correctly-rounded-divide-sqrt-fp-math"="false" "disable-tail-calls"="false" "less-precise-fpmad"="false" "frame-pointer"="none" "no-infs-fp-math"="false" "no-nans-fp-math"="false" "no-signed-zeros-fp-math"="false" "no-trapping-math"="false" "stack-protector-buffer-size"="8" "target-cpu"="generic" "unsafe-fp-math"="false" "use-soft-float"="false" }
+attributes #0 = { nounwind readnone "correctly-rounded-divide-sqrt-fp-math"="false" "disable-tail-calls"="false" "less-precise-fpmad"="false" "frame-pointer"="none" "no-infs-fp-math"="false" "no-jump-tables"="false" "no-nans-fp-math"="false" "no-signed-zeros-fp-math"="false" "no-trapping-math"="false" "stack-protector-buffer-size"="8" "target-cpu"="generic" "use-soft-float"="false" }
+attributes #1 = { nounwind "correctly-rounded-divide-sqrt-fp-math"="false" "disable-tail-calls"="false" "less-precise-fpmad"="false" "frame-pointer"="none" "no-infs-fp-math"="false" "no-jump-tables"="false" "no-nans-fp-math"="false" "no-signed-zeros-fp-math"="false" "no-trapping-math"="false" "stack-protector-buffer-size"="8" "target-cpu"="generic" "use-soft-float"="false" }
+attributes #2 = { "correctly-rounded-divide-sqrt-fp-math"="false" "disable-tail-calls"="false" "less-precise-fpmad"="false" "frame-pointer"="none" "no-infs-fp-math"="false" "no-nans-fp-math"="false" "no-signed-zeros-fp-math"="false" "no-trapping-math"="false" "stack-protector-buffer-size"="8" "target-cpu"="generic" "use-soft-float"="false" }
 attributes #3 = { nounwind readnone speculatable }
 attributes #4 = { nounwind }
 
diff --git a/lld/test/wasm/Inputs/debuginfo2.ll b/lld/test/wasm/Inputs/debuginfo2.ll
index 1b63dd57474e5..c832be521e325 100644
--- a/lld/test/wasm/Inputs/debuginfo2.ll
+++ b/lld/test/wasm/Inputs/debuginfo2.ll
@@ -31,7 +31,7 @@ entry:
 ; Function Attrs: nounwind readnone speculatable
 declare void @llvm.dbg.value(metadata, metadata, metadata) #1
 
-attributes #0 = { nounwind "correctly-rounded-divide-sqrt-fp-math"="false" "disable-tail-calls"="false" "less-precise-fpmad"="false" "frame-pointer"="none" "no-infs-fp-math"="false" "no-jump-tables"="false" "no-nans-fp-math"="false" "no-signed-zeros-fp-math"="false" "no-trapping-math"="false" "stack-protector-buffer-size"="8" "target-cpu"="generic" "unsafe-fp-math"="false" "use-soft-float"="false" }
+attributes #0 = { nounwind "correctly-rounded-divide-sqrt-fp-math"="false" "disable-tail-calls"="false" "less-precise-fpmad"="false" "frame-pointer"="none" "no-infs-fp-math"="false" "no-jump-tables"="false" "no-nans-fp-math"="false" "no-signed-zeros-fp-math"="false" "no-trapping-math"="false" "stack-protector-buffer-size"="8" "target-cpu"="generic" "use-soft-float"="false" }
 attributes #1 = { nounwind readnone speculatable }
 
 !llvm.dbg.cu = !{!2}
diff --git a/lld/test/wasm/debug-removed-fn.ll b/lld/test/wasm/debug-removed-fn.ll
index 8dae48a136dc4..20c30346cc0e7 100644
--- a/lld/test/wasm/debug-removed-fn.ll
+++ b/lld/test/wasm/debug-removed-fn.ll
@@ -28,7 +28,7 @@ entry:
   ret i32 6, !dbg !13
 }
 
-attributes #0 = { noinline nounwind optnone "correctly-rounded-divide-sqrt-fp-math"="false" "disable-tail-calls"="false" "less-precise-fpmad"="false" "frame-pointer"="none" "no-infs-fp-math"="false" "no-jump-tables"="false" "no-nans-fp-math"="false" "no-signed-zeros-fp-math"="false" "no-trapping-math"="false" "stack-protector-buffer-size"="8" "target-cpu"="generic" "unsafe-fp-math"="false" "use-soft-float"="false" }
+attributes #0 = { noinline nounwind optnone "correctly-rounded-divide-sqrt-fp-math"="false" "disable-tail-calls"="false" "less-precise-fpmad"="false" "frame-pointer"="none" "no-infs-fp-math"="false" "no-jump-tables"="false" "no-nans-fp-math"="false" "no-signed-zeros-fp-math"="false" "no-trapping-math"="false" "stack-protector-buffer-size"="8" "target-cpu"="generic" "use-soft-float"="false" }
 
 !llvm.dbg.cu = !{!0}
 !llvm.module.flags = !{!3, !4, !5}
diff --git a/llvm/docs/CommandGuide/llc.rst b/llvm/docs/CommandGuide/llc.rst
index 900649f59c401..cc670f6043656 100644
--- a/llvm/docs/CommandGuide/llc.rst
+++ b/llvm/docs/CommandGuide/llc.rst
@@ -125,13 +125,6 @@ End-user Options
 
  Enable setting the FP exceptions build attribute not to use exceptions.
 
-.. option:: --enable-unsafe-fp-math
-
- Enable optimizations that make unsafe assumptions about IEEE math (e.g. that
- addition is associative) or may not work for all input ranges.  These
- optimizations allow the code generator to make use of some instructions which
- would otherwise not be usable (such as ``fsin`` on X86).
-
 .. option:: --stats
 
  Print statistics recorded by code-generation passes.
diff --git a/llvm/docs/CommandGuide/lli.rst b/llvm/docs/CommandGuide/lli.rst
index 94c001380441f..8afe10db05d48 100644
--- a/llvm/docs/CommandGuide/lli.rst
+++ b/llvm/docs/CommandGuide/lli.rst
@@ -107,11 +107,6 @@ FLOATING POINT OPTIONS
 
  Enable optimizations that assume no NAN values.
 
-.. option:: -enable-unsafe-fp-math
-
- Causes :program:`lli` to enable optimizations that may decrease floating point
- precision.
-
 .. option:: -soft-float
 
  Causes :program:`lli` to generate software floating point library calls instead of
diff --git a/llvm/docs/SourceLevelDebugging.rst b/llvm/docs/SourceLevelDebugging.rst
index f057b2d2d2e36..12b5e3e549df7 100644
--- a/llvm/docs/SourceLevelDebugging.rst
+++ b/llvm/docs/SourceLevelDebugging.rst
@@ -674,7 +674,7 @@ Compiled to LLVM, this function would be represented like this:
     ret void, !dbg !24
   }
 
-  attributes #0 = { nounwind ssp uwtable "less-precise-fpmad"="false" "frame-pointer"="all" "no-infs-fp-math"="false" "no-nans-fp-math"="false" "stack-protector-buffer-size"="8" "unsafe-fp-math"="false" "use-soft-float"="false" }
+  attributes #0 = { nounwind ssp uwtable "less-precise-fpmad"="false" "frame-pointer"="all" "no-infs-fp-math"="false" "no-nans-fp-math"="false" "stack-protector-buffer-size"="8" "use-soft-float"="false" }
   attributes #1 = { nounwind readnone }
 
   !llvm.dbg.cu = !{!0}
diff --git a/llvm/include/llvm/CodeGen/CommandFlags.h b/llvm/include/llvm/CodeGen/CommandFlags.h
index 39c5a8d479a5f..af66f2d5776ba 100644
--- a/llvm/include/llvm/CodeGen/CommandFlags.h
+++ b/llvm/include/llvm/CodeGen/CommandFlags.h
@@ -58,8 +58,6 @@ LLVM_ABI CodeGenFileType getFileType();
 
 LLVM_ABI FramePointerKind getFramePointerUsage();
 
-LLVM_ABI bool getEnableUnsafeFPMath();
-
 LLVM_ABI bool getEnableNoInfsFPMath();
 
 LLVM_ABI bool getEnableNoNaNsFPMath();
diff --git a/llvm/include/llvm/IR/Attributes.td b/llvm/include/llvm/IR/Attributes.td
index 8e7d9dcebfe2a..8ce2b1bea8fac 100644
--- a/llvm/include/llvm/IR/Attributes.td
+++ b/llvm/include/llvm/IR/Attributes.td
@@ -410,7 +410,6 @@ def LessPreciseFPMAD : StrBoolAttr<"less-precise-fpmad">;
 def NoInfsFPMath : StrBoolAttr<"no-infs-fp-math">;
 def NoNansFPMath : StrBoolAttr<"no-nans-fp-math">;
 def NoSignedZerosFPMath : StrBoolAttr<"no-signed-zeros-fp-math">;
-def UnsafeFPMath : StrBoolAttr<"unsafe-fp-math">;
 def NoJumpTables : StrBoolAttr<"no-jump-tables">;
 def NoInlineLineTables : StrBoolAttr<"no-inline-line-tables">;
 def ProfileSampleAccurate : StrBoolAttr<"profile-sample-accurate">;
@@ -474,7 +473,6 @@ def : MergeRule<"setAND<LessPreciseFPMADAttr>">;
 def : MergeRule<"setAND<NoInfsFPMathAttr>">;
 def : MergeRule<"setAND<NoNansFPMathAttr>">;
 def : MergeRule<"setAND<NoSignedZerosFPMathAttr>">;
-def : MergeRule<"setAND<UnsafeFPMathAttr>">;
 def : MergeRule<"setOR<NoImplicitFloatAttr>">;
 def : MergeRule<"setOR<NoJumpTablesAttr>">;
 def : MergeRule<"setOR<ProfileSampleAccurateAttr>">;
diff --git a/llvm/include/llvm/Target/TargetOptions.h b/llvm/include/llvm/Target/TargetOptions.h
index 2c2122a7b204f..bfd2817b8d1f5 100644
--- a/llvm/include/llvm/Target/TargetOptions.h
+++ b/llvm/include/llvm/Target/TargetOptions.h
@@ -118,9 +118,8 @@ enum CodeObjectVersionKind {
 class TargetOptions {
 public:
   TargetOptions()
-      : UnsafeFPMath(false), NoInfsFPMath(false), NoNaNsFPMath(false),
-        NoTrappingFPMath(true), NoSignedZerosFPMath(false),
-        EnableAIXExtendedAltivecABI(false),
+      : NoInfsFPMath(false), NoNaNsFPMath(false), NoTrappingFPMath(true),
+        NoSignedZerosFPMath(false), EnableAIXExtendedAltivecABI(false),
         HonorSignDependentRoundingFPMathOption(false), NoZerosInBSS(false),
         GuaranteedTailCallOpt(false), StackSymbolOrdering(true),
         EnableFastISel(false), EnableGlobalISel(false), UseInitArray(false),
@@ -156,13 +155,6 @@ class TargetOptions {
   /// MCAsmInfo::BinutilsVersion.
   std::pair<int, int> BinutilsVersion{0, 0};
 
-  /// UnsafeFPMath - This flag is enabled when the
-  /// -enable-unsafe-fp-math flag is specified on the command line.  When
-  /// this flag is off (the default), the code generator is not allowed to
-  /// produce results that are "less precise" than IEEE allows.  This includes
-  /// use of X86 instructions like FSIN and FCOS instead of libcalls.
-  unsigned UnsafeFPMath : 1;
-
   /// NoInfsFPMath - This flag is enabled when the
   /// -enable-no-infs-fp-math flag is specified on the command line. When
   /// this flag is off (the default), the code generator is not allowed to
diff --git a/llvm/lib/CodeGen/CommandFlags.cpp b/llvm/lib/CodeGen/CommandFlags.cpp
index 0522698adf183..c1365f499dcf5 100644
--- a/llvm/lib/CodeGen/CommandFlags.cpp
+++ b/llvm/lib/CodeGen/CommandFlags.cpp
@@ -64,7 +64,6 @@ CGOPT_EXP(uint64_t, LargeDataThreshold)
 CGOPT(ExceptionHandling, ExceptionModel)
 CGOPT_EXP(CodeGenFileType, FileType)
 CGOPT(FramePointerKind, FramePointerUsage)
-CGOPT(bool, EnableUnsafeFPMath)
 CGOPT(bool, EnableNoInfsFPMath)
 CGOPT(bool, EnableNoNaNsFPMath)
 CGOPT(bool, EnableNoSignedZerosFPMath)
@@ -219,12 +218,6 @@ codegen::RegisterCodeGenFlags::RegisterCodeGenFlags() {
                      "Enable frame pointer elimination")));
   CGBINDOPT(FramePointerUsage);
 
-  static cl::opt<bool> EnableUnsafeFPMath(
-      "enable-unsafe-fp-math",
-      cl::desc("Enable optimizations that may decrease FP precision"),
-      cl::init(false));
-  CGBINDOPT(EnableUnsafeFPMath);
-
   static cl::opt<bool> EnableNoInfsFPMath(
       "enable-no-infs-fp-math",
       cl::desc("Enable FP math optimizations that assume no +-Infs"),
@@ -552,7 +545,6 @@ TargetOptions
 codegen::InitTargetOptionsFromCodeGenFlags(const Triple &TheTriple) {
   TargetOptions Options;
   Options.AllowFPOpFusion = getFuseFPOps();
-  Options.UnsafeFPMath = getEnableUnsafeFPMath();
   Options.NoInfsFPMath = getEnableNoInfsFPMath();
   Options.NoNaNsFPMath = getEnableNoNaNsFPMath();
   Options.NoSignedZerosFPMath = getEnableNoSignedZerosFPMath();
@@ -706,7 +698,6 @@ void codegen::setFunctionAttributes(StringRef CPU, StringRef Features,
   if (getStackRealign())
     NewAttrs.addAttribute("stackrealign");
 
-  HANDLE_BOOL_ATTR(EnableUnsafeFPMathView, "unsafe-fp-math");
   HANDLE_BOOL_ATTR(EnableNoInfsFPMathView, "no-infs-fp-math");
   HANDLE_BOOL_ATTR(EnableNoNaNsFPMathView, "no-nans-fp-math");
   HANDLE_BOOL_ATTR(EnableNoSignedZerosFPMathView, "no-signed-zeros-fp-math");
diff --git a/llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp b/llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp
index 310d35d9b1d1e..d05a6506f9677 100644
--- a/llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp
+++ b/llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp
@@ -17462,9 +17462,9 @@ SDValue DAGCombiner::visitFSUBForFMACombine(SDNode *N) {
   // fold (fsub (fpext (fneg (fmul, x, y))), z)
   //   -> (fneg (fma (fpext x), (fpext y), z))
   // Note: This could be removed with appropriate canonicalization of the
-  // input expression into (fneg (fadd (fpext (fmul, x, y)), z). However, the
-  // orthogonal flags -fp-contract=fast and -enable-unsafe-fp-math prevent
-  // from implementing the canonicalization in visitFSUB.
+  // input expression into (fneg (fadd (fpext (fmul, x, y)), z). However,
+  // -fp-contract=fast prevent from implementing the canonicalization
+  // in visitFSUB.
   if (matcher.match(N0, ISD::FP_EXTEND)) {
     SDValue N00 = N0.getOperand(0);
     if (matcher.match(N00, ISD::FNEG)) {
@@ -17486,9 +17486,9 @@ SDValue DAGCombiner::visitFSUBForFMACombine(SDNode *N) {
   // fold (fsub (fneg (fpext (f...
[truncated]

@llvmbot
Copy link
Member

llvmbot commented Oct 21, 2025

@llvm/pr-subscribers-backend-arm

Author: None (paperchalice)

Changes

These global flags block furthur improvements for clang, users should always use fast-math flags
see also https://discourse.llvm.org/t/rfc-honor-pragmas-with-ffp-contract-fast/80797


Patch is 1.41 MiB, truncated to 20.00 KiB below, full version: https://github.com/llvm/llvm-project/pull/164400.diff

1005 Files Affected:

  • (modified) clang/lib/CodeGen/BackendUtil.cpp (-6)
  • (modified) lld/test/COFF/Inputs/undefined-symbol-lto-a.ll (+2-2)
  • (modified) lld/test/COFF/Inputs/undefined-symbol-lto-b.ll (+1-1)
  • (modified) lld/test/COFF/Inputs/undefined-symbol-multi-lto.ll (+2-2)
  • (modified) lld/test/MachO/lto-mattrs.ll (+1-1)
  • (modified) lld/test/wasm/Inputs/debuginfo1.ll (+3-3)
  • (modified) lld/test/wasm/Inputs/debuginfo2.ll (+1-1)
  • (modified) lld/test/wasm/debug-removed-fn.ll (+1-1)
  • (modified) llvm/docs/CommandGuide/llc.rst (-7)
  • (modified) llvm/docs/CommandGuide/lli.rst (-5)
  • (modified) llvm/docs/SourceLevelDebugging.rst (+1-1)
  • (modified) llvm/include/llvm/CodeGen/CommandFlags.h (-2)
  • (modified) llvm/include/llvm/IR/Attributes.td (-2)
  • (modified) llvm/include/llvm/Target/TargetOptions.h (+2-10)
  • (modified) llvm/lib/CodeGen/CommandFlags.cpp (-9)
  • (modified) llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp (+6-6)
  • (modified) llvm/lib/CodeGen/TargetOptionsImpl.cpp (+1-1)
  • (modified) llvm/lib/Target/TargetMachine.cpp (-1)
  • (modified) llvm/lib/Transforms/Instrumentation/NumericalStabilitySanitizer.cpp (-1)
  • (modified) llvm/test/Analysis/BranchProbabilityInfo/pr22718.ll (+3-3)
  • (modified) llvm/test/Analysis/CostModel/SystemZ/intrinsic-cost-crash.ll (+1-1)
  • (modified) llvm/test/Analysis/Delinearization/constant_functions_multi_dim.ll (+2-2)
  • (modified) llvm/test/Analysis/DependenceAnalysis/MIVCheckConst.ll (+1-1)
  • (modified) llvm/test/Analysis/DependenceAnalysis/NonCanonicalizedSubscript.ll (+1-1)
  • (modified) llvm/test/Analysis/MemoryDependenceAnalysis/invariant.group-bug.ll (+2-2)
  • (modified) llvm/test/Analysis/MemorySSA/pr28880.ll (+1-1)
  • (modified) llvm/test/Analysis/MemorySSA/pr39197.ll (+1-1)
  • (modified) llvm/test/Analysis/MemorySSA/pr40038.ll (+1-1)
  • (modified) llvm/test/Analysis/MemorySSA/pr43569.ll (+1-1)
  • (modified) llvm/test/Analysis/ScalarEvolution/pr22674.ll (+1-1)
  • (modified) llvm/test/Analysis/ScalarEvolution/scev-canonical-mode.ll (+1-1)
  • (modified) llvm/test/Analysis/TypeBasedAliasAnalysis/PR17620.ll (+2-2)
  • (modified) llvm/test/Analysis/TypeBasedAliasAnalysis/tbaa-path.ll (+1-1)
  • (modified) llvm/test/Bitcode/DILocation-implicit-code.ll (+2-2)
  • (modified) llvm/test/Bitcode/drop-debug-info.3.5.ll (+1-1)
  • (modified) llvm/test/Bitcode/upgrade-tbaa.ll (+1-1)
  • (modified) llvm/test/CodeGen/AArch64/GlobalISel/inline-memcpy.mir (+1-1)
  • (modified) llvm/test/CodeGen/AArch64/GlobalISel/inline-memmove.mir (+1-1)
  • (modified) llvm/test/CodeGen/AArch64/GlobalISel/inline-memset.mir (+1-1)
  • (modified) llvm/test/CodeGen/AArch64/aarch64-2014-08-11-MachineCombinerCrash.ll (+1-1)
  • (modified) llvm/test/CodeGen/AArch64/aarch64-a57-fp-load-balancing.ll (+2-2)
  • (modified) llvm/test/CodeGen/AArch64/aarch64-dynamic-stack-layout.ll (+2-2)
  • (modified) llvm/test/CodeGen/AArch64/aarch64-fix-cortex-a53-835769.ll (+2-2)
  • (modified) llvm/test/CodeGen/AArch64/aarch64-mov-debug-locs.mir (+2-2)
  • (modified) llvm/test/CodeGen/AArch64/arm64-detect-vec-redux.ll (+1-1)
  • (modified) llvm/test/CodeGen/AArch64/arm64-fma-combine-with-fpfusion.ll (+1-1)
  • (modified) llvm/test/CodeGen/AArch64/arm64-fma-combines.ll (+1-1)
  • (modified) llvm/test/CodeGen/AArch64/arm64-indexed-vector-ldst-2.ll (+1-1)
  • (modified) llvm/test/CodeGen/AArch64/arm64-misched-basic-A53.ll (+1-1)
  • (modified) llvm/test/CodeGen/AArch64/arm64-misched-basic-A57.ll (+1-1)
  • (modified) llvm/test/CodeGen/AArch64/arm64-rounding.ll (+1-1)
  • (modified) llvm/test/CodeGen/AArch64/arm64-storebytesmerge.ll (+2-2)
  • (modified) llvm/test/CodeGen/AArch64/arm64-triv-disjoint-mem-access.ll (+1-1)
  • (modified) llvm/test/CodeGen/AArch64/bti-branch-relaxation.ll (+1-1)
  • (modified) llvm/test/CodeGen/AArch64/consthoist-gep.ll (+1-1)
  • (modified) llvm/test/CodeGen/AArch64/csel-zero-float.ll (+1-1)
  • (modified) llvm/test/CodeGen/AArch64/dag-combine-invaraints.ll (+2-2)
  • (modified) llvm/test/CodeGen/AArch64/partial-pipeline-execution.ll (+1-1)
  • (modified) llvm/test/CodeGen/AArch64/recp-fastmath.ll (+2-2)
  • (modified) llvm/test/CodeGen/AArch64/stack-tagging-ex-1.ll (+1-1)
  • (modified) llvm/test/CodeGen/AArch64/stack-tagging-ex-2.ll (+2-2)
  • (modified) llvm/test/CodeGen/AArch64/stack-tagging-untag-placement.ll (+1-1)
  • (modified) llvm/test/CodeGen/AArch64/stack_guard_remat.ll (+1-1)
  • (modified) llvm/test/CodeGen/AArch64/svtcf-fmul-fdiv-combine.ll (+1-1)
  • (modified) llvm/test/CodeGen/AArch64/vector_merge_dep_check.ll (+1-1)
  • (modified) llvm/test/CodeGen/AArch64/wineh-frame5.mir (+2-2)
  • (modified) llvm/test/CodeGen/AArch64/wineh-frame6.mir (+2-2)
  • (modified) llvm/test/CodeGen/AArch64/wineh-frame7.mir (+2-2)
  • (modified) llvm/test/CodeGen/AArch64/wineh-frame8.mir (+1-1)
  • (modified) llvm/test/CodeGen/AArch64/wineh5.mir (+2-2)
  • (modified) llvm/test/CodeGen/AArch64/wineh_shrinkwrap.mir (+2-2)
  • (modified) llvm/test/CodeGen/AMDGPU/GlobalISel/combine-fma-unmerge-values.mir (+1-1)
  • (modified) llvm/test/CodeGen/AMDGPU/GlobalISel/inst-select-fract.f64.mir (+2-2)
  • (modified) llvm/test/CodeGen/AMDGPU/combine_andor_with_cmps.ll (+1-1)
  • (modified) llvm/test/CodeGen/AMDGPU/fadd-fma-fmul-combine.ll (+4-4)
  • (modified) llvm/test/CodeGen/AMDGPU/fdiv.f64.ll (+1-1)
  • (modified) llvm/test/CodeGen/AMDGPU/fmad-formation-fmul-distribute-denormal-mode.ll (+1-1)
  • (modified) llvm/test/CodeGen/AMDGPU/fmed3.bf16.ll (+2-2)
  • (modified) llvm/test/CodeGen/AMDGPU/fmed3.ll (+1-1)
  • (modified) llvm/test/CodeGen/AMDGPU/fneg-combines.legal.f16.ll (+1-1)
  • (modified) llvm/test/CodeGen/AMDGPU/fneg-combines.ll (+1-1)
  • (modified) llvm/test/CodeGen/AMDGPU/fpext.f16.ll (+5-5)
  • (modified) llvm/test/CodeGen/AMDGPU/fptosi.f16.ll (+4-4)
  • (modified) llvm/test/CodeGen/AMDGPU/fptoui.f16.ll (+4-4)
  • (modified) llvm/test/CodeGen/AMDGPU/fptrunc.ll (+4-4)
  • (modified) llvm/test/CodeGen/AMDGPU/fract.f64.ll (+2-2)
  • (modified) llvm/test/CodeGen/AMDGPU/fract.ll (+2-2)
  • (modified) llvm/test/CodeGen/AMDGPU/frem.ll (+2-2)
  • (modified) llvm/test/CodeGen/AMDGPU/fsqrt.f64.ll (+1-2)
  • (modified) llvm/test/CodeGen/AMDGPU/fsqrt.r600.ll (+1-1)
  • (modified) llvm/test/CodeGen/AMDGPU/inline-attr.ll (+9-9)
  • (modified) llvm/test/CodeGen/AMDGPU/llvm.exp2.ll (+1-1)
  • (modified) llvm/test/CodeGen/AMDGPU/llvm.log2.ll (+1-1)
  • (modified) llvm/test/CodeGen/AMDGPU/minmax.ll (+1-1)
  • (modified) llvm/test/CodeGen/AMDGPU/prevent-fmul-hoist-ir.ll (+1-1)
  • (modified) llvm/test/CodeGen/AMDGPU/sitofp.f16.ll (+4-4)
  • (modified) llvm/test/CodeGen/AMDGPU/uitofp.f16.ll (+4-4)
  • (modified) llvm/test/CodeGen/ARM/2014-05-14-DwarfEHCrash.ll (+1-1)
  • (modified) llvm/test/CodeGen/ARM/ARMLoadStoreDBG.mir (+2-2)
  • (modified) llvm/test/CodeGen/ARM/Windows/wineh-basic.ll (+2-2)
  • (modified) llvm/test/CodeGen/ARM/byval_load_align.ll (+2-2)
  • (modified) llvm/test/CodeGen/ARM/cfguard-module-flag.ll (+1-1)
  • (modified) llvm/test/CodeGen/ARM/clang-section.ll (+2-2)
  • (modified) llvm/test/CodeGen/ARM/cmse-clear-float-bigend.mir (+1-1)
  • (modified) llvm/test/CodeGen/ARM/coalesce-dbgvalue.ll (+2-2)
  • (modified) llvm/test/CodeGen/ARM/constantpool-promote-dbg.ll (+1-1)
  • (modified) llvm/test/CodeGen/ARM/constantpool-promote.ll (+2-2)
  • (modified) llvm/test/CodeGen/ARM/early-cfi-sections.ll (+1-1)
  • (modified) llvm/test/CodeGen/ARM/fp16-vld.ll (+1-1)
  • (modified) llvm/test/CodeGen/ARM/global-merge-1.ll (+3-3)
  • (modified) llvm/test/CodeGen/ARM/isel-v8i32-crash.ll (+1-1)
  • (modified) llvm/test/CodeGen/ARM/out-of-registers.ll (+1-1)
  • (modified) llvm/test/CodeGen/ARM/relax-per-target-feature.ll (+1-1)
  • (modified) llvm/test/CodeGen/ARM/softfp-constant-comparison.ll (+1-1)
  • (modified) llvm/test/CodeGen/ARM/stack-protector-bmovpcb_call.ll (+2-2)
  • (modified) llvm/test/CodeGen/ARM/stack_guard_remat.ll (+1-1)
  • (modified) llvm/test/CodeGen/ARM/struct-byval-frame-index.ll (+1-1)
  • (modified) llvm/test/CodeGen/ARM/subtarget-align.ll (+1-1)
  • (modified) llvm/test/CodeGen/ARM/unschedule-first-call.ll (+1-1)
  • (modified) llvm/test/CodeGen/ARM/vector-spilling.ll (+1-1)
  • (modified) llvm/test/CodeGen/ARM/vldm-sched-a9.ll (+1-1)
  • (modified) llvm/test/CodeGen/BPF/BTF/binary-format.ll (+1-1)
  • (modified) llvm/test/CodeGen/BPF/BTF/builtin-btf-type-id.ll (+1-1)
  • (modified) llvm/test/CodeGen/BPF/BTF/char-no-debuginfo.ll (+1-1)
  • (modified) llvm/test/CodeGen/BPF/BTF/extern-builtin.ll (+1-1)
  • (modified) llvm/test/CodeGen/BPF/BTF/extern-func-arg.ll (+2-2)
  • (modified) llvm/test/CodeGen/BPF/BTF/extern-global-var.ll (+1-1)
  • (modified) llvm/test/CodeGen/BPF/BTF/extern-var-func-weak-section.ll (+2-2)
  • (modified) llvm/test/CodeGen/BPF/BTF/extern-var-func-weak.ll (+2-2)
  • (modified) llvm/test/CodeGen/BPF/BTF/extern-var-func.ll (+2-2)
  • (modified) llvm/test/CodeGen/BPF/BTF/extern-var-section.ll (+2-2)
  • (modified) llvm/test/CodeGen/BPF/BTF/extern-var-struct-weak.ll (+1-1)
  • (modified) llvm/test/CodeGen/BPF/BTF/extern-var-struct.ll (+1-1)
  • (modified) llvm/test/CodeGen/BPF/BTF/extern-var-weak-section.ll (+2-2)
  • (modified) llvm/test/CodeGen/BPF/BTF/filename.ll (+1-1)
  • (modified) llvm/test/CodeGen/BPF/BTF/func-func-ptr.ll (+1-1)
  • (modified) llvm/test/CodeGen/BPF/BTF/func-non-void.ll (+1-1)
  • (modified) llvm/test/CodeGen/BPF/BTF/func-source.ll (+1-1)
  • (modified) llvm/test/CodeGen/BPF/BTF/func-typedef.ll (+1-1)
  • (modified) llvm/test/CodeGen/BPF/BTF/func-unused-arg.ll (+1-1)
  • (modified) llvm/test/CodeGen/BPF/BTF/func-void.ll (+1-1)
  • (modified) llvm/test/CodeGen/BPF/BTF/local-var-readonly-1.ll (+2-2)
  • (modified) llvm/test/CodeGen/BPF/BTF/local-var-readonly-2.ll (+2-2)
  • (modified) llvm/test/CodeGen/BPF/BTF/local-var.ll (+1-1)
  • (modified) llvm/test/CodeGen/BPF/BTF/pruning-const.ll (+2-2)
  • (modified) llvm/test/CodeGen/BPF/BTF/pruning-typedef.ll (+2-2)
  • (modified) llvm/test/CodeGen/BPF/BTF/static-func.ll (+3-3)
  • (modified) llvm/test/CodeGen/BPF/BTF/static-var-derived-type.ll (+1-1)
  • (modified) llvm/test/CodeGen/BPF/BTF/static-var-inited-sec.ll (+1-1)
  • (modified) llvm/test/CodeGen/BPF/BTF/static-var-inited.ll (+1-1)
  • (modified) llvm/test/CodeGen/BPF/BTF/static-var-readonly-sec.ll (+1-1)
  • (modified) llvm/test/CodeGen/BPF/BTF/static-var-readonly.ll (+1-1)
  • (modified) llvm/test/CodeGen/BPF/BTF/static-var-sec.ll (+1-1)
  • (modified) llvm/test/CodeGen/BPF/BTF/static-var-zerolen-array.ll (+1-1)
  • (modified) llvm/test/CodeGen/BPF/BTF/static-var.ll (+1-1)
  • (modified) llvm/test/CodeGen/BPF/BTF/struct-anon-2.ll (+1-1)
  • (modified) llvm/test/CodeGen/BPF/BTF/weak-global-2.ll (+1-1)
  • (modified) llvm/test/CodeGen/BPF/BTF/weak-global.ll (+1-1)
  • (modified) llvm/test/CodeGen/BPF/CORE/btf-id-duplicate.ll (+1-1)
  • (modified) llvm/test/CodeGen/BPF/CORE/field-reloc-alu32.ll (+1-1)
  • (modified) llvm/test/CodeGen/BPF/CORE/field-reloc-bitfield-1-bpfeb.ll (+1-1)
  • (modified) llvm/test/CodeGen/BPF/CORE/field-reloc-bitfield-1.ll (+1-1)
  • (modified) llvm/test/CodeGen/BPF/CORE/field-reloc-bitfield-2-bpfeb.ll (+1-1)
  • (modified) llvm/test/CodeGen/BPF/CORE/field-reloc-bitfield-2.ll (+1-1)
  • (modified) llvm/test/CodeGen/BPF/CORE/field-reloc-duplicate.ll (+1-1)
  • (modified) llvm/test/CodeGen/BPF/CORE/intrinsic-array-2.ll (+1-1)
  • (modified) llvm/test/CodeGen/BPF/CORE/intrinsic-array.ll (+2-2)
  • (modified) llvm/test/CodeGen/BPF/CORE/intrinsic-fieldinfo-byte-size-1.ll (+1-1)
  • (modified) llvm/test/CodeGen/BPF/CORE/intrinsic-fieldinfo-byte-size-2.ll (+1-1)
  • (modified) llvm/test/CodeGen/BPF/CORE/intrinsic-fieldinfo-byte-size-3.ll (+1-1)
  • (modified) llvm/test/CodeGen/BPF/CORE/intrinsic-fieldinfo-byte-size-4.ll (+1-1)
  • (modified) llvm/test/CodeGen/BPF/CORE/intrinsic-fieldinfo-existence-1.ll (+1-1)
  • (modified) llvm/test/CodeGen/BPF/CORE/intrinsic-fieldinfo-existence-2.ll (+1-1)
  • (modified) llvm/test/CodeGen/BPF/CORE/intrinsic-fieldinfo-existence-3.ll (+1-1)
  • (modified) llvm/test/CodeGen/BPF/CORE/intrinsic-fieldinfo-lshift-1-bpfeb.ll (+1-1)
  • (modified) llvm/test/CodeGen/BPF/CORE/intrinsic-fieldinfo-lshift-1.ll (+1-1)
  • (modified) llvm/test/CodeGen/BPF/CORE/intrinsic-fieldinfo-lshift-2.ll (+1-1)
  • (modified) llvm/test/CodeGen/BPF/CORE/intrinsic-fieldinfo-rshift-1.ll (+1-1)
  • (modified) llvm/test/CodeGen/BPF/CORE/intrinsic-fieldinfo-rshift-2.ll (+1-1)
  • (modified) llvm/test/CodeGen/BPF/CORE/intrinsic-fieldinfo-rshift-3.ll (+1-1)
  • (modified) llvm/test/CodeGen/BPF/CORE/intrinsic-fieldinfo-signedness-1.ll (+1-1)
  • (modified) llvm/test/CodeGen/BPF/CORE/intrinsic-fieldinfo-signedness-2.ll (+1-1)
  • (modified) llvm/test/CodeGen/BPF/CORE/intrinsic-fieldinfo-signedness-3.ll (+1-1)
  • (modified) llvm/test/CodeGen/BPF/CORE/intrinsic-struct.ll (+2-2)
  • (modified) llvm/test/CodeGen/BPF/CORE/intrinsic-typeinfo-enum-value.ll (+1-1)
  • (modified) llvm/test/CodeGen/BPF/CORE/intrinsic-typeinfo-type-exist.ll (+1-1)
  • (modified) llvm/test/CodeGen/BPF/CORE/intrinsic-typeinfo-type-size-1.ll (+1-1)
  • (modified) llvm/test/CodeGen/BPF/CORE/intrinsic-typeinfo-type-size-2.ll (+1-1)
  • (modified) llvm/test/CodeGen/BPF/CORE/intrinsic-union.ll (+2-2)
  • (modified) llvm/test/CodeGen/BPF/CORE/no-elf-ama-symbol.ll (+1-1)
  • (modified) llvm/test/CodeGen/BPF/CORE/no-narrow-load.ll (+2-2)
  • (modified) llvm/test/CodeGen/BPF/CORE/offset-reloc-access-str.ll (+2-2)
  • (modified) llvm/test/CodeGen/BPF/CORE/offset-reloc-basic.ll (+1-1)
  • (modified) llvm/test/CodeGen/BPF/CORE/offset-reloc-cast-array-1.ll (+2-2)
  • (modified) llvm/test/CodeGen/BPF/CORE/offset-reloc-cast-array-2.ll (+2-2)
  • (modified) llvm/test/CodeGen/BPF/CORE/offset-reloc-cast-struct-1.ll (+2-2)
  • (modified) llvm/test/CodeGen/BPF/CORE/offset-reloc-cast-struct-2.ll (+2-2)
  • (modified) llvm/test/CodeGen/BPF/CORE/offset-reloc-cast-struct-3.ll (+2-2)
  • (modified) llvm/test/CodeGen/BPF/CORE/offset-reloc-cast-union-1.ll (+2-2)
  • (modified) llvm/test/CodeGen/BPF/CORE/offset-reloc-cast-union-2.ll (+2-2)
  • (modified) llvm/test/CodeGen/BPF/CORE/offset-reloc-end-load.ll (+1-1)
  • (modified) llvm/test/CodeGen/BPF/CORE/offset-reloc-end-ret.ll (+1-1)
  • (modified) llvm/test/CodeGen/BPF/CORE/offset-reloc-fieldinfo-1.ll (+2-2)
  • (modified) llvm/test/CodeGen/BPF/CORE/offset-reloc-fieldinfo-2-bpfeb.ll (+1-1)
  • (modified) llvm/test/CodeGen/BPF/CORE/offset-reloc-fieldinfo-2.ll (+1-1)
  • (modified) llvm/test/CodeGen/BPF/CORE/offset-reloc-global-1.ll (+2-2)
  • (modified) llvm/test/CodeGen/BPF/CORE/offset-reloc-global-2.ll (+2-2)
  • (modified) llvm/test/CodeGen/BPF/CORE/offset-reloc-global-3.ll (+2-2)
  • (modified) llvm/test/CodeGen/BPF/CORE/offset-reloc-ignore.ll (+2-2)
  • (modified) llvm/test/CodeGen/BPF/CORE/offset-reloc-middle-chain.ll (+2-2)
  • (modified) llvm/test/CodeGen/BPF/CORE/offset-reloc-multi-array-1.ll (+2-2)
  • (modified) llvm/test/CodeGen/BPF/CORE/offset-reloc-multi-array-2.ll (+2-2)
  • (modified) llvm/test/CodeGen/BPF/CORE/offset-reloc-multilevel.ll (+1-1)
  • (modified) llvm/test/CodeGen/BPF/CORE/offset-reloc-pointer-1.ll (+2-2)
  • (modified) llvm/test/CodeGen/BPF/CORE/offset-reloc-pointer-2.ll (+2-2)
  • (modified) llvm/test/CodeGen/BPF/CORE/offset-reloc-struct-anonymous.ll (+1-1)
  • (modified) llvm/test/CodeGen/BPF/CORE/offset-reloc-struct-array.ll (+1-1)
  • (modified) llvm/test/CodeGen/BPF/CORE/offset-reloc-typedef-array.ll (+2-2)
  • (modified) llvm/test/CodeGen/BPF/CORE/offset-reloc-typedef-struct-2.ll (+1-1)
  • (modified) llvm/test/CodeGen/BPF/CORE/offset-reloc-typedef-struct.ll (+2-2)
  • (modified) llvm/test/CodeGen/BPF/CORE/offset-reloc-typedef-union-2.ll (+1-1)
  • (modified) llvm/test/CodeGen/BPF/CORE/offset-reloc-typedef-union.ll (+2-2)
  • (modified) llvm/test/CodeGen/BPF/CORE/offset-reloc-typedef.ll (+2-2)
  • (modified) llvm/test/CodeGen/BPF/CORE/offset-reloc-union.ll (+1-1)
  • (modified) llvm/test/CodeGen/BPF/CORE/store-addr.ll (+2-2)
  • (modified) llvm/test/CodeGen/BPF/adjust-opt-icmp1.ll (+2-2)
  • (modified) llvm/test/CodeGen/BPF/adjust-opt-icmp2.ll (+2-2)
  • (modified) llvm/test/CodeGen/BPF/adjust-opt-speculative1.ll (+2-2)
  • (modified) llvm/test/CodeGen/BPF/adjust-opt-speculative2.ll (+2-2)
  • (modified) llvm/test/CodeGen/BPF/callx.ll (+1-1)
  • (modified) llvm/test/CodeGen/BPF/dwarfdump.ll (+1-1)
  • (modified) llvm/test/CodeGen/BPF/i128.ll (+2-2)
  • (modified) llvm/test/CodeGen/BPF/is_trunc_free.ll (+2-2)
  • (modified) llvm/test/CodeGen/BPF/is_zext_free.ll (+1-1)
  • (modified) llvm/test/CodeGen/BPF/objdump_two_funcs.ll (+1-1)
  • (modified) llvm/test/CodeGen/BPF/optnone-1.ll (+1-1)
  • (modified) llvm/test/CodeGen/BPF/reloc-btf-2.ll (+1-1)
  • (modified) llvm/test/CodeGen/BPF/reloc-btf.ll (+1-1)
  • (modified) llvm/test/CodeGen/BPF/simplifycfg.ll (+2-2)
  • (modified) llvm/test/CodeGen/BPF/warn-stack.ll (+2-2)
  • (modified) llvm/test/CodeGen/BPF/xadd.ll (+1-1)
  • (modified) llvm/test/CodeGen/Generic/cfi-sections.ll (+2-2)
  • (modified) llvm/test/CodeGen/Hexagon/NVJumpCmp.ll (+1-1)
  • (modified) llvm/test/CodeGen/Hexagon/addh-sext-trunc.ll (+1-1)
  • (modified) llvm/test/CodeGen/Hexagon/alu64.ll (+1-1)
  • (modified) llvm/test/CodeGen/Hexagon/autohvx/fsplat.ll (+1-1)
  • (modified) llvm/test/CodeGen/Hexagon/autohvx/hfinsert.ll (+1-1)
  • (modified) llvm/test/CodeGen/Hexagon/autohvx/hfnosplat_cp.ll (+1-1)
  • (modified) llvm/test/CodeGen/Hexagon/autohvx/hfsplat.ll (+1-1)
  • (modified) llvm/test/CodeGen/Hexagon/base-offset-addr.ll (+1-1)
  • (modified) llvm/test/CodeGen/Hexagon/base-offset-post.ll (+1-1)
  • (modified) llvm/test/CodeGen/Hexagon/bit-loop-rc-mismatch.ll (+2-2)
  • (modified) llvm/test/CodeGen/Hexagon/bit-rie.ll (+1-1)
  • (modified) llvm/test/CodeGen/Hexagon/builtin-prefetch.ll (+1-1)
  • (modified) llvm/test/CodeGen/Hexagon/cfi-offset.ll (+1-1)
  • (modified) llvm/test/CodeGen/Hexagon/cmp-extend.ll (+1-1)
  • (modified) llvm/test/CodeGen/Hexagon/cmp.ll (+1-1)
  • (modified) llvm/test/CodeGen/Hexagon/constp-combine-neg.ll (+1-1)
  • (modified) llvm/test/CodeGen/Hexagon/constp-extract.ll (+1-1)
  • (modified) llvm/test/CodeGen/Hexagon/constp-physreg.ll (+1-1)
  • (modified) llvm/test/CodeGen/Hexagon/dead-store-stack.ll (+2-2)
  • (modified) llvm/test/CodeGen/Hexagon/early-if-conversion-bug1.ll (+2-2)
  • (modified) llvm/test/CodeGen/Hexagon/fminmax.ll (+1-1)
  • (modified) llvm/test/CodeGen/Hexagon/hexagon_vector_loop_carried_reuse.ll (+1-1)
  • (modified) llvm/test/CodeGen/Hexagon/hexagon_vector_loop_carried_reuse_constant.ll (+1-1)
  • (modified) llvm/test/CodeGen/Hexagon/hwloop-crit-edge.ll (+1-1)
  • (modified) llvm/test/CodeGen/Hexagon/hwloop-preheader.ll (+1-1)
  • (modified) llvm/test/CodeGen/Hexagon/intrinsics-v67.ll (+1-1)
  • (modified) llvm/test/CodeGen/Hexagon/jt-in-text.ll (+1-1)
  • (modified) llvm/test/CodeGen/Hexagon/ldst_vector_offset.ll (+1-1)
  • (modified) llvm/test/CodeGen/Hexagon/loopIdiom.ll (+1-1)
  • (modified) llvm/test/CodeGen/Hexagon/loop_align_count.ll (+1-1)
  • (modified) llvm/test/CodeGen/Hexagon/mem-fi-add.ll (+2-2)
  • (modified) llvm/test/CodeGen/Hexagon/memops-stack.ll (+2-2)
  • (modified) llvm/test/CodeGen/Hexagon/pic-regusage.ll (+1-1)
  • (modified) llvm/test/CodeGen/Hexagon/postinc-offset.ll (+1-1)
  • (modified) llvm/test/CodeGen/Hexagon/rdf-dead-loop.ll (+1-1)
  • (modified) llvm/test/CodeGen/Hexagon/rdf-inline-asm-fixed.ll (+1-1)
  • (modified) llvm/test/CodeGen/Hexagon/rdf-inline-asm.ll (+1-1)
  • (modified) llvm/test/CodeGen/Hexagon/reg-scavengebug-3.ll (+2-2)
  • (modified) llvm/test/CodeGen/Hexagon/runtime-stkchk.ll (+2-2)
  • (modified) llvm/test/CodeGen/Hexagon/sdr-shr32.ll (+1-1)
  • (modified) llvm/test/CodeGen/Hexagon/switch-lut-explicit-section.ll (+1-1)
  • (modified) llvm/test/CodeGen/Hexagon/switch-lut-function-section.ll (+1-1)
  • (modified) llvm/test/CodeGen/Hexagon/switch-lut-multiple-functions.ll (+1-1)
  • (modified) llvm/test/CodeGen/Hexagon/switch-lut-text-section.ll (+1-1)
  • (modified) llvm/test/CodeGen/Hexagon/swp-epilog-phi10.ll (+1-1)
  • (modified) llvm/test/CodeGen/Hexagon/swp-phi.ll (+1-1)
  • (modified) llvm/test/CodeGen/Hexagon/swp-pragma-disable-bug.ll (+1-1)
  • (modified) llvm/test/CodeGen/Hexagon/swp-prolog-phi4.ll (+1-1)
  • (modified) llvm/test/CodeGen/Hexagon/swp-stages4.ll (+1-1)
  • (modified) llvm/test/CodeGen/Hexagon/usr-ovf-dep.ll (+1-1)
  • (modified) llvm/test/CodeGen/Hexagon/v6-haar-balign32.ll (+1-1)
  • (modified) llvm/test/CodeGen/Hexagon/v60Intrins.ll (+1-1)
  • (modified) llvm/test/CodeGen/Hexagon/v60small.ll (+1-1)
  • (modified) llvm/test/CodeGen/Hexagon/v6vec-vprint.ll (+1-1)
  • (modified) llvm/test/CodeGen/Hexagon/vec-pred-spill1.ll (+2-2)
  • (modified) llvm/test/CodeGen/Hexagon/vect-regpairs.ll (+1-1)
diff --git a/clang/lib/CodeGen/BackendUtil.cpp b/clang/lib/CodeGen/BackendUtil.cpp
index 602068436101b..ecfbcb5970092 100644
--- a/clang/lib/CodeGen/BackendUtil.cpp
+++ b/clang/lib/CodeGen/BackendUtil.cpp
@@ -430,12 +430,6 @@ static bool initTargetOptions(const CompilerInstance &CI,
   Options.NoInfsFPMath = LangOpts.NoHonorInfs;
   Options.NoNaNsFPMath = LangOpts.NoHonorNaNs;
   Options.NoZerosInBSS = CodeGenOpts.NoZeroInitializedInBSS;
-  Options.UnsafeFPMath = LangOpts.AllowFPReassoc && LangOpts.AllowRecip &&
-                         LangOpts.NoSignedZero && LangOpts.ApproxFunc &&
-                         (LangOpts.getDefaultFPContractMode() ==
-                              LangOptions::FPModeKind::FPM_Fast ||
-                          LangOpts.getDefaultFPContractMode() ==
-                              LangOptions::FPModeKind::FPM_FastHonorPragmas);
 
   Options.BBAddrMap = CodeGenOpts.BBAddrMap;
   Options.BBSections =
diff --git a/lld/test/COFF/Inputs/undefined-symbol-lto-a.ll b/lld/test/COFF/Inputs/undefined-symbol-lto-a.ll
index 7e29044ebe00d..f57a3e3c1ede4 100644
--- a/lld/test/COFF/Inputs/undefined-symbol-lto-a.ll
+++ b/lld/test/COFF/Inputs/undefined-symbol-lto-a.ll
@@ -47,8 +47,8 @@ entry:
   ret void
 }
 
-attributes #0 = { "correctly-rounded-divide-sqrt-fp-math"="false" "disable-tail-calls"="false" "less-precise-fpmad"="false" "frame-pointer"="none" "no-infs-fp-math"="false" "no-nans-fp-math"="false" "no-signed-zeros-fp-math"="false" "no-trapping-math"="false" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "unsafe-fp-math"="false" "use-soft-float"="false" }
-attributes #1 = { nounwind sspstrong uwtable "correctly-rounded-divide-sqrt-fp-math"="false" "disable-tail-calls"="false" "less-precise-fpmad"="false" "min-legal-vector-width"="0" "frame-pointer"="none" "no-infs-fp-math"="false" "no-jump-tables"="false" "no-nans-fp-math"="false" "no-signed-zeros-fp-math"="false" "no-trapping-math"="false" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "unsafe-fp-math"="false" "use-soft-float"="false" }
+attributes #0 = { "correctly-rounded-divide-sqrt-fp-math"="false" "disable-tail-calls"="false" "less-precise-fpmad"="false" "frame-pointer"="none" "no-infs-fp-math"="false" "no-nans-fp-math"="false" "no-signed-zeros-fp-math"="false" "no-trapping-math"="false" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "use-soft-float"="false" }
+attributes #1 = { nounwind sspstrong uwtable "correctly-rounded-divide-sqrt-fp-math"="false" "disable-tail-calls"="false" "less-precise-fpmad"="false" "min-legal-vector-width"="0" "frame-pointer"="none" "no-infs-fp-math"="false" "no-jump-tables"="false" "no-nans-fp-math"="false" "no-signed-zeros-fp-math"="false" "no-trapping-math"="false" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "use-soft-float"="false" }
 attributes #2 = { nounwind }
 
 !llvm.linker.options = !{!1, !2}
diff --git a/lld/test/COFF/Inputs/undefined-symbol-lto-b.ll b/lld/test/COFF/Inputs/undefined-symbol-lto-b.ll
index 0f64e236a1f47..7347fde7a9dee 100644
--- a/lld/test/COFF/Inputs/undefined-symbol-lto-b.ll
+++ b/lld/test/COFF/Inputs/undefined-symbol-lto-b.ll
@@ -11,7 +11,7 @@ entry:
   ret void
 }
 
-attributes #0 = { norecurse nounwind readnone sspstrong uwtable "correctly-rounded-divide-sqrt-fp-math"="false" "disable-tail-calls"="false" "less-precise-fpmad"="false" "min-legal-vector-width"="0" "frame-pointer"="none" "no-infs-fp-math"="false" "no-jump-tables"="false" "no-nans-fp-math"="false" "no-signed-zeros-fp-math"="false" "no-trapping-math"="false" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "unsafe-fp-math"="false" "use-soft-float"="false" }
+attributes #0 = { norecurse nounwind readnone sspstrong uwtable "correctly-rounded-divide-sqrt-fp-math"="false" "disable-tail-calls"="false" "less-precise-fpmad"="false" "min-legal-vector-width"="0" "frame-pointer"="none" "no-infs-fp-math"="false" "no-jump-tables"="false" "no-nans-fp-math"="false" "no-signed-zeros-fp-math"="false" "no-trapping-math"="false" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "use-soft-float"="false" }
 
 !llvm.linker.options = !{!0, !1}
 !llvm.module.flags = !{!2, !3, !4, !5}
diff --git a/lld/test/COFF/Inputs/undefined-symbol-multi-lto.ll b/lld/test/COFF/Inputs/undefined-symbol-multi-lto.ll
index 5f6730272e610..61828cae7ea58 100644
--- a/lld/test/COFF/Inputs/undefined-symbol-multi-lto.ll
+++ b/lld/test/COFF/Inputs/undefined-symbol-multi-lto.ll
@@ -13,8 +13,8 @@ declare dso_local i32 @"?foo@@YAHXZ"() #1
 
 declare dso_local i32 @"?bar@@YAHXZ"() #1
 
-attributes #0 = { noinline optnone uwtable "correctly-rounded-divide-sqrt-fp-math"="false" "disable-tail-calls"="false" "frame-pointer"="all" "less-precise-fpmad"="false" "min-legal-vector-width"="0" "no-infs-fp-math"="false" "no-jump-tables"="false" "no-nans-fp-math"="false" "no-signed-zeros-fp-math"="false" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "unsafe-fp-math"="false" "use-soft-float"="false" }
-attributes #1 = { "correctly-rounded-divide-sqrt-fp-math"="false" "disable-tail-calls"="false" "frame-pointer"="all" "less-precise-fpmad"="false" "no-infs-fp-math"="false" "no-nans-fp-math"="false" "no-signed-zeros-fp-math"="false" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "unsafe-fp-math"="false" "use-soft-float"="false" }
+attributes #0 = { noinline optnone uwtable "correctly-rounded-divide-sqrt-fp-math"="false" "disable-tail-calls"="false" "frame-pointer"="all" "less-precise-fpmad"="false" "min-legal-vector-width"="0" "no-infs-fp-math"="false" "no-jump-tables"="false" "no-nans-fp-math"="false" "no-signed-zeros-fp-math"="false" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "use-soft-float"="false" }
+attributes #1 = { "correctly-rounded-divide-sqrt-fp-math"="false" "disable-tail-calls"="false" "frame-pointer"="all" "less-precise-fpmad"="false" "no-infs-fp-math"="false" "no-nans-fp-math"="false" "no-signed-zeros-fp-math"="false" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "use-soft-float"="false" }
 
 !llvm.module.flags = !{!0}
 !llvm.ident = !{!1}
diff --git a/lld/test/MachO/lto-mattrs.ll b/lld/test/MachO/lto-mattrs.ll
index f658b485a1792..41313296dc269 100644
--- a/lld/test/MachO/lto-mattrs.ll
+++ b/lld/test/MachO/lto-mattrs.ll
@@ -33,4 +33,4 @@ define float @foo(float %x) #0 {
   ret float %div
 }
 
-attributes #0 = { "unsafe-fp-math"="true" "reciprocal-estimates"="divf,vec-divf" }
+attributes #0 = { "reciprocal-estimates"="divf,vec-divf" }
diff --git a/lld/test/wasm/Inputs/debuginfo1.ll b/lld/test/wasm/Inputs/debuginfo1.ll
index d6db88002ce1e..0a1c42a214f2c 100644
--- a/lld/test/wasm/Inputs/debuginfo1.ll
+++ b/lld/test/wasm/Inputs/debuginfo1.ll
@@ -35,9 +35,9 @@ declare void @foo(i32) local_unnamed_addr #2
 ; Function Attrs: nounwind readnone speculatable
 declare void @llvm.dbg.value(metadata, metadata, metadata) #3
 
-attributes #0 = { nounwind readnone "correctly-rounded-divide-sqrt-fp-math"="false" "disable-tail-calls"="false" "less-precise-fpmad"="false" "frame-pointer"="none" "no-infs-fp-math"="false" "no-jump-tables"="false" "no-nans-fp-math"="false" "no-signed-zeros-fp-math"="false" "no-trapping-math"="false" "stack-protector-buffer-size"="8" "target-cpu"="generic" "unsafe-fp-math"="false" "use-soft-float"="false" }
-attributes #1 = { nounwind "correctly-rounded-divide-sqrt-fp-math"="false" "disable-tail-calls"="false" "less-precise-fpmad"="false" "frame-pointer"="none" "no-infs-fp-math"="false" "no-jump-tables"="false" "no-nans-fp-math"="false" "no-signed-zeros-fp-math"="false" "no-trapping-math"="false" "stack-protector-buffer-size"="8" "target-cpu"="generic" "unsafe-fp-math"="false" "use-soft-float"="false" }
-attributes #2 = { "correctly-rounded-divide-sqrt-fp-math"="false" "disable-tail-calls"="false" "less-precise-fpmad"="false" "frame-pointer"="none" "no-infs-fp-math"="false" "no-nans-fp-math"="false" "no-signed-zeros-fp-math"="false" "no-trapping-math"="false" "stack-protector-buffer-size"="8" "target-cpu"="generic" "unsafe-fp-math"="false" "use-soft-float"="false" }
+attributes #0 = { nounwind readnone "correctly-rounded-divide-sqrt-fp-math"="false" "disable-tail-calls"="false" "less-precise-fpmad"="false" "frame-pointer"="none" "no-infs-fp-math"="false" "no-jump-tables"="false" "no-nans-fp-math"="false" "no-signed-zeros-fp-math"="false" "no-trapping-math"="false" "stack-protector-buffer-size"="8" "target-cpu"="generic" "use-soft-float"="false" }
+attributes #1 = { nounwind "correctly-rounded-divide-sqrt-fp-math"="false" "disable-tail-calls"="false" "less-precise-fpmad"="false" "frame-pointer"="none" "no-infs-fp-math"="false" "no-jump-tables"="false" "no-nans-fp-math"="false" "no-signed-zeros-fp-math"="false" "no-trapping-math"="false" "stack-protector-buffer-size"="8" "target-cpu"="generic" "use-soft-float"="false" }
+attributes #2 = { "correctly-rounded-divide-sqrt-fp-math"="false" "disable-tail-calls"="false" "less-precise-fpmad"="false" "frame-pointer"="none" "no-infs-fp-math"="false" "no-nans-fp-math"="false" "no-signed-zeros-fp-math"="false" "no-trapping-math"="false" "stack-protector-buffer-size"="8" "target-cpu"="generic" "use-soft-float"="false" }
 attributes #3 = { nounwind readnone speculatable }
 attributes #4 = { nounwind }
 
diff --git a/lld/test/wasm/Inputs/debuginfo2.ll b/lld/test/wasm/Inputs/debuginfo2.ll
index 1b63dd57474e5..c832be521e325 100644
--- a/lld/test/wasm/Inputs/debuginfo2.ll
+++ b/lld/test/wasm/Inputs/debuginfo2.ll
@@ -31,7 +31,7 @@ entry:
 ; Function Attrs: nounwind readnone speculatable
 declare void @llvm.dbg.value(metadata, metadata, metadata) #1
 
-attributes #0 = { nounwind "correctly-rounded-divide-sqrt-fp-math"="false" "disable-tail-calls"="false" "less-precise-fpmad"="false" "frame-pointer"="none" "no-infs-fp-math"="false" "no-jump-tables"="false" "no-nans-fp-math"="false" "no-signed-zeros-fp-math"="false" "no-trapping-math"="false" "stack-protector-buffer-size"="8" "target-cpu"="generic" "unsafe-fp-math"="false" "use-soft-float"="false" }
+attributes #0 = { nounwind "correctly-rounded-divide-sqrt-fp-math"="false" "disable-tail-calls"="false" "less-precise-fpmad"="false" "frame-pointer"="none" "no-infs-fp-math"="false" "no-jump-tables"="false" "no-nans-fp-math"="false" "no-signed-zeros-fp-math"="false" "no-trapping-math"="false" "stack-protector-buffer-size"="8" "target-cpu"="generic" "use-soft-float"="false" }
 attributes #1 = { nounwind readnone speculatable }
 
 !llvm.dbg.cu = !{!2}
diff --git a/lld/test/wasm/debug-removed-fn.ll b/lld/test/wasm/debug-removed-fn.ll
index 8dae48a136dc4..20c30346cc0e7 100644
--- a/lld/test/wasm/debug-removed-fn.ll
+++ b/lld/test/wasm/debug-removed-fn.ll
@@ -28,7 +28,7 @@ entry:
   ret i32 6, !dbg !13
 }
 
-attributes #0 = { noinline nounwind optnone "correctly-rounded-divide-sqrt-fp-math"="false" "disable-tail-calls"="false" "less-precise-fpmad"="false" "frame-pointer"="none" "no-infs-fp-math"="false" "no-jump-tables"="false" "no-nans-fp-math"="false" "no-signed-zeros-fp-math"="false" "no-trapping-math"="false" "stack-protector-buffer-size"="8" "target-cpu"="generic" "unsafe-fp-math"="false" "use-soft-float"="false" }
+attributes #0 = { noinline nounwind optnone "correctly-rounded-divide-sqrt-fp-math"="false" "disable-tail-calls"="false" "less-precise-fpmad"="false" "frame-pointer"="none" "no-infs-fp-math"="false" "no-jump-tables"="false" "no-nans-fp-math"="false" "no-signed-zeros-fp-math"="false" "no-trapping-math"="false" "stack-protector-buffer-size"="8" "target-cpu"="generic" "use-soft-float"="false" }
 
 !llvm.dbg.cu = !{!0}
 !llvm.module.flags = !{!3, !4, !5}
diff --git a/llvm/docs/CommandGuide/llc.rst b/llvm/docs/CommandGuide/llc.rst
index 900649f59c401..cc670f6043656 100644
--- a/llvm/docs/CommandGuide/llc.rst
+++ b/llvm/docs/CommandGuide/llc.rst
@@ -125,13 +125,6 @@ End-user Options
 
  Enable setting the FP exceptions build attribute not to use exceptions.
 
-.. option:: --enable-unsafe-fp-math
-
- Enable optimizations that make unsafe assumptions about IEEE math (e.g. that
- addition is associative) or may not work for all input ranges.  These
- optimizations allow the code generator to make use of some instructions which
- would otherwise not be usable (such as ``fsin`` on X86).
-
 .. option:: --stats
 
  Print statistics recorded by code-generation passes.
diff --git a/llvm/docs/CommandGuide/lli.rst b/llvm/docs/CommandGuide/lli.rst
index 94c001380441f..8afe10db05d48 100644
--- a/llvm/docs/CommandGuide/lli.rst
+++ b/llvm/docs/CommandGuide/lli.rst
@@ -107,11 +107,6 @@ FLOATING POINT OPTIONS
 
  Enable optimizations that assume no NAN values.
 
-.. option:: -enable-unsafe-fp-math
-
- Causes :program:`lli` to enable optimizations that may decrease floating point
- precision.
-
 .. option:: -soft-float
 
  Causes :program:`lli` to generate software floating point library calls instead of
diff --git a/llvm/docs/SourceLevelDebugging.rst b/llvm/docs/SourceLevelDebugging.rst
index f057b2d2d2e36..12b5e3e549df7 100644
--- a/llvm/docs/SourceLevelDebugging.rst
+++ b/llvm/docs/SourceLevelDebugging.rst
@@ -674,7 +674,7 @@ Compiled to LLVM, this function would be represented like this:
     ret void, !dbg !24
   }
 
-  attributes #0 = { nounwind ssp uwtable "less-precise-fpmad"="false" "frame-pointer"="all" "no-infs-fp-math"="false" "no-nans-fp-math"="false" "stack-protector-buffer-size"="8" "unsafe-fp-math"="false" "use-soft-float"="false" }
+  attributes #0 = { nounwind ssp uwtable "less-precise-fpmad"="false" "frame-pointer"="all" "no-infs-fp-math"="false" "no-nans-fp-math"="false" "stack-protector-buffer-size"="8" "use-soft-float"="false" }
   attributes #1 = { nounwind readnone }
 
   !llvm.dbg.cu = !{!0}
diff --git a/llvm/include/llvm/CodeGen/CommandFlags.h b/llvm/include/llvm/CodeGen/CommandFlags.h
index 39c5a8d479a5f..af66f2d5776ba 100644
--- a/llvm/include/llvm/CodeGen/CommandFlags.h
+++ b/llvm/include/llvm/CodeGen/CommandFlags.h
@@ -58,8 +58,6 @@ LLVM_ABI CodeGenFileType getFileType();
 
 LLVM_ABI FramePointerKind getFramePointerUsage();
 
-LLVM_ABI bool getEnableUnsafeFPMath();
-
 LLVM_ABI bool getEnableNoInfsFPMath();
 
 LLVM_ABI bool getEnableNoNaNsFPMath();
diff --git a/llvm/include/llvm/IR/Attributes.td b/llvm/include/llvm/IR/Attributes.td
index 8e7d9dcebfe2a..8ce2b1bea8fac 100644
--- a/llvm/include/llvm/IR/Attributes.td
+++ b/llvm/include/llvm/IR/Attributes.td
@@ -410,7 +410,6 @@ def LessPreciseFPMAD : StrBoolAttr<"less-precise-fpmad">;
 def NoInfsFPMath : StrBoolAttr<"no-infs-fp-math">;
 def NoNansFPMath : StrBoolAttr<"no-nans-fp-math">;
 def NoSignedZerosFPMath : StrBoolAttr<"no-signed-zeros-fp-math">;
-def UnsafeFPMath : StrBoolAttr<"unsafe-fp-math">;
 def NoJumpTables : StrBoolAttr<"no-jump-tables">;
 def NoInlineLineTables : StrBoolAttr<"no-inline-line-tables">;
 def ProfileSampleAccurate : StrBoolAttr<"profile-sample-accurate">;
@@ -474,7 +473,6 @@ def : MergeRule<"setAND<LessPreciseFPMADAttr>">;
 def : MergeRule<"setAND<NoInfsFPMathAttr>">;
 def : MergeRule<"setAND<NoNansFPMathAttr>">;
 def : MergeRule<"setAND<NoSignedZerosFPMathAttr>">;
-def : MergeRule<"setAND<UnsafeFPMathAttr>">;
 def : MergeRule<"setOR<NoImplicitFloatAttr>">;
 def : MergeRule<"setOR<NoJumpTablesAttr>">;
 def : MergeRule<"setOR<ProfileSampleAccurateAttr>">;
diff --git a/llvm/include/llvm/Target/TargetOptions.h b/llvm/include/llvm/Target/TargetOptions.h
index 2c2122a7b204f..bfd2817b8d1f5 100644
--- a/llvm/include/llvm/Target/TargetOptions.h
+++ b/llvm/include/llvm/Target/TargetOptions.h
@@ -118,9 +118,8 @@ enum CodeObjectVersionKind {
 class TargetOptions {
 public:
   TargetOptions()
-      : UnsafeFPMath(false), NoInfsFPMath(false), NoNaNsFPMath(false),
-        NoTrappingFPMath(true), NoSignedZerosFPMath(false),
-        EnableAIXExtendedAltivecABI(false),
+      : NoInfsFPMath(false), NoNaNsFPMath(false), NoTrappingFPMath(true),
+        NoSignedZerosFPMath(false), EnableAIXExtendedAltivecABI(false),
         HonorSignDependentRoundingFPMathOption(false), NoZerosInBSS(false),
         GuaranteedTailCallOpt(false), StackSymbolOrdering(true),
         EnableFastISel(false), EnableGlobalISel(false), UseInitArray(false),
@@ -156,13 +155,6 @@ class TargetOptions {
   /// MCAsmInfo::BinutilsVersion.
   std::pair<int, int> BinutilsVersion{0, 0};
 
-  /// UnsafeFPMath - This flag is enabled when the
-  /// -enable-unsafe-fp-math flag is specified on the command line.  When
-  /// this flag is off (the default), the code generator is not allowed to
-  /// produce results that are "less precise" than IEEE allows.  This includes
-  /// use of X86 instructions like FSIN and FCOS instead of libcalls.
-  unsigned UnsafeFPMath : 1;
-
   /// NoInfsFPMath - This flag is enabled when the
   /// -enable-no-infs-fp-math flag is specified on the command line. When
   /// this flag is off (the default), the code generator is not allowed to
diff --git a/llvm/lib/CodeGen/CommandFlags.cpp b/llvm/lib/CodeGen/CommandFlags.cpp
index 0522698adf183..c1365f499dcf5 100644
--- a/llvm/lib/CodeGen/CommandFlags.cpp
+++ b/llvm/lib/CodeGen/CommandFlags.cpp
@@ -64,7 +64,6 @@ CGOPT_EXP(uint64_t, LargeDataThreshold)
 CGOPT(ExceptionHandling, ExceptionModel)
 CGOPT_EXP(CodeGenFileType, FileType)
 CGOPT(FramePointerKind, FramePointerUsage)
-CGOPT(bool, EnableUnsafeFPMath)
 CGOPT(bool, EnableNoInfsFPMath)
 CGOPT(bool, EnableNoNaNsFPMath)
 CGOPT(bool, EnableNoSignedZerosFPMath)
@@ -219,12 +218,6 @@ codegen::RegisterCodeGenFlags::RegisterCodeGenFlags() {
                      "Enable frame pointer elimination")));
   CGBINDOPT(FramePointerUsage);
 
-  static cl::opt<bool> EnableUnsafeFPMath(
-      "enable-unsafe-fp-math",
-      cl::desc("Enable optimizations that may decrease FP precision"),
-      cl::init(false));
-  CGBINDOPT(EnableUnsafeFPMath);
-
   static cl::opt<bool> EnableNoInfsFPMath(
       "enable-no-infs-fp-math",
       cl::desc("Enable FP math optimizations that assume no +-Infs"),
@@ -552,7 +545,6 @@ TargetOptions
 codegen::InitTargetOptionsFromCodeGenFlags(const Triple &TheTriple) {
   TargetOptions Options;
   Options.AllowFPOpFusion = getFuseFPOps();
-  Options.UnsafeFPMath = getEnableUnsafeFPMath();
   Options.NoInfsFPMath = getEnableNoInfsFPMath();
   Options.NoNaNsFPMath = getEnableNoNaNsFPMath();
   Options.NoSignedZerosFPMath = getEnableNoSignedZerosFPMath();
@@ -706,7 +698,6 @@ void codegen::setFunctionAttributes(StringRef CPU, StringRef Features,
   if (getStackRealign())
     NewAttrs.addAttribute("stackrealign");
 
-  HANDLE_BOOL_ATTR(EnableUnsafeFPMathView, "unsafe-fp-math");
   HANDLE_BOOL_ATTR(EnableNoInfsFPMathView, "no-infs-fp-math");
   HANDLE_BOOL_ATTR(EnableNoNaNsFPMathView, "no-nans-fp-math");
   HANDLE_BOOL_ATTR(EnableNoSignedZerosFPMathView, "no-signed-zeros-fp-math");
diff --git a/llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp b/llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp
index 310d35d9b1d1e..d05a6506f9677 100644
--- a/llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp
+++ b/llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp
@@ -17462,9 +17462,9 @@ SDValue DAGCombiner::visitFSUBForFMACombine(SDNode *N) {
   // fold (fsub (fpext (fneg (fmul, x, y))), z)
   //   -> (fneg (fma (fpext x), (fpext y), z))
   // Note: This could be removed with appropriate canonicalization of the
-  // input expression into (fneg (fadd (fpext (fmul, x, y)), z). However, the
-  // orthogonal flags -fp-contract=fast and -enable-unsafe-fp-math prevent
-  // from implementing the canonicalization in visitFSUB.
+  // input expression into (fneg (fadd (fpext (fmul, x, y)), z). However,
+  // -fp-contract=fast prevent from implementing the canonicalization
+  // in visitFSUB.
   if (matcher.match(N0, ISD::FP_EXTEND)) {
     SDValue N00 = N0.getOperand(0);
     if (matcher.match(N00, ISD::FNEG)) {
@@ -17486,9 +17486,9 @@ SDValue DAGCombiner::visitFSUBForFMACombine(SDNode *N) {
   // fold (fsub (fneg (fpext (f...
[truncated]

@llvmbot
Copy link
Member

llvmbot commented Oct 21, 2025

@llvm/pr-subscribers-backend-mips

Author: None (paperchalice)

Changes

These global flags block furthur improvements for clang, users should always use fast-math flags
see also https://discourse.llvm.org/t/rfc-honor-pragmas-with-ffp-contract-fast/80797


Patch is 1.41 MiB, truncated to 20.00 KiB below, full version: https://github.com/llvm/llvm-project/pull/164400.diff

1005 Files Affected:

  • (modified) clang/lib/CodeGen/BackendUtil.cpp (-6)
  • (modified) lld/test/COFF/Inputs/undefined-symbol-lto-a.ll (+2-2)
  • (modified) lld/test/COFF/Inputs/undefined-symbol-lto-b.ll (+1-1)
  • (modified) lld/test/COFF/Inputs/undefined-symbol-multi-lto.ll (+2-2)
  • (modified) lld/test/MachO/lto-mattrs.ll (+1-1)
  • (modified) lld/test/wasm/Inputs/debuginfo1.ll (+3-3)
  • (modified) lld/test/wasm/Inputs/debuginfo2.ll (+1-1)
  • (modified) lld/test/wasm/debug-removed-fn.ll (+1-1)
  • (modified) llvm/docs/CommandGuide/llc.rst (-7)
  • (modified) llvm/docs/CommandGuide/lli.rst (-5)
  • (modified) llvm/docs/SourceLevelDebugging.rst (+1-1)
  • (modified) llvm/include/llvm/CodeGen/CommandFlags.h (-2)
  • (modified) llvm/include/llvm/IR/Attributes.td (-2)
  • (modified) llvm/include/llvm/Target/TargetOptions.h (+2-10)
  • (modified) llvm/lib/CodeGen/CommandFlags.cpp (-9)
  • (modified) llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp (+6-6)
  • (modified) llvm/lib/CodeGen/TargetOptionsImpl.cpp (+1-1)
  • (modified) llvm/lib/Target/TargetMachine.cpp (-1)
  • (modified) llvm/lib/Transforms/Instrumentation/NumericalStabilitySanitizer.cpp (-1)
  • (modified) llvm/test/Analysis/BranchProbabilityInfo/pr22718.ll (+3-3)
  • (modified) llvm/test/Analysis/CostModel/SystemZ/intrinsic-cost-crash.ll (+1-1)
  • (modified) llvm/test/Analysis/Delinearization/constant_functions_multi_dim.ll (+2-2)
  • (modified) llvm/test/Analysis/DependenceAnalysis/MIVCheckConst.ll (+1-1)
  • (modified) llvm/test/Analysis/DependenceAnalysis/NonCanonicalizedSubscript.ll (+1-1)
  • (modified) llvm/test/Analysis/MemoryDependenceAnalysis/invariant.group-bug.ll (+2-2)
  • (modified) llvm/test/Analysis/MemorySSA/pr28880.ll (+1-1)
  • (modified) llvm/test/Analysis/MemorySSA/pr39197.ll (+1-1)
  • (modified) llvm/test/Analysis/MemorySSA/pr40038.ll (+1-1)
  • (modified) llvm/test/Analysis/MemorySSA/pr43569.ll (+1-1)
  • (modified) llvm/test/Analysis/ScalarEvolution/pr22674.ll (+1-1)
  • (modified) llvm/test/Analysis/ScalarEvolution/scev-canonical-mode.ll (+1-1)
  • (modified) llvm/test/Analysis/TypeBasedAliasAnalysis/PR17620.ll (+2-2)
  • (modified) llvm/test/Analysis/TypeBasedAliasAnalysis/tbaa-path.ll (+1-1)
  • (modified) llvm/test/Bitcode/DILocation-implicit-code.ll (+2-2)
  • (modified) llvm/test/Bitcode/drop-debug-info.3.5.ll (+1-1)
  • (modified) llvm/test/Bitcode/upgrade-tbaa.ll (+1-1)
  • (modified) llvm/test/CodeGen/AArch64/GlobalISel/inline-memcpy.mir (+1-1)
  • (modified) llvm/test/CodeGen/AArch64/GlobalISel/inline-memmove.mir (+1-1)
  • (modified) llvm/test/CodeGen/AArch64/GlobalISel/inline-memset.mir (+1-1)
  • (modified) llvm/test/CodeGen/AArch64/aarch64-2014-08-11-MachineCombinerCrash.ll (+1-1)
  • (modified) llvm/test/CodeGen/AArch64/aarch64-a57-fp-load-balancing.ll (+2-2)
  • (modified) llvm/test/CodeGen/AArch64/aarch64-dynamic-stack-layout.ll (+2-2)
  • (modified) llvm/test/CodeGen/AArch64/aarch64-fix-cortex-a53-835769.ll (+2-2)
  • (modified) llvm/test/CodeGen/AArch64/aarch64-mov-debug-locs.mir (+2-2)
  • (modified) llvm/test/CodeGen/AArch64/arm64-detect-vec-redux.ll (+1-1)
  • (modified) llvm/test/CodeGen/AArch64/arm64-fma-combine-with-fpfusion.ll (+1-1)
  • (modified) llvm/test/CodeGen/AArch64/arm64-fma-combines.ll (+1-1)
  • (modified) llvm/test/CodeGen/AArch64/arm64-indexed-vector-ldst-2.ll (+1-1)
  • (modified) llvm/test/CodeGen/AArch64/arm64-misched-basic-A53.ll (+1-1)
  • (modified) llvm/test/CodeGen/AArch64/arm64-misched-basic-A57.ll (+1-1)
  • (modified) llvm/test/CodeGen/AArch64/arm64-rounding.ll (+1-1)
  • (modified) llvm/test/CodeGen/AArch64/arm64-storebytesmerge.ll (+2-2)
  • (modified) llvm/test/CodeGen/AArch64/arm64-triv-disjoint-mem-access.ll (+1-1)
  • (modified) llvm/test/CodeGen/AArch64/bti-branch-relaxation.ll (+1-1)
  • (modified) llvm/test/CodeGen/AArch64/consthoist-gep.ll (+1-1)
  • (modified) llvm/test/CodeGen/AArch64/csel-zero-float.ll (+1-1)
  • (modified) llvm/test/CodeGen/AArch64/dag-combine-invaraints.ll (+2-2)
  • (modified) llvm/test/CodeGen/AArch64/partial-pipeline-execution.ll (+1-1)
  • (modified) llvm/test/CodeGen/AArch64/recp-fastmath.ll (+2-2)
  • (modified) llvm/test/CodeGen/AArch64/stack-tagging-ex-1.ll (+1-1)
  • (modified) llvm/test/CodeGen/AArch64/stack-tagging-ex-2.ll (+2-2)
  • (modified) llvm/test/CodeGen/AArch64/stack-tagging-untag-placement.ll (+1-1)
  • (modified) llvm/test/CodeGen/AArch64/stack_guard_remat.ll (+1-1)
  • (modified) llvm/test/CodeGen/AArch64/svtcf-fmul-fdiv-combine.ll (+1-1)
  • (modified) llvm/test/CodeGen/AArch64/vector_merge_dep_check.ll (+1-1)
  • (modified) llvm/test/CodeGen/AArch64/wineh-frame5.mir (+2-2)
  • (modified) llvm/test/CodeGen/AArch64/wineh-frame6.mir (+2-2)
  • (modified) llvm/test/CodeGen/AArch64/wineh-frame7.mir (+2-2)
  • (modified) llvm/test/CodeGen/AArch64/wineh-frame8.mir (+1-1)
  • (modified) llvm/test/CodeGen/AArch64/wineh5.mir (+2-2)
  • (modified) llvm/test/CodeGen/AArch64/wineh_shrinkwrap.mir (+2-2)
  • (modified) llvm/test/CodeGen/AMDGPU/GlobalISel/combine-fma-unmerge-values.mir (+1-1)
  • (modified) llvm/test/CodeGen/AMDGPU/GlobalISel/inst-select-fract.f64.mir (+2-2)
  • (modified) llvm/test/CodeGen/AMDGPU/combine_andor_with_cmps.ll (+1-1)
  • (modified) llvm/test/CodeGen/AMDGPU/fadd-fma-fmul-combine.ll (+4-4)
  • (modified) llvm/test/CodeGen/AMDGPU/fdiv.f64.ll (+1-1)
  • (modified) llvm/test/CodeGen/AMDGPU/fmad-formation-fmul-distribute-denormal-mode.ll (+1-1)
  • (modified) llvm/test/CodeGen/AMDGPU/fmed3.bf16.ll (+2-2)
  • (modified) llvm/test/CodeGen/AMDGPU/fmed3.ll (+1-1)
  • (modified) llvm/test/CodeGen/AMDGPU/fneg-combines.legal.f16.ll (+1-1)
  • (modified) llvm/test/CodeGen/AMDGPU/fneg-combines.ll (+1-1)
  • (modified) llvm/test/CodeGen/AMDGPU/fpext.f16.ll (+5-5)
  • (modified) llvm/test/CodeGen/AMDGPU/fptosi.f16.ll (+4-4)
  • (modified) llvm/test/CodeGen/AMDGPU/fptoui.f16.ll (+4-4)
  • (modified) llvm/test/CodeGen/AMDGPU/fptrunc.ll (+4-4)
  • (modified) llvm/test/CodeGen/AMDGPU/fract.f64.ll (+2-2)
  • (modified) llvm/test/CodeGen/AMDGPU/fract.ll (+2-2)
  • (modified) llvm/test/CodeGen/AMDGPU/frem.ll (+2-2)
  • (modified) llvm/test/CodeGen/AMDGPU/fsqrt.f64.ll (+1-2)
  • (modified) llvm/test/CodeGen/AMDGPU/fsqrt.r600.ll (+1-1)
  • (modified) llvm/test/CodeGen/AMDGPU/inline-attr.ll (+9-9)
  • (modified) llvm/test/CodeGen/AMDGPU/llvm.exp2.ll (+1-1)
  • (modified) llvm/test/CodeGen/AMDGPU/llvm.log2.ll (+1-1)
  • (modified) llvm/test/CodeGen/AMDGPU/minmax.ll (+1-1)
  • (modified) llvm/test/CodeGen/AMDGPU/prevent-fmul-hoist-ir.ll (+1-1)
  • (modified) llvm/test/CodeGen/AMDGPU/sitofp.f16.ll (+4-4)
  • (modified) llvm/test/CodeGen/AMDGPU/uitofp.f16.ll (+4-4)
  • (modified) llvm/test/CodeGen/ARM/2014-05-14-DwarfEHCrash.ll (+1-1)
  • (modified) llvm/test/CodeGen/ARM/ARMLoadStoreDBG.mir (+2-2)
  • (modified) llvm/test/CodeGen/ARM/Windows/wineh-basic.ll (+2-2)
  • (modified) llvm/test/CodeGen/ARM/byval_load_align.ll (+2-2)
  • (modified) llvm/test/CodeGen/ARM/cfguard-module-flag.ll (+1-1)
  • (modified) llvm/test/CodeGen/ARM/clang-section.ll (+2-2)
  • (modified) llvm/test/CodeGen/ARM/cmse-clear-float-bigend.mir (+1-1)
  • (modified) llvm/test/CodeGen/ARM/coalesce-dbgvalue.ll (+2-2)
  • (modified) llvm/test/CodeGen/ARM/constantpool-promote-dbg.ll (+1-1)
  • (modified) llvm/test/CodeGen/ARM/constantpool-promote.ll (+2-2)
  • (modified) llvm/test/CodeGen/ARM/early-cfi-sections.ll (+1-1)
  • (modified) llvm/test/CodeGen/ARM/fp16-vld.ll (+1-1)
  • (modified) llvm/test/CodeGen/ARM/global-merge-1.ll (+3-3)
  • (modified) llvm/test/CodeGen/ARM/isel-v8i32-crash.ll (+1-1)
  • (modified) llvm/test/CodeGen/ARM/out-of-registers.ll (+1-1)
  • (modified) llvm/test/CodeGen/ARM/relax-per-target-feature.ll (+1-1)
  • (modified) llvm/test/CodeGen/ARM/softfp-constant-comparison.ll (+1-1)
  • (modified) llvm/test/CodeGen/ARM/stack-protector-bmovpcb_call.ll (+2-2)
  • (modified) llvm/test/CodeGen/ARM/stack_guard_remat.ll (+1-1)
  • (modified) llvm/test/CodeGen/ARM/struct-byval-frame-index.ll (+1-1)
  • (modified) llvm/test/CodeGen/ARM/subtarget-align.ll (+1-1)
  • (modified) llvm/test/CodeGen/ARM/unschedule-first-call.ll (+1-1)
  • (modified) llvm/test/CodeGen/ARM/vector-spilling.ll (+1-1)
  • (modified) llvm/test/CodeGen/ARM/vldm-sched-a9.ll (+1-1)
  • (modified) llvm/test/CodeGen/BPF/BTF/binary-format.ll (+1-1)
  • (modified) llvm/test/CodeGen/BPF/BTF/builtin-btf-type-id.ll (+1-1)
  • (modified) llvm/test/CodeGen/BPF/BTF/char-no-debuginfo.ll (+1-1)
  • (modified) llvm/test/CodeGen/BPF/BTF/extern-builtin.ll (+1-1)
  • (modified) llvm/test/CodeGen/BPF/BTF/extern-func-arg.ll (+2-2)
  • (modified) llvm/test/CodeGen/BPF/BTF/extern-global-var.ll (+1-1)
  • (modified) llvm/test/CodeGen/BPF/BTF/extern-var-func-weak-section.ll (+2-2)
  • (modified) llvm/test/CodeGen/BPF/BTF/extern-var-func-weak.ll (+2-2)
  • (modified) llvm/test/CodeGen/BPF/BTF/extern-var-func.ll (+2-2)
  • (modified) llvm/test/CodeGen/BPF/BTF/extern-var-section.ll (+2-2)
  • (modified) llvm/test/CodeGen/BPF/BTF/extern-var-struct-weak.ll (+1-1)
  • (modified) llvm/test/CodeGen/BPF/BTF/extern-var-struct.ll (+1-1)
  • (modified) llvm/test/CodeGen/BPF/BTF/extern-var-weak-section.ll (+2-2)
  • (modified) llvm/test/CodeGen/BPF/BTF/filename.ll (+1-1)
  • (modified) llvm/test/CodeGen/BPF/BTF/func-func-ptr.ll (+1-1)
  • (modified) llvm/test/CodeGen/BPF/BTF/func-non-void.ll (+1-1)
  • (modified) llvm/test/CodeGen/BPF/BTF/func-source.ll (+1-1)
  • (modified) llvm/test/CodeGen/BPF/BTF/func-typedef.ll (+1-1)
  • (modified) llvm/test/CodeGen/BPF/BTF/func-unused-arg.ll (+1-1)
  • (modified) llvm/test/CodeGen/BPF/BTF/func-void.ll (+1-1)
  • (modified) llvm/test/CodeGen/BPF/BTF/local-var-readonly-1.ll (+2-2)
  • (modified) llvm/test/CodeGen/BPF/BTF/local-var-readonly-2.ll (+2-2)
  • (modified) llvm/test/CodeGen/BPF/BTF/local-var.ll (+1-1)
  • (modified) llvm/test/CodeGen/BPF/BTF/pruning-const.ll (+2-2)
  • (modified) llvm/test/CodeGen/BPF/BTF/pruning-typedef.ll (+2-2)
  • (modified) llvm/test/CodeGen/BPF/BTF/static-func.ll (+3-3)
  • (modified) llvm/test/CodeGen/BPF/BTF/static-var-derived-type.ll (+1-1)
  • (modified) llvm/test/CodeGen/BPF/BTF/static-var-inited-sec.ll (+1-1)
  • (modified) llvm/test/CodeGen/BPF/BTF/static-var-inited.ll (+1-1)
  • (modified) llvm/test/CodeGen/BPF/BTF/static-var-readonly-sec.ll (+1-1)
  • (modified) llvm/test/CodeGen/BPF/BTF/static-var-readonly.ll (+1-1)
  • (modified) llvm/test/CodeGen/BPF/BTF/static-var-sec.ll (+1-1)
  • (modified) llvm/test/CodeGen/BPF/BTF/static-var-zerolen-array.ll (+1-1)
  • (modified) llvm/test/CodeGen/BPF/BTF/static-var.ll (+1-1)
  • (modified) llvm/test/CodeGen/BPF/BTF/struct-anon-2.ll (+1-1)
  • (modified) llvm/test/CodeGen/BPF/BTF/weak-global-2.ll (+1-1)
  • (modified) llvm/test/CodeGen/BPF/BTF/weak-global.ll (+1-1)
  • (modified) llvm/test/CodeGen/BPF/CORE/btf-id-duplicate.ll (+1-1)
  • (modified) llvm/test/CodeGen/BPF/CORE/field-reloc-alu32.ll (+1-1)
  • (modified) llvm/test/CodeGen/BPF/CORE/field-reloc-bitfield-1-bpfeb.ll (+1-1)
  • (modified) llvm/test/CodeGen/BPF/CORE/field-reloc-bitfield-1.ll (+1-1)
  • (modified) llvm/test/CodeGen/BPF/CORE/field-reloc-bitfield-2-bpfeb.ll (+1-1)
  • (modified) llvm/test/CodeGen/BPF/CORE/field-reloc-bitfield-2.ll (+1-1)
  • (modified) llvm/test/CodeGen/BPF/CORE/field-reloc-duplicate.ll (+1-1)
  • (modified) llvm/test/CodeGen/BPF/CORE/intrinsic-array-2.ll (+1-1)
  • (modified) llvm/test/CodeGen/BPF/CORE/intrinsic-array.ll (+2-2)
  • (modified) llvm/test/CodeGen/BPF/CORE/intrinsic-fieldinfo-byte-size-1.ll (+1-1)
  • (modified) llvm/test/CodeGen/BPF/CORE/intrinsic-fieldinfo-byte-size-2.ll (+1-1)
  • (modified) llvm/test/CodeGen/BPF/CORE/intrinsic-fieldinfo-byte-size-3.ll (+1-1)
  • (modified) llvm/test/CodeGen/BPF/CORE/intrinsic-fieldinfo-byte-size-4.ll (+1-1)
  • (modified) llvm/test/CodeGen/BPF/CORE/intrinsic-fieldinfo-existence-1.ll (+1-1)
  • (modified) llvm/test/CodeGen/BPF/CORE/intrinsic-fieldinfo-existence-2.ll (+1-1)
  • (modified) llvm/test/CodeGen/BPF/CORE/intrinsic-fieldinfo-existence-3.ll (+1-1)
  • (modified) llvm/test/CodeGen/BPF/CORE/intrinsic-fieldinfo-lshift-1-bpfeb.ll (+1-1)
  • (modified) llvm/test/CodeGen/BPF/CORE/intrinsic-fieldinfo-lshift-1.ll (+1-1)
  • (modified) llvm/test/CodeGen/BPF/CORE/intrinsic-fieldinfo-lshift-2.ll (+1-1)
  • (modified) llvm/test/CodeGen/BPF/CORE/intrinsic-fieldinfo-rshift-1.ll (+1-1)
  • (modified) llvm/test/CodeGen/BPF/CORE/intrinsic-fieldinfo-rshift-2.ll (+1-1)
  • (modified) llvm/test/CodeGen/BPF/CORE/intrinsic-fieldinfo-rshift-3.ll (+1-1)
  • (modified) llvm/test/CodeGen/BPF/CORE/intrinsic-fieldinfo-signedness-1.ll (+1-1)
  • (modified) llvm/test/CodeGen/BPF/CORE/intrinsic-fieldinfo-signedness-2.ll (+1-1)
  • (modified) llvm/test/CodeGen/BPF/CORE/intrinsic-fieldinfo-signedness-3.ll (+1-1)
  • (modified) llvm/test/CodeGen/BPF/CORE/intrinsic-struct.ll (+2-2)
  • (modified) llvm/test/CodeGen/BPF/CORE/intrinsic-typeinfo-enum-value.ll (+1-1)
  • (modified) llvm/test/CodeGen/BPF/CORE/intrinsic-typeinfo-type-exist.ll (+1-1)
  • (modified) llvm/test/CodeGen/BPF/CORE/intrinsic-typeinfo-type-size-1.ll (+1-1)
  • (modified) llvm/test/CodeGen/BPF/CORE/intrinsic-typeinfo-type-size-2.ll (+1-1)
  • (modified) llvm/test/CodeGen/BPF/CORE/intrinsic-union.ll (+2-2)
  • (modified) llvm/test/CodeGen/BPF/CORE/no-elf-ama-symbol.ll (+1-1)
  • (modified) llvm/test/CodeGen/BPF/CORE/no-narrow-load.ll (+2-2)
  • (modified) llvm/test/CodeGen/BPF/CORE/offset-reloc-access-str.ll (+2-2)
  • (modified) llvm/test/CodeGen/BPF/CORE/offset-reloc-basic.ll (+1-1)
  • (modified) llvm/test/CodeGen/BPF/CORE/offset-reloc-cast-array-1.ll (+2-2)
  • (modified) llvm/test/CodeGen/BPF/CORE/offset-reloc-cast-array-2.ll (+2-2)
  • (modified) llvm/test/CodeGen/BPF/CORE/offset-reloc-cast-struct-1.ll (+2-2)
  • (modified) llvm/test/CodeGen/BPF/CORE/offset-reloc-cast-struct-2.ll (+2-2)
  • (modified) llvm/test/CodeGen/BPF/CORE/offset-reloc-cast-struct-3.ll (+2-2)
  • (modified) llvm/test/CodeGen/BPF/CORE/offset-reloc-cast-union-1.ll (+2-2)
  • (modified) llvm/test/CodeGen/BPF/CORE/offset-reloc-cast-union-2.ll (+2-2)
  • (modified) llvm/test/CodeGen/BPF/CORE/offset-reloc-end-load.ll (+1-1)
  • (modified) llvm/test/CodeGen/BPF/CORE/offset-reloc-end-ret.ll (+1-1)
  • (modified) llvm/test/CodeGen/BPF/CORE/offset-reloc-fieldinfo-1.ll (+2-2)
  • (modified) llvm/test/CodeGen/BPF/CORE/offset-reloc-fieldinfo-2-bpfeb.ll (+1-1)
  • (modified) llvm/test/CodeGen/BPF/CORE/offset-reloc-fieldinfo-2.ll (+1-1)
  • (modified) llvm/test/CodeGen/BPF/CORE/offset-reloc-global-1.ll (+2-2)
  • (modified) llvm/test/CodeGen/BPF/CORE/offset-reloc-global-2.ll (+2-2)
  • (modified) llvm/test/CodeGen/BPF/CORE/offset-reloc-global-3.ll (+2-2)
  • (modified) llvm/test/CodeGen/BPF/CORE/offset-reloc-ignore.ll (+2-2)
  • (modified) llvm/test/CodeGen/BPF/CORE/offset-reloc-middle-chain.ll (+2-2)
  • (modified) llvm/test/CodeGen/BPF/CORE/offset-reloc-multi-array-1.ll (+2-2)
  • (modified) llvm/test/CodeGen/BPF/CORE/offset-reloc-multi-array-2.ll (+2-2)
  • (modified) llvm/test/CodeGen/BPF/CORE/offset-reloc-multilevel.ll (+1-1)
  • (modified) llvm/test/CodeGen/BPF/CORE/offset-reloc-pointer-1.ll (+2-2)
  • (modified) llvm/test/CodeGen/BPF/CORE/offset-reloc-pointer-2.ll (+2-2)
  • (modified) llvm/test/CodeGen/BPF/CORE/offset-reloc-struct-anonymous.ll (+1-1)
  • (modified) llvm/test/CodeGen/BPF/CORE/offset-reloc-struct-array.ll (+1-1)
  • (modified) llvm/test/CodeGen/BPF/CORE/offset-reloc-typedef-array.ll (+2-2)
  • (modified) llvm/test/CodeGen/BPF/CORE/offset-reloc-typedef-struct-2.ll (+1-1)
  • (modified) llvm/test/CodeGen/BPF/CORE/offset-reloc-typedef-struct.ll (+2-2)
  • (modified) llvm/test/CodeGen/BPF/CORE/offset-reloc-typedef-union-2.ll (+1-1)
  • (modified) llvm/test/CodeGen/BPF/CORE/offset-reloc-typedef-union.ll (+2-2)
  • (modified) llvm/test/CodeGen/BPF/CORE/offset-reloc-typedef.ll (+2-2)
  • (modified) llvm/test/CodeGen/BPF/CORE/offset-reloc-union.ll (+1-1)
  • (modified) llvm/test/CodeGen/BPF/CORE/store-addr.ll (+2-2)
  • (modified) llvm/test/CodeGen/BPF/adjust-opt-icmp1.ll (+2-2)
  • (modified) llvm/test/CodeGen/BPF/adjust-opt-icmp2.ll (+2-2)
  • (modified) llvm/test/CodeGen/BPF/adjust-opt-speculative1.ll (+2-2)
  • (modified) llvm/test/CodeGen/BPF/adjust-opt-speculative2.ll (+2-2)
  • (modified) llvm/test/CodeGen/BPF/callx.ll (+1-1)
  • (modified) llvm/test/CodeGen/BPF/dwarfdump.ll (+1-1)
  • (modified) llvm/test/CodeGen/BPF/i128.ll (+2-2)
  • (modified) llvm/test/CodeGen/BPF/is_trunc_free.ll (+2-2)
  • (modified) llvm/test/CodeGen/BPF/is_zext_free.ll (+1-1)
  • (modified) llvm/test/CodeGen/BPF/objdump_two_funcs.ll (+1-1)
  • (modified) llvm/test/CodeGen/BPF/optnone-1.ll (+1-1)
  • (modified) llvm/test/CodeGen/BPF/reloc-btf-2.ll (+1-1)
  • (modified) llvm/test/CodeGen/BPF/reloc-btf.ll (+1-1)
  • (modified) llvm/test/CodeGen/BPF/simplifycfg.ll (+2-2)
  • (modified) llvm/test/CodeGen/BPF/warn-stack.ll (+2-2)
  • (modified) llvm/test/CodeGen/BPF/xadd.ll (+1-1)
  • (modified) llvm/test/CodeGen/Generic/cfi-sections.ll (+2-2)
  • (modified) llvm/test/CodeGen/Hexagon/NVJumpCmp.ll (+1-1)
  • (modified) llvm/test/CodeGen/Hexagon/addh-sext-trunc.ll (+1-1)
  • (modified) llvm/test/CodeGen/Hexagon/alu64.ll (+1-1)
  • (modified) llvm/test/CodeGen/Hexagon/autohvx/fsplat.ll (+1-1)
  • (modified) llvm/test/CodeGen/Hexagon/autohvx/hfinsert.ll (+1-1)
  • (modified) llvm/test/CodeGen/Hexagon/autohvx/hfnosplat_cp.ll (+1-1)
  • (modified) llvm/test/CodeGen/Hexagon/autohvx/hfsplat.ll (+1-1)
  • (modified) llvm/test/CodeGen/Hexagon/base-offset-addr.ll (+1-1)
  • (modified) llvm/test/CodeGen/Hexagon/base-offset-post.ll (+1-1)
  • (modified) llvm/test/CodeGen/Hexagon/bit-loop-rc-mismatch.ll (+2-2)
  • (modified) llvm/test/CodeGen/Hexagon/bit-rie.ll (+1-1)
  • (modified) llvm/test/CodeGen/Hexagon/builtin-prefetch.ll (+1-1)
  • (modified) llvm/test/CodeGen/Hexagon/cfi-offset.ll (+1-1)
  • (modified) llvm/test/CodeGen/Hexagon/cmp-extend.ll (+1-1)
  • (modified) llvm/test/CodeGen/Hexagon/cmp.ll (+1-1)
  • (modified) llvm/test/CodeGen/Hexagon/constp-combine-neg.ll (+1-1)
  • (modified) llvm/test/CodeGen/Hexagon/constp-extract.ll (+1-1)
  • (modified) llvm/test/CodeGen/Hexagon/constp-physreg.ll (+1-1)
  • (modified) llvm/test/CodeGen/Hexagon/dead-store-stack.ll (+2-2)
  • (modified) llvm/test/CodeGen/Hexagon/early-if-conversion-bug1.ll (+2-2)
  • (modified) llvm/test/CodeGen/Hexagon/fminmax.ll (+1-1)
  • (modified) llvm/test/CodeGen/Hexagon/hexagon_vector_loop_carried_reuse.ll (+1-1)
  • (modified) llvm/test/CodeGen/Hexagon/hexagon_vector_loop_carried_reuse_constant.ll (+1-1)
  • (modified) llvm/test/CodeGen/Hexagon/hwloop-crit-edge.ll (+1-1)
  • (modified) llvm/test/CodeGen/Hexagon/hwloop-preheader.ll (+1-1)
  • (modified) llvm/test/CodeGen/Hexagon/intrinsics-v67.ll (+1-1)
  • (modified) llvm/test/CodeGen/Hexagon/jt-in-text.ll (+1-1)
  • (modified) llvm/test/CodeGen/Hexagon/ldst_vector_offset.ll (+1-1)
  • (modified) llvm/test/CodeGen/Hexagon/loopIdiom.ll (+1-1)
  • (modified) llvm/test/CodeGen/Hexagon/loop_align_count.ll (+1-1)
  • (modified) llvm/test/CodeGen/Hexagon/mem-fi-add.ll (+2-2)
  • (modified) llvm/test/CodeGen/Hexagon/memops-stack.ll (+2-2)
  • (modified) llvm/test/CodeGen/Hexagon/pic-regusage.ll (+1-1)
  • (modified) llvm/test/CodeGen/Hexagon/postinc-offset.ll (+1-1)
  • (modified) llvm/test/CodeGen/Hexagon/rdf-dead-loop.ll (+1-1)
  • (modified) llvm/test/CodeGen/Hexagon/rdf-inline-asm-fixed.ll (+1-1)
  • (modified) llvm/test/CodeGen/Hexagon/rdf-inline-asm.ll (+1-1)
  • (modified) llvm/test/CodeGen/Hexagon/reg-scavengebug-3.ll (+2-2)
  • (modified) llvm/test/CodeGen/Hexagon/runtime-stkchk.ll (+2-2)
  • (modified) llvm/test/CodeGen/Hexagon/sdr-shr32.ll (+1-1)
  • (modified) llvm/test/CodeGen/Hexagon/switch-lut-explicit-section.ll (+1-1)
  • (modified) llvm/test/CodeGen/Hexagon/switch-lut-function-section.ll (+1-1)
  • (modified) llvm/test/CodeGen/Hexagon/switch-lut-multiple-functions.ll (+1-1)
  • (modified) llvm/test/CodeGen/Hexagon/switch-lut-text-section.ll (+1-1)
  • (modified) llvm/test/CodeGen/Hexagon/swp-epilog-phi10.ll (+1-1)
  • (modified) llvm/test/CodeGen/Hexagon/swp-phi.ll (+1-1)
  • (modified) llvm/test/CodeGen/Hexagon/swp-pragma-disable-bug.ll (+1-1)
  • (modified) llvm/test/CodeGen/Hexagon/swp-prolog-phi4.ll (+1-1)
  • (modified) llvm/test/CodeGen/Hexagon/swp-stages4.ll (+1-1)
  • (modified) llvm/test/CodeGen/Hexagon/usr-ovf-dep.ll (+1-1)
  • (modified) llvm/test/CodeGen/Hexagon/v6-haar-balign32.ll (+1-1)
  • (modified) llvm/test/CodeGen/Hexagon/v60Intrins.ll (+1-1)
  • (modified) llvm/test/CodeGen/Hexagon/v60small.ll (+1-1)
  • (modified) llvm/test/CodeGen/Hexagon/v6vec-vprint.ll (+1-1)
  • (modified) llvm/test/CodeGen/Hexagon/vec-pred-spill1.ll (+2-2)
  • (modified) llvm/test/CodeGen/Hexagon/vect-regpairs.ll (+1-1)
diff --git a/clang/lib/CodeGen/BackendUtil.cpp b/clang/lib/CodeGen/BackendUtil.cpp
index 602068436101b..ecfbcb5970092 100644
--- a/clang/lib/CodeGen/BackendUtil.cpp
+++ b/clang/lib/CodeGen/BackendUtil.cpp
@@ -430,12 +430,6 @@ static bool initTargetOptions(const CompilerInstance &CI,
   Options.NoInfsFPMath = LangOpts.NoHonorInfs;
   Options.NoNaNsFPMath = LangOpts.NoHonorNaNs;
   Options.NoZerosInBSS = CodeGenOpts.NoZeroInitializedInBSS;
-  Options.UnsafeFPMath = LangOpts.AllowFPReassoc && LangOpts.AllowRecip &&
-                         LangOpts.NoSignedZero && LangOpts.ApproxFunc &&
-                         (LangOpts.getDefaultFPContractMode() ==
-                              LangOptions::FPModeKind::FPM_Fast ||
-                          LangOpts.getDefaultFPContractMode() ==
-                              LangOptions::FPModeKind::FPM_FastHonorPragmas);
 
   Options.BBAddrMap = CodeGenOpts.BBAddrMap;
   Options.BBSections =
diff --git a/lld/test/COFF/Inputs/undefined-symbol-lto-a.ll b/lld/test/COFF/Inputs/undefined-symbol-lto-a.ll
index 7e29044ebe00d..f57a3e3c1ede4 100644
--- a/lld/test/COFF/Inputs/undefined-symbol-lto-a.ll
+++ b/lld/test/COFF/Inputs/undefined-symbol-lto-a.ll
@@ -47,8 +47,8 @@ entry:
   ret void
 }
 
-attributes #0 = { "correctly-rounded-divide-sqrt-fp-math"="false" "disable-tail-calls"="false" "less-precise-fpmad"="false" "frame-pointer"="none" "no-infs-fp-math"="false" "no-nans-fp-math"="false" "no-signed-zeros-fp-math"="false" "no-trapping-math"="false" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "unsafe-fp-math"="false" "use-soft-float"="false" }
-attributes #1 = { nounwind sspstrong uwtable "correctly-rounded-divide-sqrt-fp-math"="false" "disable-tail-calls"="false" "less-precise-fpmad"="false" "min-legal-vector-width"="0" "frame-pointer"="none" "no-infs-fp-math"="false" "no-jump-tables"="false" "no-nans-fp-math"="false" "no-signed-zeros-fp-math"="false" "no-trapping-math"="false" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "unsafe-fp-math"="false" "use-soft-float"="false" }
+attributes #0 = { "correctly-rounded-divide-sqrt-fp-math"="false" "disable-tail-calls"="false" "less-precise-fpmad"="false" "frame-pointer"="none" "no-infs-fp-math"="false" "no-nans-fp-math"="false" "no-signed-zeros-fp-math"="false" "no-trapping-math"="false" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "use-soft-float"="false" }
+attributes #1 = { nounwind sspstrong uwtable "correctly-rounded-divide-sqrt-fp-math"="false" "disable-tail-calls"="false" "less-precise-fpmad"="false" "min-legal-vector-width"="0" "frame-pointer"="none" "no-infs-fp-math"="false" "no-jump-tables"="false" "no-nans-fp-math"="false" "no-signed-zeros-fp-math"="false" "no-trapping-math"="false" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "use-soft-float"="false" }
 attributes #2 = { nounwind }
 
 !llvm.linker.options = !{!1, !2}
diff --git a/lld/test/COFF/Inputs/undefined-symbol-lto-b.ll b/lld/test/COFF/Inputs/undefined-symbol-lto-b.ll
index 0f64e236a1f47..7347fde7a9dee 100644
--- a/lld/test/COFF/Inputs/undefined-symbol-lto-b.ll
+++ b/lld/test/COFF/Inputs/undefined-symbol-lto-b.ll
@@ -11,7 +11,7 @@ entry:
   ret void
 }
 
-attributes #0 = { norecurse nounwind readnone sspstrong uwtable "correctly-rounded-divide-sqrt-fp-math"="false" "disable-tail-calls"="false" "less-precise-fpmad"="false" "min-legal-vector-width"="0" "frame-pointer"="none" "no-infs-fp-math"="false" "no-jump-tables"="false" "no-nans-fp-math"="false" "no-signed-zeros-fp-math"="false" "no-trapping-math"="false" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "unsafe-fp-math"="false" "use-soft-float"="false" }
+attributes #0 = { norecurse nounwind readnone sspstrong uwtable "correctly-rounded-divide-sqrt-fp-math"="false" "disable-tail-calls"="false" "less-precise-fpmad"="false" "min-legal-vector-width"="0" "frame-pointer"="none" "no-infs-fp-math"="false" "no-jump-tables"="false" "no-nans-fp-math"="false" "no-signed-zeros-fp-math"="false" "no-trapping-math"="false" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "use-soft-float"="false" }
 
 !llvm.linker.options = !{!0, !1}
 !llvm.module.flags = !{!2, !3, !4, !5}
diff --git a/lld/test/COFF/Inputs/undefined-symbol-multi-lto.ll b/lld/test/COFF/Inputs/undefined-symbol-multi-lto.ll
index 5f6730272e610..61828cae7ea58 100644
--- a/lld/test/COFF/Inputs/undefined-symbol-multi-lto.ll
+++ b/lld/test/COFF/Inputs/undefined-symbol-multi-lto.ll
@@ -13,8 +13,8 @@ declare dso_local i32 @"?foo@@YAHXZ"() #1
 
 declare dso_local i32 @"?bar@@YAHXZ"() #1
 
-attributes #0 = { noinline optnone uwtable "correctly-rounded-divide-sqrt-fp-math"="false" "disable-tail-calls"="false" "frame-pointer"="all" "less-precise-fpmad"="false" "min-legal-vector-width"="0" "no-infs-fp-math"="false" "no-jump-tables"="false" "no-nans-fp-math"="false" "no-signed-zeros-fp-math"="false" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "unsafe-fp-math"="false" "use-soft-float"="false" }
-attributes #1 = { "correctly-rounded-divide-sqrt-fp-math"="false" "disable-tail-calls"="false" "frame-pointer"="all" "less-precise-fpmad"="false" "no-infs-fp-math"="false" "no-nans-fp-math"="false" "no-signed-zeros-fp-math"="false" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "unsafe-fp-math"="false" "use-soft-float"="false" }
+attributes #0 = { noinline optnone uwtable "correctly-rounded-divide-sqrt-fp-math"="false" "disable-tail-calls"="false" "frame-pointer"="all" "less-precise-fpmad"="false" "min-legal-vector-width"="0" "no-infs-fp-math"="false" "no-jump-tables"="false" "no-nans-fp-math"="false" "no-signed-zeros-fp-math"="false" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "use-soft-float"="false" }
+attributes #1 = { "correctly-rounded-divide-sqrt-fp-math"="false" "disable-tail-calls"="false" "frame-pointer"="all" "less-precise-fpmad"="false" "no-infs-fp-math"="false" "no-nans-fp-math"="false" "no-signed-zeros-fp-math"="false" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "use-soft-float"="false" }
 
 !llvm.module.flags = !{!0}
 !llvm.ident = !{!1}
diff --git a/lld/test/MachO/lto-mattrs.ll b/lld/test/MachO/lto-mattrs.ll
index f658b485a1792..41313296dc269 100644
--- a/lld/test/MachO/lto-mattrs.ll
+++ b/lld/test/MachO/lto-mattrs.ll
@@ -33,4 +33,4 @@ define float @foo(float %x) #0 {
   ret float %div
 }
 
-attributes #0 = { "unsafe-fp-math"="true" "reciprocal-estimates"="divf,vec-divf" }
+attributes #0 = { "reciprocal-estimates"="divf,vec-divf" }
diff --git a/lld/test/wasm/Inputs/debuginfo1.ll b/lld/test/wasm/Inputs/debuginfo1.ll
index d6db88002ce1e..0a1c42a214f2c 100644
--- a/lld/test/wasm/Inputs/debuginfo1.ll
+++ b/lld/test/wasm/Inputs/debuginfo1.ll
@@ -35,9 +35,9 @@ declare void @foo(i32) local_unnamed_addr #2
 ; Function Attrs: nounwind readnone speculatable
 declare void @llvm.dbg.value(metadata, metadata, metadata) #3
 
-attributes #0 = { nounwind readnone "correctly-rounded-divide-sqrt-fp-math"="false" "disable-tail-calls"="false" "less-precise-fpmad"="false" "frame-pointer"="none" "no-infs-fp-math"="false" "no-jump-tables"="false" "no-nans-fp-math"="false" "no-signed-zeros-fp-math"="false" "no-trapping-math"="false" "stack-protector-buffer-size"="8" "target-cpu"="generic" "unsafe-fp-math"="false" "use-soft-float"="false" }
-attributes #1 = { nounwind "correctly-rounded-divide-sqrt-fp-math"="false" "disable-tail-calls"="false" "less-precise-fpmad"="false" "frame-pointer"="none" "no-infs-fp-math"="false" "no-jump-tables"="false" "no-nans-fp-math"="false" "no-signed-zeros-fp-math"="false" "no-trapping-math"="false" "stack-protector-buffer-size"="8" "target-cpu"="generic" "unsafe-fp-math"="false" "use-soft-float"="false" }
-attributes #2 = { "correctly-rounded-divide-sqrt-fp-math"="false" "disable-tail-calls"="false" "less-precise-fpmad"="false" "frame-pointer"="none" "no-infs-fp-math"="false" "no-nans-fp-math"="false" "no-signed-zeros-fp-math"="false" "no-trapping-math"="false" "stack-protector-buffer-size"="8" "target-cpu"="generic" "unsafe-fp-math"="false" "use-soft-float"="false" }
+attributes #0 = { nounwind readnone "correctly-rounded-divide-sqrt-fp-math"="false" "disable-tail-calls"="false" "less-precise-fpmad"="false" "frame-pointer"="none" "no-infs-fp-math"="false" "no-jump-tables"="false" "no-nans-fp-math"="false" "no-signed-zeros-fp-math"="false" "no-trapping-math"="false" "stack-protector-buffer-size"="8" "target-cpu"="generic" "use-soft-float"="false" }
+attributes #1 = { nounwind "correctly-rounded-divide-sqrt-fp-math"="false" "disable-tail-calls"="false" "less-precise-fpmad"="false" "frame-pointer"="none" "no-infs-fp-math"="false" "no-jump-tables"="false" "no-nans-fp-math"="false" "no-signed-zeros-fp-math"="false" "no-trapping-math"="false" "stack-protector-buffer-size"="8" "target-cpu"="generic" "use-soft-float"="false" }
+attributes #2 = { "correctly-rounded-divide-sqrt-fp-math"="false" "disable-tail-calls"="false" "less-precise-fpmad"="false" "frame-pointer"="none" "no-infs-fp-math"="false" "no-nans-fp-math"="false" "no-signed-zeros-fp-math"="false" "no-trapping-math"="false" "stack-protector-buffer-size"="8" "target-cpu"="generic" "use-soft-float"="false" }
 attributes #3 = { nounwind readnone speculatable }
 attributes #4 = { nounwind }
 
diff --git a/lld/test/wasm/Inputs/debuginfo2.ll b/lld/test/wasm/Inputs/debuginfo2.ll
index 1b63dd57474e5..c832be521e325 100644
--- a/lld/test/wasm/Inputs/debuginfo2.ll
+++ b/lld/test/wasm/Inputs/debuginfo2.ll
@@ -31,7 +31,7 @@ entry:
 ; Function Attrs: nounwind readnone speculatable
 declare void @llvm.dbg.value(metadata, metadata, metadata) #1
 
-attributes #0 = { nounwind "correctly-rounded-divide-sqrt-fp-math"="false" "disable-tail-calls"="false" "less-precise-fpmad"="false" "frame-pointer"="none" "no-infs-fp-math"="false" "no-jump-tables"="false" "no-nans-fp-math"="false" "no-signed-zeros-fp-math"="false" "no-trapping-math"="false" "stack-protector-buffer-size"="8" "target-cpu"="generic" "unsafe-fp-math"="false" "use-soft-float"="false" }
+attributes #0 = { nounwind "correctly-rounded-divide-sqrt-fp-math"="false" "disable-tail-calls"="false" "less-precise-fpmad"="false" "frame-pointer"="none" "no-infs-fp-math"="false" "no-jump-tables"="false" "no-nans-fp-math"="false" "no-signed-zeros-fp-math"="false" "no-trapping-math"="false" "stack-protector-buffer-size"="8" "target-cpu"="generic" "use-soft-float"="false" }
 attributes #1 = { nounwind readnone speculatable }
 
 !llvm.dbg.cu = !{!2}
diff --git a/lld/test/wasm/debug-removed-fn.ll b/lld/test/wasm/debug-removed-fn.ll
index 8dae48a136dc4..20c30346cc0e7 100644
--- a/lld/test/wasm/debug-removed-fn.ll
+++ b/lld/test/wasm/debug-removed-fn.ll
@@ -28,7 +28,7 @@ entry:
   ret i32 6, !dbg !13
 }
 
-attributes #0 = { noinline nounwind optnone "correctly-rounded-divide-sqrt-fp-math"="false" "disable-tail-calls"="false" "less-precise-fpmad"="false" "frame-pointer"="none" "no-infs-fp-math"="false" "no-jump-tables"="false" "no-nans-fp-math"="false" "no-signed-zeros-fp-math"="false" "no-trapping-math"="false" "stack-protector-buffer-size"="8" "target-cpu"="generic" "unsafe-fp-math"="false" "use-soft-float"="false" }
+attributes #0 = { noinline nounwind optnone "correctly-rounded-divide-sqrt-fp-math"="false" "disable-tail-calls"="false" "less-precise-fpmad"="false" "frame-pointer"="none" "no-infs-fp-math"="false" "no-jump-tables"="false" "no-nans-fp-math"="false" "no-signed-zeros-fp-math"="false" "no-trapping-math"="false" "stack-protector-buffer-size"="8" "target-cpu"="generic" "use-soft-float"="false" }
 
 !llvm.dbg.cu = !{!0}
 !llvm.module.flags = !{!3, !4, !5}
diff --git a/llvm/docs/CommandGuide/llc.rst b/llvm/docs/CommandGuide/llc.rst
index 900649f59c401..cc670f6043656 100644
--- a/llvm/docs/CommandGuide/llc.rst
+++ b/llvm/docs/CommandGuide/llc.rst
@@ -125,13 +125,6 @@ End-user Options
 
  Enable setting the FP exceptions build attribute not to use exceptions.
 
-.. option:: --enable-unsafe-fp-math
-
- Enable optimizations that make unsafe assumptions about IEEE math (e.g. that
- addition is associative) or may not work for all input ranges.  These
- optimizations allow the code generator to make use of some instructions which
- would otherwise not be usable (such as ``fsin`` on X86).
-
 .. option:: --stats
 
  Print statistics recorded by code-generation passes.
diff --git a/llvm/docs/CommandGuide/lli.rst b/llvm/docs/CommandGuide/lli.rst
index 94c001380441f..8afe10db05d48 100644
--- a/llvm/docs/CommandGuide/lli.rst
+++ b/llvm/docs/CommandGuide/lli.rst
@@ -107,11 +107,6 @@ FLOATING POINT OPTIONS
 
  Enable optimizations that assume no NAN values.
 
-.. option:: -enable-unsafe-fp-math
-
- Causes :program:`lli` to enable optimizations that may decrease floating point
- precision.
-
 .. option:: -soft-float
 
  Causes :program:`lli` to generate software floating point library calls instead of
diff --git a/llvm/docs/SourceLevelDebugging.rst b/llvm/docs/SourceLevelDebugging.rst
index f057b2d2d2e36..12b5e3e549df7 100644
--- a/llvm/docs/SourceLevelDebugging.rst
+++ b/llvm/docs/SourceLevelDebugging.rst
@@ -674,7 +674,7 @@ Compiled to LLVM, this function would be represented like this:
     ret void, !dbg !24
   }
 
-  attributes #0 = { nounwind ssp uwtable "less-precise-fpmad"="false" "frame-pointer"="all" "no-infs-fp-math"="false" "no-nans-fp-math"="false" "stack-protector-buffer-size"="8" "unsafe-fp-math"="false" "use-soft-float"="false" }
+  attributes #0 = { nounwind ssp uwtable "less-precise-fpmad"="false" "frame-pointer"="all" "no-infs-fp-math"="false" "no-nans-fp-math"="false" "stack-protector-buffer-size"="8" "use-soft-float"="false" }
   attributes #1 = { nounwind readnone }
 
   !llvm.dbg.cu = !{!0}
diff --git a/llvm/include/llvm/CodeGen/CommandFlags.h b/llvm/include/llvm/CodeGen/CommandFlags.h
index 39c5a8d479a5f..af66f2d5776ba 100644
--- a/llvm/include/llvm/CodeGen/CommandFlags.h
+++ b/llvm/include/llvm/CodeGen/CommandFlags.h
@@ -58,8 +58,6 @@ LLVM_ABI CodeGenFileType getFileType();
 
 LLVM_ABI FramePointerKind getFramePointerUsage();
 
-LLVM_ABI bool getEnableUnsafeFPMath();
-
 LLVM_ABI bool getEnableNoInfsFPMath();
 
 LLVM_ABI bool getEnableNoNaNsFPMath();
diff --git a/llvm/include/llvm/IR/Attributes.td b/llvm/include/llvm/IR/Attributes.td
index 8e7d9dcebfe2a..8ce2b1bea8fac 100644
--- a/llvm/include/llvm/IR/Attributes.td
+++ b/llvm/include/llvm/IR/Attributes.td
@@ -410,7 +410,6 @@ def LessPreciseFPMAD : StrBoolAttr<"less-precise-fpmad">;
 def NoInfsFPMath : StrBoolAttr<"no-infs-fp-math">;
 def NoNansFPMath : StrBoolAttr<"no-nans-fp-math">;
 def NoSignedZerosFPMath : StrBoolAttr<"no-signed-zeros-fp-math">;
-def UnsafeFPMath : StrBoolAttr<"unsafe-fp-math">;
 def NoJumpTables : StrBoolAttr<"no-jump-tables">;
 def NoInlineLineTables : StrBoolAttr<"no-inline-line-tables">;
 def ProfileSampleAccurate : StrBoolAttr<"profile-sample-accurate">;
@@ -474,7 +473,6 @@ def : MergeRule<"setAND<LessPreciseFPMADAttr>">;
 def : MergeRule<"setAND<NoInfsFPMathAttr>">;
 def : MergeRule<"setAND<NoNansFPMathAttr>">;
 def : MergeRule<"setAND<NoSignedZerosFPMathAttr>">;
-def : MergeRule<"setAND<UnsafeFPMathAttr>">;
 def : MergeRule<"setOR<NoImplicitFloatAttr>">;
 def : MergeRule<"setOR<NoJumpTablesAttr>">;
 def : MergeRule<"setOR<ProfileSampleAccurateAttr>">;
diff --git a/llvm/include/llvm/Target/TargetOptions.h b/llvm/include/llvm/Target/TargetOptions.h
index 2c2122a7b204f..bfd2817b8d1f5 100644
--- a/llvm/include/llvm/Target/TargetOptions.h
+++ b/llvm/include/llvm/Target/TargetOptions.h
@@ -118,9 +118,8 @@ enum CodeObjectVersionKind {
 class TargetOptions {
 public:
   TargetOptions()
-      : UnsafeFPMath(false), NoInfsFPMath(false), NoNaNsFPMath(false),
-        NoTrappingFPMath(true), NoSignedZerosFPMath(false),
-        EnableAIXExtendedAltivecABI(false),
+      : NoInfsFPMath(false), NoNaNsFPMath(false), NoTrappingFPMath(true),
+        NoSignedZerosFPMath(false), EnableAIXExtendedAltivecABI(false),
         HonorSignDependentRoundingFPMathOption(false), NoZerosInBSS(false),
         GuaranteedTailCallOpt(false), StackSymbolOrdering(true),
         EnableFastISel(false), EnableGlobalISel(false), UseInitArray(false),
@@ -156,13 +155,6 @@ class TargetOptions {
   /// MCAsmInfo::BinutilsVersion.
   std::pair<int, int> BinutilsVersion{0, 0};
 
-  /// UnsafeFPMath - This flag is enabled when the
-  /// -enable-unsafe-fp-math flag is specified on the command line.  When
-  /// this flag is off (the default), the code generator is not allowed to
-  /// produce results that are "less precise" than IEEE allows.  This includes
-  /// use of X86 instructions like FSIN and FCOS instead of libcalls.
-  unsigned UnsafeFPMath : 1;
-
   /// NoInfsFPMath - This flag is enabled when the
   /// -enable-no-infs-fp-math flag is specified on the command line. When
   /// this flag is off (the default), the code generator is not allowed to
diff --git a/llvm/lib/CodeGen/CommandFlags.cpp b/llvm/lib/CodeGen/CommandFlags.cpp
index 0522698adf183..c1365f499dcf5 100644
--- a/llvm/lib/CodeGen/CommandFlags.cpp
+++ b/llvm/lib/CodeGen/CommandFlags.cpp
@@ -64,7 +64,6 @@ CGOPT_EXP(uint64_t, LargeDataThreshold)
 CGOPT(ExceptionHandling, ExceptionModel)
 CGOPT_EXP(CodeGenFileType, FileType)
 CGOPT(FramePointerKind, FramePointerUsage)
-CGOPT(bool, EnableUnsafeFPMath)
 CGOPT(bool, EnableNoInfsFPMath)
 CGOPT(bool, EnableNoNaNsFPMath)
 CGOPT(bool, EnableNoSignedZerosFPMath)
@@ -219,12 +218,6 @@ codegen::RegisterCodeGenFlags::RegisterCodeGenFlags() {
                      "Enable frame pointer elimination")));
   CGBINDOPT(FramePointerUsage);
 
-  static cl::opt<bool> EnableUnsafeFPMath(
-      "enable-unsafe-fp-math",
-      cl::desc("Enable optimizations that may decrease FP precision"),
-      cl::init(false));
-  CGBINDOPT(EnableUnsafeFPMath);
-
   static cl::opt<bool> EnableNoInfsFPMath(
       "enable-no-infs-fp-math",
       cl::desc("Enable FP math optimizations that assume no +-Infs"),
@@ -552,7 +545,6 @@ TargetOptions
 codegen::InitTargetOptionsFromCodeGenFlags(const Triple &TheTriple) {
   TargetOptions Options;
   Options.AllowFPOpFusion = getFuseFPOps();
-  Options.UnsafeFPMath = getEnableUnsafeFPMath();
   Options.NoInfsFPMath = getEnableNoInfsFPMath();
   Options.NoNaNsFPMath = getEnableNoNaNsFPMath();
   Options.NoSignedZerosFPMath = getEnableNoSignedZerosFPMath();
@@ -706,7 +698,6 @@ void codegen::setFunctionAttributes(StringRef CPU, StringRef Features,
   if (getStackRealign())
     NewAttrs.addAttribute("stackrealign");
 
-  HANDLE_BOOL_ATTR(EnableUnsafeFPMathView, "unsafe-fp-math");
   HANDLE_BOOL_ATTR(EnableNoInfsFPMathView, "no-infs-fp-math");
   HANDLE_BOOL_ATTR(EnableNoNaNsFPMathView, "no-nans-fp-math");
   HANDLE_BOOL_ATTR(EnableNoSignedZerosFPMathView, "no-signed-zeros-fp-math");
diff --git a/llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp b/llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp
index 310d35d9b1d1e..d05a6506f9677 100644
--- a/llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp
+++ b/llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp
@@ -17462,9 +17462,9 @@ SDValue DAGCombiner::visitFSUBForFMACombine(SDNode *N) {
   // fold (fsub (fpext (fneg (fmul, x, y))), z)
   //   -> (fneg (fma (fpext x), (fpext y), z))
   // Note: This could be removed with appropriate canonicalization of the
-  // input expression into (fneg (fadd (fpext (fmul, x, y)), z). However, the
-  // orthogonal flags -fp-contract=fast and -enable-unsafe-fp-math prevent
-  // from implementing the canonicalization in visitFSUB.
+  // input expression into (fneg (fadd (fpext (fmul, x, y)), z). However,
+  // -fp-contract=fast prevent from implementing the canonicalization
+  // in visitFSUB.
   if (matcher.match(N0, ISD::FP_EXTEND)) {
     SDValue N00 = N0.getOperand(0);
     if (matcher.match(N00, ISD::FNEG)) {
@@ -17486,9 +17486,9 @@ SDValue DAGCombiner::visitFSUBForFMACombine(SDNode *N) {
   // fold (fsub (fneg (fpext (f...
[truncated]

@llvmbot
Copy link
Member

llvmbot commented Oct 21, 2025

@llvm/pr-subscribers-debuginfo

Author: None (paperchalice)

Changes

These global flags block furthur improvements for clang, users should always use fast-math flags
see also https://discourse.llvm.org/t/rfc-honor-pragmas-with-ffp-contract-fast/80797


Patch is 1.41 MiB, truncated to 20.00 KiB below, full version: https://github.com/llvm/llvm-project/pull/164400.diff

1005 Files Affected:

  • (modified) clang/lib/CodeGen/BackendUtil.cpp (-6)
  • (modified) lld/test/COFF/Inputs/undefined-symbol-lto-a.ll (+2-2)
  • (modified) lld/test/COFF/Inputs/undefined-symbol-lto-b.ll (+1-1)
  • (modified) lld/test/COFF/Inputs/undefined-symbol-multi-lto.ll (+2-2)
  • (modified) lld/test/MachO/lto-mattrs.ll (+1-1)
  • (modified) lld/test/wasm/Inputs/debuginfo1.ll (+3-3)
  • (modified) lld/test/wasm/Inputs/debuginfo2.ll (+1-1)
  • (modified) lld/test/wasm/debug-removed-fn.ll (+1-1)
  • (modified) llvm/docs/CommandGuide/llc.rst (-7)
  • (modified) llvm/docs/CommandGuide/lli.rst (-5)
  • (modified) llvm/docs/SourceLevelDebugging.rst (+1-1)
  • (modified) llvm/include/llvm/CodeGen/CommandFlags.h (-2)
  • (modified) llvm/include/llvm/IR/Attributes.td (-2)
  • (modified) llvm/include/llvm/Target/TargetOptions.h (+2-10)
  • (modified) llvm/lib/CodeGen/CommandFlags.cpp (-9)
  • (modified) llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp (+6-6)
  • (modified) llvm/lib/CodeGen/TargetOptionsImpl.cpp (+1-1)
  • (modified) llvm/lib/Target/TargetMachine.cpp (-1)
  • (modified) llvm/lib/Transforms/Instrumentation/NumericalStabilitySanitizer.cpp (-1)
  • (modified) llvm/test/Analysis/BranchProbabilityInfo/pr22718.ll (+3-3)
  • (modified) llvm/test/Analysis/CostModel/SystemZ/intrinsic-cost-crash.ll (+1-1)
  • (modified) llvm/test/Analysis/Delinearization/constant_functions_multi_dim.ll (+2-2)
  • (modified) llvm/test/Analysis/DependenceAnalysis/MIVCheckConst.ll (+1-1)
  • (modified) llvm/test/Analysis/DependenceAnalysis/NonCanonicalizedSubscript.ll (+1-1)
  • (modified) llvm/test/Analysis/MemoryDependenceAnalysis/invariant.group-bug.ll (+2-2)
  • (modified) llvm/test/Analysis/MemorySSA/pr28880.ll (+1-1)
  • (modified) llvm/test/Analysis/MemorySSA/pr39197.ll (+1-1)
  • (modified) llvm/test/Analysis/MemorySSA/pr40038.ll (+1-1)
  • (modified) llvm/test/Analysis/MemorySSA/pr43569.ll (+1-1)
  • (modified) llvm/test/Analysis/ScalarEvolution/pr22674.ll (+1-1)
  • (modified) llvm/test/Analysis/ScalarEvolution/scev-canonical-mode.ll (+1-1)
  • (modified) llvm/test/Analysis/TypeBasedAliasAnalysis/PR17620.ll (+2-2)
  • (modified) llvm/test/Analysis/TypeBasedAliasAnalysis/tbaa-path.ll (+1-1)
  • (modified) llvm/test/Bitcode/DILocation-implicit-code.ll (+2-2)
  • (modified) llvm/test/Bitcode/drop-debug-info.3.5.ll (+1-1)
  • (modified) llvm/test/Bitcode/upgrade-tbaa.ll (+1-1)
  • (modified) llvm/test/CodeGen/AArch64/GlobalISel/inline-memcpy.mir (+1-1)
  • (modified) llvm/test/CodeGen/AArch64/GlobalISel/inline-memmove.mir (+1-1)
  • (modified) llvm/test/CodeGen/AArch64/GlobalISel/inline-memset.mir (+1-1)
  • (modified) llvm/test/CodeGen/AArch64/aarch64-2014-08-11-MachineCombinerCrash.ll (+1-1)
  • (modified) llvm/test/CodeGen/AArch64/aarch64-a57-fp-load-balancing.ll (+2-2)
  • (modified) llvm/test/CodeGen/AArch64/aarch64-dynamic-stack-layout.ll (+2-2)
  • (modified) llvm/test/CodeGen/AArch64/aarch64-fix-cortex-a53-835769.ll (+2-2)
  • (modified) llvm/test/CodeGen/AArch64/aarch64-mov-debug-locs.mir (+2-2)
  • (modified) llvm/test/CodeGen/AArch64/arm64-detect-vec-redux.ll (+1-1)
  • (modified) llvm/test/CodeGen/AArch64/arm64-fma-combine-with-fpfusion.ll (+1-1)
  • (modified) llvm/test/CodeGen/AArch64/arm64-fma-combines.ll (+1-1)
  • (modified) llvm/test/CodeGen/AArch64/arm64-indexed-vector-ldst-2.ll (+1-1)
  • (modified) llvm/test/CodeGen/AArch64/arm64-misched-basic-A53.ll (+1-1)
  • (modified) llvm/test/CodeGen/AArch64/arm64-misched-basic-A57.ll (+1-1)
  • (modified) llvm/test/CodeGen/AArch64/arm64-rounding.ll (+1-1)
  • (modified) llvm/test/CodeGen/AArch64/arm64-storebytesmerge.ll (+2-2)
  • (modified) llvm/test/CodeGen/AArch64/arm64-triv-disjoint-mem-access.ll (+1-1)
  • (modified) llvm/test/CodeGen/AArch64/bti-branch-relaxation.ll (+1-1)
  • (modified) llvm/test/CodeGen/AArch64/consthoist-gep.ll (+1-1)
  • (modified) llvm/test/CodeGen/AArch64/csel-zero-float.ll (+1-1)
  • (modified) llvm/test/CodeGen/AArch64/dag-combine-invaraints.ll (+2-2)
  • (modified) llvm/test/CodeGen/AArch64/partial-pipeline-execution.ll (+1-1)
  • (modified) llvm/test/CodeGen/AArch64/recp-fastmath.ll (+2-2)
  • (modified) llvm/test/CodeGen/AArch64/stack-tagging-ex-1.ll (+1-1)
  • (modified) llvm/test/CodeGen/AArch64/stack-tagging-ex-2.ll (+2-2)
  • (modified) llvm/test/CodeGen/AArch64/stack-tagging-untag-placement.ll (+1-1)
  • (modified) llvm/test/CodeGen/AArch64/stack_guard_remat.ll (+1-1)
  • (modified) llvm/test/CodeGen/AArch64/svtcf-fmul-fdiv-combine.ll (+1-1)
  • (modified) llvm/test/CodeGen/AArch64/vector_merge_dep_check.ll (+1-1)
  • (modified) llvm/test/CodeGen/AArch64/wineh-frame5.mir (+2-2)
  • (modified) llvm/test/CodeGen/AArch64/wineh-frame6.mir (+2-2)
  • (modified) llvm/test/CodeGen/AArch64/wineh-frame7.mir (+2-2)
  • (modified) llvm/test/CodeGen/AArch64/wineh-frame8.mir (+1-1)
  • (modified) llvm/test/CodeGen/AArch64/wineh5.mir (+2-2)
  • (modified) llvm/test/CodeGen/AArch64/wineh_shrinkwrap.mir (+2-2)
  • (modified) llvm/test/CodeGen/AMDGPU/GlobalISel/combine-fma-unmerge-values.mir (+1-1)
  • (modified) llvm/test/CodeGen/AMDGPU/GlobalISel/inst-select-fract.f64.mir (+2-2)
  • (modified) llvm/test/CodeGen/AMDGPU/combine_andor_with_cmps.ll (+1-1)
  • (modified) llvm/test/CodeGen/AMDGPU/fadd-fma-fmul-combine.ll (+4-4)
  • (modified) llvm/test/CodeGen/AMDGPU/fdiv.f64.ll (+1-1)
  • (modified) llvm/test/CodeGen/AMDGPU/fmad-formation-fmul-distribute-denormal-mode.ll (+1-1)
  • (modified) llvm/test/CodeGen/AMDGPU/fmed3.bf16.ll (+2-2)
  • (modified) llvm/test/CodeGen/AMDGPU/fmed3.ll (+1-1)
  • (modified) llvm/test/CodeGen/AMDGPU/fneg-combines.legal.f16.ll (+1-1)
  • (modified) llvm/test/CodeGen/AMDGPU/fneg-combines.ll (+1-1)
  • (modified) llvm/test/CodeGen/AMDGPU/fpext.f16.ll (+5-5)
  • (modified) llvm/test/CodeGen/AMDGPU/fptosi.f16.ll (+4-4)
  • (modified) llvm/test/CodeGen/AMDGPU/fptoui.f16.ll (+4-4)
  • (modified) llvm/test/CodeGen/AMDGPU/fptrunc.ll (+4-4)
  • (modified) llvm/test/CodeGen/AMDGPU/fract.f64.ll (+2-2)
  • (modified) llvm/test/CodeGen/AMDGPU/fract.ll (+2-2)
  • (modified) llvm/test/CodeGen/AMDGPU/frem.ll (+2-2)
  • (modified) llvm/test/CodeGen/AMDGPU/fsqrt.f64.ll (+1-2)
  • (modified) llvm/test/CodeGen/AMDGPU/fsqrt.r600.ll (+1-1)
  • (modified) llvm/test/CodeGen/AMDGPU/inline-attr.ll (+9-9)
  • (modified) llvm/test/CodeGen/AMDGPU/llvm.exp2.ll (+1-1)
  • (modified) llvm/test/CodeGen/AMDGPU/llvm.log2.ll (+1-1)
  • (modified) llvm/test/CodeGen/AMDGPU/minmax.ll (+1-1)
  • (modified) llvm/test/CodeGen/AMDGPU/prevent-fmul-hoist-ir.ll (+1-1)
  • (modified) llvm/test/CodeGen/AMDGPU/sitofp.f16.ll (+4-4)
  • (modified) llvm/test/CodeGen/AMDGPU/uitofp.f16.ll (+4-4)
  • (modified) llvm/test/CodeGen/ARM/2014-05-14-DwarfEHCrash.ll (+1-1)
  • (modified) llvm/test/CodeGen/ARM/ARMLoadStoreDBG.mir (+2-2)
  • (modified) llvm/test/CodeGen/ARM/Windows/wineh-basic.ll (+2-2)
  • (modified) llvm/test/CodeGen/ARM/byval_load_align.ll (+2-2)
  • (modified) llvm/test/CodeGen/ARM/cfguard-module-flag.ll (+1-1)
  • (modified) llvm/test/CodeGen/ARM/clang-section.ll (+2-2)
  • (modified) llvm/test/CodeGen/ARM/cmse-clear-float-bigend.mir (+1-1)
  • (modified) llvm/test/CodeGen/ARM/coalesce-dbgvalue.ll (+2-2)
  • (modified) llvm/test/CodeGen/ARM/constantpool-promote-dbg.ll (+1-1)
  • (modified) llvm/test/CodeGen/ARM/constantpool-promote.ll (+2-2)
  • (modified) llvm/test/CodeGen/ARM/early-cfi-sections.ll (+1-1)
  • (modified) llvm/test/CodeGen/ARM/fp16-vld.ll (+1-1)
  • (modified) llvm/test/CodeGen/ARM/global-merge-1.ll (+3-3)
  • (modified) llvm/test/CodeGen/ARM/isel-v8i32-crash.ll (+1-1)
  • (modified) llvm/test/CodeGen/ARM/out-of-registers.ll (+1-1)
  • (modified) llvm/test/CodeGen/ARM/relax-per-target-feature.ll (+1-1)
  • (modified) llvm/test/CodeGen/ARM/softfp-constant-comparison.ll (+1-1)
  • (modified) llvm/test/CodeGen/ARM/stack-protector-bmovpcb_call.ll (+2-2)
  • (modified) llvm/test/CodeGen/ARM/stack_guard_remat.ll (+1-1)
  • (modified) llvm/test/CodeGen/ARM/struct-byval-frame-index.ll (+1-1)
  • (modified) llvm/test/CodeGen/ARM/subtarget-align.ll (+1-1)
  • (modified) llvm/test/CodeGen/ARM/unschedule-first-call.ll (+1-1)
  • (modified) llvm/test/CodeGen/ARM/vector-spilling.ll (+1-1)
  • (modified) llvm/test/CodeGen/ARM/vldm-sched-a9.ll (+1-1)
  • (modified) llvm/test/CodeGen/BPF/BTF/binary-format.ll (+1-1)
  • (modified) llvm/test/CodeGen/BPF/BTF/builtin-btf-type-id.ll (+1-1)
  • (modified) llvm/test/CodeGen/BPF/BTF/char-no-debuginfo.ll (+1-1)
  • (modified) llvm/test/CodeGen/BPF/BTF/extern-builtin.ll (+1-1)
  • (modified) llvm/test/CodeGen/BPF/BTF/extern-func-arg.ll (+2-2)
  • (modified) llvm/test/CodeGen/BPF/BTF/extern-global-var.ll (+1-1)
  • (modified) llvm/test/CodeGen/BPF/BTF/extern-var-func-weak-section.ll (+2-2)
  • (modified) llvm/test/CodeGen/BPF/BTF/extern-var-func-weak.ll (+2-2)
  • (modified) llvm/test/CodeGen/BPF/BTF/extern-var-func.ll (+2-2)
  • (modified) llvm/test/CodeGen/BPF/BTF/extern-var-section.ll (+2-2)
  • (modified) llvm/test/CodeGen/BPF/BTF/extern-var-struct-weak.ll (+1-1)
  • (modified) llvm/test/CodeGen/BPF/BTF/extern-var-struct.ll (+1-1)
  • (modified) llvm/test/CodeGen/BPF/BTF/extern-var-weak-section.ll (+2-2)
  • (modified) llvm/test/CodeGen/BPF/BTF/filename.ll (+1-1)
  • (modified) llvm/test/CodeGen/BPF/BTF/func-func-ptr.ll (+1-1)
  • (modified) llvm/test/CodeGen/BPF/BTF/func-non-void.ll (+1-1)
  • (modified) llvm/test/CodeGen/BPF/BTF/func-source.ll (+1-1)
  • (modified) llvm/test/CodeGen/BPF/BTF/func-typedef.ll (+1-1)
  • (modified) llvm/test/CodeGen/BPF/BTF/func-unused-arg.ll (+1-1)
  • (modified) llvm/test/CodeGen/BPF/BTF/func-void.ll (+1-1)
  • (modified) llvm/test/CodeGen/BPF/BTF/local-var-readonly-1.ll (+2-2)
  • (modified) llvm/test/CodeGen/BPF/BTF/local-var-readonly-2.ll (+2-2)
  • (modified) llvm/test/CodeGen/BPF/BTF/local-var.ll (+1-1)
  • (modified) llvm/test/CodeGen/BPF/BTF/pruning-const.ll (+2-2)
  • (modified) llvm/test/CodeGen/BPF/BTF/pruning-typedef.ll (+2-2)
  • (modified) llvm/test/CodeGen/BPF/BTF/static-func.ll (+3-3)
  • (modified) llvm/test/CodeGen/BPF/BTF/static-var-derived-type.ll (+1-1)
  • (modified) llvm/test/CodeGen/BPF/BTF/static-var-inited-sec.ll (+1-1)
  • (modified) llvm/test/CodeGen/BPF/BTF/static-var-inited.ll (+1-1)
  • (modified) llvm/test/CodeGen/BPF/BTF/static-var-readonly-sec.ll (+1-1)
  • (modified) llvm/test/CodeGen/BPF/BTF/static-var-readonly.ll (+1-1)
  • (modified) llvm/test/CodeGen/BPF/BTF/static-var-sec.ll (+1-1)
  • (modified) llvm/test/CodeGen/BPF/BTF/static-var-zerolen-array.ll (+1-1)
  • (modified) llvm/test/CodeGen/BPF/BTF/static-var.ll (+1-1)
  • (modified) llvm/test/CodeGen/BPF/BTF/struct-anon-2.ll (+1-1)
  • (modified) llvm/test/CodeGen/BPF/BTF/weak-global-2.ll (+1-1)
  • (modified) llvm/test/CodeGen/BPF/BTF/weak-global.ll (+1-1)
  • (modified) llvm/test/CodeGen/BPF/CORE/btf-id-duplicate.ll (+1-1)
  • (modified) llvm/test/CodeGen/BPF/CORE/field-reloc-alu32.ll (+1-1)
  • (modified) llvm/test/CodeGen/BPF/CORE/field-reloc-bitfield-1-bpfeb.ll (+1-1)
  • (modified) llvm/test/CodeGen/BPF/CORE/field-reloc-bitfield-1.ll (+1-1)
  • (modified) llvm/test/CodeGen/BPF/CORE/field-reloc-bitfield-2-bpfeb.ll (+1-1)
  • (modified) llvm/test/CodeGen/BPF/CORE/field-reloc-bitfield-2.ll (+1-1)
  • (modified) llvm/test/CodeGen/BPF/CORE/field-reloc-duplicate.ll (+1-1)
  • (modified) llvm/test/CodeGen/BPF/CORE/intrinsic-array-2.ll (+1-1)
  • (modified) llvm/test/CodeGen/BPF/CORE/intrinsic-array.ll (+2-2)
  • (modified) llvm/test/CodeGen/BPF/CORE/intrinsic-fieldinfo-byte-size-1.ll (+1-1)
  • (modified) llvm/test/CodeGen/BPF/CORE/intrinsic-fieldinfo-byte-size-2.ll (+1-1)
  • (modified) llvm/test/CodeGen/BPF/CORE/intrinsic-fieldinfo-byte-size-3.ll (+1-1)
  • (modified) llvm/test/CodeGen/BPF/CORE/intrinsic-fieldinfo-byte-size-4.ll (+1-1)
  • (modified) llvm/test/CodeGen/BPF/CORE/intrinsic-fieldinfo-existence-1.ll (+1-1)
  • (modified) llvm/test/CodeGen/BPF/CORE/intrinsic-fieldinfo-existence-2.ll (+1-1)
  • (modified) llvm/test/CodeGen/BPF/CORE/intrinsic-fieldinfo-existence-3.ll (+1-1)
  • (modified) llvm/test/CodeGen/BPF/CORE/intrinsic-fieldinfo-lshift-1-bpfeb.ll (+1-1)
  • (modified) llvm/test/CodeGen/BPF/CORE/intrinsic-fieldinfo-lshift-1.ll (+1-1)
  • (modified) llvm/test/CodeGen/BPF/CORE/intrinsic-fieldinfo-lshift-2.ll (+1-1)
  • (modified) llvm/test/CodeGen/BPF/CORE/intrinsic-fieldinfo-rshift-1.ll (+1-1)
  • (modified) llvm/test/CodeGen/BPF/CORE/intrinsic-fieldinfo-rshift-2.ll (+1-1)
  • (modified) llvm/test/CodeGen/BPF/CORE/intrinsic-fieldinfo-rshift-3.ll (+1-1)
  • (modified) llvm/test/CodeGen/BPF/CORE/intrinsic-fieldinfo-signedness-1.ll (+1-1)
  • (modified) llvm/test/CodeGen/BPF/CORE/intrinsic-fieldinfo-signedness-2.ll (+1-1)
  • (modified) llvm/test/CodeGen/BPF/CORE/intrinsic-fieldinfo-signedness-3.ll (+1-1)
  • (modified) llvm/test/CodeGen/BPF/CORE/intrinsic-struct.ll (+2-2)
  • (modified) llvm/test/CodeGen/BPF/CORE/intrinsic-typeinfo-enum-value.ll (+1-1)
  • (modified) llvm/test/CodeGen/BPF/CORE/intrinsic-typeinfo-type-exist.ll (+1-1)
  • (modified) llvm/test/CodeGen/BPF/CORE/intrinsic-typeinfo-type-size-1.ll (+1-1)
  • (modified) llvm/test/CodeGen/BPF/CORE/intrinsic-typeinfo-type-size-2.ll (+1-1)
  • (modified) llvm/test/CodeGen/BPF/CORE/intrinsic-union.ll (+2-2)
  • (modified) llvm/test/CodeGen/BPF/CORE/no-elf-ama-symbol.ll (+1-1)
  • (modified) llvm/test/CodeGen/BPF/CORE/no-narrow-load.ll (+2-2)
  • (modified) llvm/test/CodeGen/BPF/CORE/offset-reloc-access-str.ll (+2-2)
  • (modified) llvm/test/CodeGen/BPF/CORE/offset-reloc-basic.ll (+1-1)
  • (modified) llvm/test/CodeGen/BPF/CORE/offset-reloc-cast-array-1.ll (+2-2)
  • (modified) llvm/test/CodeGen/BPF/CORE/offset-reloc-cast-array-2.ll (+2-2)
  • (modified) llvm/test/CodeGen/BPF/CORE/offset-reloc-cast-struct-1.ll (+2-2)
  • (modified) llvm/test/CodeGen/BPF/CORE/offset-reloc-cast-struct-2.ll (+2-2)
  • (modified) llvm/test/CodeGen/BPF/CORE/offset-reloc-cast-struct-3.ll (+2-2)
  • (modified) llvm/test/CodeGen/BPF/CORE/offset-reloc-cast-union-1.ll (+2-2)
  • (modified) llvm/test/CodeGen/BPF/CORE/offset-reloc-cast-union-2.ll (+2-2)
  • (modified) llvm/test/CodeGen/BPF/CORE/offset-reloc-end-load.ll (+1-1)
  • (modified) llvm/test/CodeGen/BPF/CORE/offset-reloc-end-ret.ll (+1-1)
  • (modified) llvm/test/CodeGen/BPF/CORE/offset-reloc-fieldinfo-1.ll (+2-2)
  • (modified) llvm/test/CodeGen/BPF/CORE/offset-reloc-fieldinfo-2-bpfeb.ll (+1-1)
  • (modified) llvm/test/CodeGen/BPF/CORE/offset-reloc-fieldinfo-2.ll (+1-1)
  • (modified) llvm/test/CodeGen/BPF/CORE/offset-reloc-global-1.ll (+2-2)
  • (modified) llvm/test/CodeGen/BPF/CORE/offset-reloc-global-2.ll (+2-2)
  • (modified) llvm/test/CodeGen/BPF/CORE/offset-reloc-global-3.ll (+2-2)
  • (modified) llvm/test/CodeGen/BPF/CORE/offset-reloc-ignore.ll (+2-2)
  • (modified) llvm/test/CodeGen/BPF/CORE/offset-reloc-middle-chain.ll (+2-2)
  • (modified) llvm/test/CodeGen/BPF/CORE/offset-reloc-multi-array-1.ll (+2-2)
  • (modified) llvm/test/CodeGen/BPF/CORE/offset-reloc-multi-array-2.ll (+2-2)
  • (modified) llvm/test/CodeGen/BPF/CORE/offset-reloc-multilevel.ll (+1-1)
  • (modified) llvm/test/CodeGen/BPF/CORE/offset-reloc-pointer-1.ll (+2-2)
  • (modified) llvm/test/CodeGen/BPF/CORE/offset-reloc-pointer-2.ll (+2-2)
  • (modified) llvm/test/CodeGen/BPF/CORE/offset-reloc-struct-anonymous.ll (+1-1)
  • (modified) llvm/test/CodeGen/BPF/CORE/offset-reloc-struct-array.ll (+1-1)
  • (modified) llvm/test/CodeGen/BPF/CORE/offset-reloc-typedef-array.ll (+2-2)
  • (modified) llvm/test/CodeGen/BPF/CORE/offset-reloc-typedef-struct-2.ll (+1-1)
  • (modified) llvm/test/CodeGen/BPF/CORE/offset-reloc-typedef-struct.ll (+2-2)
  • (modified) llvm/test/CodeGen/BPF/CORE/offset-reloc-typedef-union-2.ll (+1-1)
  • (modified) llvm/test/CodeGen/BPF/CORE/offset-reloc-typedef-union.ll (+2-2)
  • (modified) llvm/test/CodeGen/BPF/CORE/offset-reloc-typedef.ll (+2-2)
  • (modified) llvm/test/CodeGen/BPF/CORE/offset-reloc-union.ll (+1-1)
  • (modified) llvm/test/CodeGen/BPF/CORE/store-addr.ll (+2-2)
  • (modified) llvm/test/CodeGen/BPF/adjust-opt-icmp1.ll (+2-2)
  • (modified) llvm/test/CodeGen/BPF/adjust-opt-icmp2.ll (+2-2)
  • (modified) llvm/test/CodeGen/BPF/adjust-opt-speculative1.ll (+2-2)
  • (modified) llvm/test/CodeGen/BPF/adjust-opt-speculative2.ll (+2-2)
  • (modified) llvm/test/CodeGen/BPF/callx.ll (+1-1)
  • (modified) llvm/test/CodeGen/BPF/dwarfdump.ll (+1-1)
  • (modified) llvm/test/CodeGen/BPF/i128.ll (+2-2)
  • (modified) llvm/test/CodeGen/BPF/is_trunc_free.ll (+2-2)
  • (modified) llvm/test/CodeGen/BPF/is_zext_free.ll (+1-1)
  • (modified) llvm/test/CodeGen/BPF/objdump_two_funcs.ll (+1-1)
  • (modified) llvm/test/CodeGen/BPF/optnone-1.ll (+1-1)
  • (modified) llvm/test/CodeGen/BPF/reloc-btf-2.ll (+1-1)
  • (modified) llvm/test/CodeGen/BPF/reloc-btf.ll (+1-1)
  • (modified) llvm/test/CodeGen/BPF/simplifycfg.ll (+2-2)
  • (modified) llvm/test/CodeGen/BPF/warn-stack.ll (+2-2)
  • (modified) llvm/test/CodeGen/BPF/xadd.ll (+1-1)
  • (modified) llvm/test/CodeGen/Generic/cfi-sections.ll (+2-2)
  • (modified) llvm/test/CodeGen/Hexagon/NVJumpCmp.ll (+1-1)
  • (modified) llvm/test/CodeGen/Hexagon/addh-sext-trunc.ll (+1-1)
  • (modified) llvm/test/CodeGen/Hexagon/alu64.ll (+1-1)
  • (modified) llvm/test/CodeGen/Hexagon/autohvx/fsplat.ll (+1-1)
  • (modified) llvm/test/CodeGen/Hexagon/autohvx/hfinsert.ll (+1-1)
  • (modified) llvm/test/CodeGen/Hexagon/autohvx/hfnosplat_cp.ll (+1-1)
  • (modified) llvm/test/CodeGen/Hexagon/autohvx/hfsplat.ll (+1-1)
  • (modified) llvm/test/CodeGen/Hexagon/base-offset-addr.ll (+1-1)
  • (modified) llvm/test/CodeGen/Hexagon/base-offset-post.ll (+1-1)
  • (modified) llvm/test/CodeGen/Hexagon/bit-loop-rc-mismatch.ll (+2-2)
  • (modified) llvm/test/CodeGen/Hexagon/bit-rie.ll (+1-1)
  • (modified) llvm/test/CodeGen/Hexagon/builtin-prefetch.ll (+1-1)
  • (modified) llvm/test/CodeGen/Hexagon/cfi-offset.ll (+1-1)
  • (modified) llvm/test/CodeGen/Hexagon/cmp-extend.ll (+1-1)
  • (modified) llvm/test/CodeGen/Hexagon/cmp.ll (+1-1)
  • (modified) llvm/test/CodeGen/Hexagon/constp-combine-neg.ll (+1-1)
  • (modified) llvm/test/CodeGen/Hexagon/constp-extract.ll (+1-1)
  • (modified) llvm/test/CodeGen/Hexagon/constp-physreg.ll (+1-1)
  • (modified) llvm/test/CodeGen/Hexagon/dead-store-stack.ll (+2-2)
  • (modified) llvm/test/CodeGen/Hexagon/early-if-conversion-bug1.ll (+2-2)
  • (modified) llvm/test/CodeGen/Hexagon/fminmax.ll (+1-1)
  • (modified) llvm/test/CodeGen/Hexagon/hexagon_vector_loop_carried_reuse.ll (+1-1)
  • (modified) llvm/test/CodeGen/Hexagon/hexagon_vector_loop_carried_reuse_constant.ll (+1-1)
  • (modified) llvm/test/CodeGen/Hexagon/hwloop-crit-edge.ll (+1-1)
  • (modified) llvm/test/CodeGen/Hexagon/hwloop-preheader.ll (+1-1)
  • (modified) llvm/test/CodeGen/Hexagon/intrinsics-v67.ll (+1-1)
  • (modified) llvm/test/CodeGen/Hexagon/jt-in-text.ll (+1-1)
  • (modified) llvm/test/CodeGen/Hexagon/ldst_vector_offset.ll (+1-1)
  • (modified) llvm/test/CodeGen/Hexagon/loopIdiom.ll (+1-1)
  • (modified) llvm/test/CodeGen/Hexagon/loop_align_count.ll (+1-1)
  • (modified) llvm/test/CodeGen/Hexagon/mem-fi-add.ll (+2-2)
  • (modified) llvm/test/CodeGen/Hexagon/memops-stack.ll (+2-2)
  • (modified) llvm/test/CodeGen/Hexagon/pic-regusage.ll (+1-1)
  • (modified) llvm/test/CodeGen/Hexagon/postinc-offset.ll (+1-1)
  • (modified) llvm/test/CodeGen/Hexagon/rdf-dead-loop.ll (+1-1)
  • (modified) llvm/test/CodeGen/Hexagon/rdf-inline-asm-fixed.ll (+1-1)
  • (modified) llvm/test/CodeGen/Hexagon/rdf-inline-asm.ll (+1-1)
  • (modified) llvm/test/CodeGen/Hexagon/reg-scavengebug-3.ll (+2-2)
  • (modified) llvm/test/CodeGen/Hexagon/runtime-stkchk.ll (+2-2)
  • (modified) llvm/test/CodeGen/Hexagon/sdr-shr32.ll (+1-1)
  • (modified) llvm/test/CodeGen/Hexagon/switch-lut-explicit-section.ll (+1-1)
  • (modified) llvm/test/CodeGen/Hexagon/switch-lut-function-section.ll (+1-1)
  • (modified) llvm/test/CodeGen/Hexagon/switch-lut-multiple-functions.ll (+1-1)
  • (modified) llvm/test/CodeGen/Hexagon/switch-lut-text-section.ll (+1-1)
  • (modified) llvm/test/CodeGen/Hexagon/swp-epilog-phi10.ll (+1-1)
  • (modified) llvm/test/CodeGen/Hexagon/swp-phi.ll (+1-1)
  • (modified) llvm/test/CodeGen/Hexagon/swp-pragma-disable-bug.ll (+1-1)
  • (modified) llvm/test/CodeGen/Hexagon/swp-prolog-phi4.ll (+1-1)
  • (modified) llvm/test/CodeGen/Hexagon/swp-stages4.ll (+1-1)
  • (modified) llvm/test/CodeGen/Hexagon/usr-ovf-dep.ll (+1-1)
  • (modified) llvm/test/CodeGen/Hexagon/v6-haar-balign32.ll (+1-1)
  • (modified) llvm/test/CodeGen/Hexagon/v60Intrins.ll (+1-1)
  • (modified) llvm/test/CodeGen/Hexagon/v60small.ll (+1-1)
  • (modified) llvm/test/CodeGen/Hexagon/v6vec-vprint.ll (+1-1)
  • (modified) llvm/test/CodeGen/Hexagon/vec-pred-spill1.ll (+2-2)
  • (modified) llvm/test/CodeGen/Hexagon/vect-regpairs.ll (+1-1)
diff --git a/clang/lib/CodeGen/BackendUtil.cpp b/clang/lib/CodeGen/BackendUtil.cpp
index 602068436101b..ecfbcb5970092 100644
--- a/clang/lib/CodeGen/BackendUtil.cpp
+++ b/clang/lib/CodeGen/BackendUtil.cpp
@@ -430,12 +430,6 @@ static bool initTargetOptions(const CompilerInstance &CI,
   Options.NoInfsFPMath = LangOpts.NoHonorInfs;
   Options.NoNaNsFPMath = LangOpts.NoHonorNaNs;
   Options.NoZerosInBSS = CodeGenOpts.NoZeroInitializedInBSS;
-  Options.UnsafeFPMath = LangOpts.AllowFPReassoc && LangOpts.AllowRecip &&
-                         LangOpts.NoSignedZero && LangOpts.ApproxFunc &&
-                         (LangOpts.getDefaultFPContractMode() ==
-                              LangOptions::FPModeKind::FPM_Fast ||
-                          LangOpts.getDefaultFPContractMode() ==
-                              LangOptions::FPModeKind::FPM_FastHonorPragmas);
 
   Options.BBAddrMap = CodeGenOpts.BBAddrMap;
   Options.BBSections =
diff --git a/lld/test/COFF/Inputs/undefined-symbol-lto-a.ll b/lld/test/COFF/Inputs/undefined-symbol-lto-a.ll
index 7e29044ebe00d..f57a3e3c1ede4 100644
--- a/lld/test/COFF/Inputs/undefined-symbol-lto-a.ll
+++ b/lld/test/COFF/Inputs/undefined-symbol-lto-a.ll
@@ -47,8 +47,8 @@ entry:
   ret void
 }
 
-attributes #0 = { "correctly-rounded-divide-sqrt-fp-math"="false" "disable-tail-calls"="false" "less-precise-fpmad"="false" "frame-pointer"="none" "no-infs-fp-math"="false" "no-nans-fp-math"="false" "no-signed-zeros-fp-math"="false" "no-trapping-math"="false" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "unsafe-fp-math"="false" "use-soft-float"="false" }
-attributes #1 = { nounwind sspstrong uwtable "correctly-rounded-divide-sqrt-fp-math"="false" "disable-tail-calls"="false" "less-precise-fpmad"="false" "min-legal-vector-width"="0" "frame-pointer"="none" "no-infs-fp-math"="false" "no-jump-tables"="false" "no-nans-fp-math"="false" "no-signed-zeros-fp-math"="false" "no-trapping-math"="false" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "unsafe-fp-math"="false" "use-soft-float"="false" }
+attributes #0 = { "correctly-rounded-divide-sqrt-fp-math"="false" "disable-tail-calls"="false" "less-precise-fpmad"="false" "frame-pointer"="none" "no-infs-fp-math"="false" "no-nans-fp-math"="false" "no-signed-zeros-fp-math"="false" "no-trapping-math"="false" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "use-soft-float"="false" }
+attributes #1 = { nounwind sspstrong uwtable "correctly-rounded-divide-sqrt-fp-math"="false" "disable-tail-calls"="false" "less-precise-fpmad"="false" "min-legal-vector-width"="0" "frame-pointer"="none" "no-infs-fp-math"="false" "no-jump-tables"="false" "no-nans-fp-math"="false" "no-signed-zeros-fp-math"="false" "no-trapping-math"="false" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "use-soft-float"="false" }
 attributes #2 = { nounwind }
 
 !llvm.linker.options = !{!1, !2}
diff --git a/lld/test/COFF/Inputs/undefined-symbol-lto-b.ll b/lld/test/COFF/Inputs/undefined-symbol-lto-b.ll
index 0f64e236a1f47..7347fde7a9dee 100644
--- a/lld/test/COFF/Inputs/undefined-symbol-lto-b.ll
+++ b/lld/test/COFF/Inputs/undefined-symbol-lto-b.ll
@@ -11,7 +11,7 @@ entry:
   ret void
 }
 
-attributes #0 = { norecurse nounwind readnone sspstrong uwtable "correctly-rounded-divide-sqrt-fp-math"="false" "disable-tail-calls"="false" "less-precise-fpmad"="false" "min-legal-vector-width"="0" "frame-pointer"="none" "no-infs-fp-math"="false" "no-jump-tables"="false" "no-nans-fp-math"="false" "no-signed-zeros-fp-math"="false" "no-trapping-math"="false" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "unsafe-fp-math"="false" "use-soft-float"="false" }
+attributes #0 = { norecurse nounwind readnone sspstrong uwtable "correctly-rounded-divide-sqrt-fp-math"="false" "disable-tail-calls"="false" "less-precise-fpmad"="false" "min-legal-vector-width"="0" "frame-pointer"="none" "no-infs-fp-math"="false" "no-jump-tables"="false" "no-nans-fp-math"="false" "no-signed-zeros-fp-math"="false" "no-trapping-math"="false" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "use-soft-float"="false" }
 
 !llvm.linker.options = !{!0, !1}
 !llvm.module.flags = !{!2, !3, !4, !5}
diff --git a/lld/test/COFF/Inputs/undefined-symbol-multi-lto.ll b/lld/test/COFF/Inputs/undefined-symbol-multi-lto.ll
index 5f6730272e610..61828cae7ea58 100644
--- a/lld/test/COFF/Inputs/undefined-symbol-multi-lto.ll
+++ b/lld/test/COFF/Inputs/undefined-symbol-multi-lto.ll
@@ -13,8 +13,8 @@ declare dso_local i32 @"?foo@@YAHXZ"() #1
 
 declare dso_local i32 @"?bar@@YAHXZ"() #1
 
-attributes #0 = { noinline optnone uwtable "correctly-rounded-divide-sqrt-fp-math"="false" "disable-tail-calls"="false" "frame-pointer"="all" "less-precise-fpmad"="false" "min-legal-vector-width"="0" "no-infs-fp-math"="false" "no-jump-tables"="false" "no-nans-fp-math"="false" "no-signed-zeros-fp-math"="false" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "unsafe-fp-math"="false" "use-soft-float"="false" }
-attributes #1 = { "correctly-rounded-divide-sqrt-fp-math"="false" "disable-tail-calls"="false" "frame-pointer"="all" "less-precise-fpmad"="false" "no-infs-fp-math"="false" "no-nans-fp-math"="false" "no-signed-zeros-fp-math"="false" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "unsafe-fp-math"="false" "use-soft-float"="false" }
+attributes #0 = { noinline optnone uwtable "correctly-rounded-divide-sqrt-fp-math"="false" "disable-tail-calls"="false" "frame-pointer"="all" "less-precise-fpmad"="false" "min-legal-vector-width"="0" "no-infs-fp-math"="false" "no-jump-tables"="false" "no-nans-fp-math"="false" "no-signed-zeros-fp-math"="false" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "use-soft-float"="false" }
+attributes #1 = { "correctly-rounded-divide-sqrt-fp-math"="false" "disable-tail-calls"="false" "frame-pointer"="all" "less-precise-fpmad"="false" "no-infs-fp-math"="false" "no-nans-fp-math"="false" "no-signed-zeros-fp-math"="false" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "use-soft-float"="false" }
 
 !llvm.module.flags = !{!0}
 !llvm.ident = !{!1}
diff --git a/lld/test/MachO/lto-mattrs.ll b/lld/test/MachO/lto-mattrs.ll
index f658b485a1792..41313296dc269 100644
--- a/lld/test/MachO/lto-mattrs.ll
+++ b/lld/test/MachO/lto-mattrs.ll
@@ -33,4 +33,4 @@ define float @foo(float %x) #0 {
   ret float %div
 }
 
-attributes #0 = { "unsafe-fp-math"="true" "reciprocal-estimates"="divf,vec-divf" }
+attributes #0 = { "reciprocal-estimates"="divf,vec-divf" }
diff --git a/lld/test/wasm/Inputs/debuginfo1.ll b/lld/test/wasm/Inputs/debuginfo1.ll
index d6db88002ce1e..0a1c42a214f2c 100644
--- a/lld/test/wasm/Inputs/debuginfo1.ll
+++ b/lld/test/wasm/Inputs/debuginfo1.ll
@@ -35,9 +35,9 @@ declare void @foo(i32) local_unnamed_addr #2
 ; Function Attrs: nounwind readnone speculatable
 declare void @llvm.dbg.value(metadata, metadata, metadata) #3
 
-attributes #0 = { nounwind readnone "correctly-rounded-divide-sqrt-fp-math"="false" "disable-tail-calls"="false" "less-precise-fpmad"="false" "frame-pointer"="none" "no-infs-fp-math"="false" "no-jump-tables"="false" "no-nans-fp-math"="false" "no-signed-zeros-fp-math"="false" "no-trapping-math"="false" "stack-protector-buffer-size"="8" "target-cpu"="generic" "unsafe-fp-math"="false" "use-soft-float"="false" }
-attributes #1 = { nounwind "correctly-rounded-divide-sqrt-fp-math"="false" "disable-tail-calls"="false" "less-precise-fpmad"="false" "frame-pointer"="none" "no-infs-fp-math"="false" "no-jump-tables"="false" "no-nans-fp-math"="false" "no-signed-zeros-fp-math"="false" "no-trapping-math"="false" "stack-protector-buffer-size"="8" "target-cpu"="generic" "unsafe-fp-math"="false" "use-soft-float"="false" }
-attributes #2 = { "correctly-rounded-divide-sqrt-fp-math"="false" "disable-tail-calls"="false" "less-precise-fpmad"="false" "frame-pointer"="none" "no-infs-fp-math"="false" "no-nans-fp-math"="false" "no-signed-zeros-fp-math"="false" "no-trapping-math"="false" "stack-protector-buffer-size"="8" "target-cpu"="generic" "unsafe-fp-math"="false" "use-soft-float"="false" }
+attributes #0 = { nounwind readnone "correctly-rounded-divide-sqrt-fp-math"="false" "disable-tail-calls"="false" "less-precise-fpmad"="false" "frame-pointer"="none" "no-infs-fp-math"="false" "no-jump-tables"="false" "no-nans-fp-math"="false" "no-signed-zeros-fp-math"="false" "no-trapping-math"="false" "stack-protector-buffer-size"="8" "target-cpu"="generic" "use-soft-float"="false" }
+attributes #1 = { nounwind "correctly-rounded-divide-sqrt-fp-math"="false" "disable-tail-calls"="false" "less-precise-fpmad"="false" "frame-pointer"="none" "no-infs-fp-math"="false" "no-jump-tables"="false" "no-nans-fp-math"="false" "no-signed-zeros-fp-math"="false" "no-trapping-math"="false" "stack-protector-buffer-size"="8" "target-cpu"="generic" "use-soft-float"="false" }
+attributes #2 = { "correctly-rounded-divide-sqrt-fp-math"="false" "disable-tail-calls"="false" "less-precise-fpmad"="false" "frame-pointer"="none" "no-infs-fp-math"="false" "no-nans-fp-math"="false" "no-signed-zeros-fp-math"="false" "no-trapping-math"="false" "stack-protector-buffer-size"="8" "target-cpu"="generic" "use-soft-float"="false" }
 attributes #3 = { nounwind readnone speculatable }
 attributes #4 = { nounwind }
 
diff --git a/lld/test/wasm/Inputs/debuginfo2.ll b/lld/test/wasm/Inputs/debuginfo2.ll
index 1b63dd57474e5..c832be521e325 100644
--- a/lld/test/wasm/Inputs/debuginfo2.ll
+++ b/lld/test/wasm/Inputs/debuginfo2.ll
@@ -31,7 +31,7 @@ entry:
 ; Function Attrs: nounwind readnone speculatable
 declare void @llvm.dbg.value(metadata, metadata, metadata) #1
 
-attributes #0 = { nounwind "correctly-rounded-divide-sqrt-fp-math"="false" "disable-tail-calls"="false" "less-precise-fpmad"="false" "frame-pointer"="none" "no-infs-fp-math"="false" "no-jump-tables"="false" "no-nans-fp-math"="false" "no-signed-zeros-fp-math"="false" "no-trapping-math"="false" "stack-protector-buffer-size"="8" "target-cpu"="generic" "unsafe-fp-math"="false" "use-soft-float"="false" }
+attributes #0 = { nounwind "correctly-rounded-divide-sqrt-fp-math"="false" "disable-tail-calls"="false" "less-precise-fpmad"="false" "frame-pointer"="none" "no-infs-fp-math"="false" "no-jump-tables"="false" "no-nans-fp-math"="false" "no-signed-zeros-fp-math"="false" "no-trapping-math"="false" "stack-protector-buffer-size"="8" "target-cpu"="generic" "use-soft-float"="false" }
 attributes #1 = { nounwind readnone speculatable }
 
 !llvm.dbg.cu = !{!2}
diff --git a/lld/test/wasm/debug-removed-fn.ll b/lld/test/wasm/debug-removed-fn.ll
index 8dae48a136dc4..20c30346cc0e7 100644
--- a/lld/test/wasm/debug-removed-fn.ll
+++ b/lld/test/wasm/debug-removed-fn.ll
@@ -28,7 +28,7 @@ entry:
   ret i32 6, !dbg !13
 }
 
-attributes #0 = { noinline nounwind optnone "correctly-rounded-divide-sqrt-fp-math"="false" "disable-tail-calls"="false" "less-precise-fpmad"="false" "frame-pointer"="none" "no-infs-fp-math"="false" "no-jump-tables"="false" "no-nans-fp-math"="false" "no-signed-zeros-fp-math"="false" "no-trapping-math"="false" "stack-protector-buffer-size"="8" "target-cpu"="generic" "unsafe-fp-math"="false" "use-soft-float"="false" }
+attributes #0 = { noinline nounwind optnone "correctly-rounded-divide-sqrt-fp-math"="false" "disable-tail-calls"="false" "less-precise-fpmad"="false" "frame-pointer"="none" "no-infs-fp-math"="false" "no-jump-tables"="false" "no-nans-fp-math"="false" "no-signed-zeros-fp-math"="false" "no-trapping-math"="false" "stack-protector-buffer-size"="8" "target-cpu"="generic" "use-soft-float"="false" }
 
 !llvm.dbg.cu = !{!0}
 !llvm.module.flags = !{!3, !4, !5}
diff --git a/llvm/docs/CommandGuide/llc.rst b/llvm/docs/CommandGuide/llc.rst
index 900649f59c401..cc670f6043656 100644
--- a/llvm/docs/CommandGuide/llc.rst
+++ b/llvm/docs/CommandGuide/llc.rst
@@ -125,13 +125,6 @@ End-user Options
 
  Enable setting the FP exceptions build attribute not to use exceptions.
 
-.. option:: --enable-unsafe-fp-math
-
- Enable optimizations that make unsafe assumptions about IEEE math (e.g. that
- addition is associative) or may not work for all input ranges.  These
- optimizations allow the code generator to make use of some instructions which
- would otherwise not be usable (such as ``fsin`` on X86).
-
 .. option:: --stats
 
  Print statistics recorded by code-generation passes.
diff --git a/llvm/docs/CommandGuide/lli.rst b/llvm/docs/CommandGuide/lli.rst
index 94c001380441f..8afe10db05d48 100644
--- a/llvm/docs/CommandGuide/lli.rst
+++ b/llvm/docs/CommandGuide/lli.rst
@@ -107,11 +107,6 @@ FLOATING POINT OPTIONS
 
  Enable optimizations that assume no NAN values.
 
-.. option:: -enable-unsafe-fp-math
-
- Causes :program:`lli` to enable optimizations that may decrease floating point
- precision.
-
 .. option:: -soft-float
 
  Causes :program:`lli` to generate software floating point library calls instead of
diff --git a/llvm/docs/SourceLevelDebugging.rst b/llvm/docs/SourceLevelDebugging.rst
index f057b2d2d2e36..12b5e3e549df7 100644
--- a/llvm/docs/SourceLevelDebugging.rst
+++ b/llvm/docs/SourceLevelDebugging.rst
@@ -674,7 +674,7 @@ Compiled to LLVM, this function would be represented like this:
     ret void, !dbg !24
   }
 
-  attributes #0 = { nounwind ssp uwtable "less-precise-fpmad"="false" "frame-pointer"="all" "no-infs-fp-math"="false" "no-nans-fp-math"="false" "stack-protector-buffer-size"="8" "unsafe-fp-math"="false" "use-soft-float"="false" }
+  attributes #0 = { nounwind ssp uwtable "less-precise-fpmad"="false" "frame-pointer"="all" "no-infs-fp-math"="false" "no-nans-fp-math"="false" "stack-protector-buffer-size"="8" "use-soft-float"="false" }
   attributes #1 = { nounwind readnone }
 
   !llvm.dbg.cu = !{!0}
diff --git a/llvm/include/llvm/CodeGen/CommandFlags.h b/llvm/include/llvm/CodeGen/CommandFlags.h
index 39c5a8d479a5f..af66f2d5776ba 100644
--- a/llvm/include/llvm/CodeGen/CommandFlags.h
+++ b/llvm/include/llvm/CodeGen/CommandFlags.h
@@ -58,8 +58,6 @@ LLVM_ABI CodeGenFileType getFileType();
 
 LLVM_ABI FramePointerKind getFramePointerUsage();
 
-LLVM_ABI bool getEnableUnsafeFPMath();
-
 LLVM_ABI bool getEnableNoInfsFPMath();
 
 LLVM_ABI bool getEnableNoNaNsFPMath();
diff --git a/llvm/include/llvm/IR/Attributes.td b/llvm/include/llvm/IR/Attributes.td
index 8e7d9dcebfe2a..8ce2b1bea8fac 100644
--- a/llvm/include/llvm/IR/Attributes.td
+++ b/llvm/include/llvm/IR/Attributes.td
@@ -410,7 +410,6 @@ def LessPreciseFPMAD : StrBoolAttr<"less-precise-fpmad">;
 def NoInfsFPMath : StrBoolAttr<"no-infs-fp-math">;
 def NoNansFPMath : StrBoolAttr<"no-nans-fp-math">;
 def NoSignedZerosFPMath : StrBoolAttr<"no-signed-zeros-fp-math">;
-def UnsafeFPMath : StrBoolAttr<"unsafe-fp-math">;
 def NoJumpTables : StrBoolAttr<"no-jump-tables">;
 def NoInlineLineTables : StrBoolAttr<"no-inline-line-tables">;
 def ProfileSampleAccurate : StrBoolAttr<"profile-sample-accurate">;
@@ -474,7 +473,6 @@ def : MergeRule<"setAND<LessPreciseFPMADAttr>">;
 def : MergeRule<"setAND<NoInfsFPMathAttr>">;
 def : MergeRule<"setAND<NoNansFPMathAttr>">;
 def : MergeRule<"setAND<NoSignedZerosFPMathAttr>">;
-def : MergeRule<"setAND<UnsafeFPMathAttr>">;
 def : MergeRule<"setOR<NoImplicitFloatAttr>">;
 def : MergeRule<"setOR<NoJumpTablesAttr>">;
 def : MergeRule<"setOR<ProfileSampleAccurateAttr>">;
diff --git a/llvm/include/llvm/Target/TargetOptions.h b/llvm/include/llvm/Target/TargetOptions.h
index 2c2122a7b204f..bfd2817b8d1f5 100644
--- a/llvm/include/llvm/Target/TargetOptions.h
+++ b/llvm/include/llvm/Target/TargetOptions.h
@@ -118,9 +118,8 @@ enum CodeObjectVersionKind {
 class TargetOptions {
 public:
   TargetOptions()
-      : UnsafeFPMath(false), NoInfsFPMath(false), NoNaNsFPMath(false),
-        NoTrappingFPMath(true), NoSignedZerosFPMath(false),
-        EnableAIXExtendedAltivecABI(false),
+      : NoInfsFPMath(false), NoNaNsFPMath(false), NoTrappingFPMath(true),
+        NoSignedZerosFPMath(false), EnableAIXExtendedAltivecABI(false),
         HonorSignDependentRoundingFPMathOption(false), NoZerosInBSS(false),
         GuaranteedTailCallOpt(false), StackSymbolOrdering(true),
         EnableFastISel(false), EnableGlobalISel(false), UseInitArray(false),
@@ -156,13 +155,6 @@ class TargetOptions {
   /// MCAsmInfo::BinutilsVersion.
   std::pair<int, int> BinutilsVersion{0, 0};
 
-  /// UnsafeFPMath - This flag is enabled when the
-  /// -enable-unsafe-fp-math flag is specified on the command line.  When
-  /// this flag is off (the default), the code generator is not allowed to
-  /// produce results that are "less precise" than IEEE allows.  This includes
-  /// use of X86 instructions like FSIN and FCOS instead of libcalls.
-  unsigned UnsafeFPMath : 1;
-
   /// NoInfsFPMath - This flag is enabled when the
   /// -enable-no-infs-fp-math flag is specified on the command line. When
   /// this flag is off (the default), the code generator is not allowed to
diff --git a/llvm/lib/CodeGen/CommandFlags.cpp b/llvm/lib/CodeGen/CommandFlags.cpp
index 0522698adf183..c1365f499dcf5 100644
--- a/llvm/lib/CodeGen/CommandFlags.cpp
+++ b/llvm/lib/CodeGen/CommandFlags.cpp
@@ -64,7 +64,6 @@ CGOPT_EXP(uint64_t, LargeDataThreshold)
 CGOPT(ExceptionHandling, ExceptionModel)
 CGOPT_EXP(CodeGenFileType, FileType)
 CGOPT(FramePointerKind, FramePointerUsage)
-CGOPT(bool, EnableUnsafeFPMath)
 CGOPT(bool, EnableNoInfsFPMath)
 CGOPT(bool, EnableNoNaNsFPMath)
 CGOPT(bool, EnableNoSignedZerosFPMath)
@@ -219,12 +218,6 @@ codegen::RegisterCodeGenFlags::RegisterCodeGenFlags() {
                      "Enable frame pointer elimination")));
   CGBINDOPT(FramePointerUsage);
 
-  static cl::opt<bool> EnableUnsafeFPMath(
-      "enable-unsafe-fp-math",
-      cl::desc("Enable optimizations that may decrease FP precision"),
-      cl::init(false));
-  CGBINDOPT(EnableUnsafeFPMath);
-
   static cl::opt<bool> EnableNoInfsFPMath(
       "enable-no-infs-fp-math",
       cl::desc("Enable FP math optimizations that assume no +-Infs"),
@@ -552,7 +545,6 @@ TargetOptions
 codegen::InitTargetOptionsFromCodeGenFlags(const Triple &TheTriple) {
   TargetOptions Options;
   Options.AllowFPOpFusion = getFuseFPOps();
-  Options.UnsafeFPMath = getEnableUnsafeFPMath();
   Options.NoInfsFPMath = getEnableNoInfsFPMath();
   Options.NoNaNsFPMath = getEnableNoNaNsFPMath();
   Options.NoSignedZerosFPMath = getEnableNoSignedZerosFPMath();
@@ -706,7 +698,6 @@ void codegen::setFunctionAttributes(StringRef CPU, StringRef Features,
   if (getStackRealign())
     NewAttrs.addAttribute("stackrealign");
 
-  HANDLE_BOOL_ATTR(EnableUnsafeFPMathView, "unsafe-fp-math");
   HANDLE_BOOL_ATTR(EnableNoInfsFPMathView, "no-infs-fp-math");
   HANDLE_BOOL_ATTR(EnableNoNaNsFPMathView, "no-nans-fp-math");
   HANDLE_BOOL_ATTR(EnableNoSignedZerosFPMathView, "no-signed-zeros-fp-math");
diff --git a/llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp b/llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp
index 310d35d9b1d1e..d05a6506f9677 100644
--- a/llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp
+++ b/llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp
@@ -17462,9 +17462,9 @@ SDValue DAGCombiner::visitFSUBForFMACombine(SDNode *N) {
   // fold (fsub (fpext (fneg (fmul, x, y))), z)
   //   -> (fneg (fma (fpext x), (fpext y), z))
   // Note: This could be removed with appropriate canonicalization of the
-  // input expression into (fneg (fadd (fpext (fmul, x, y)), z). However, the
-  // orthogonal flags -fp-contract=fast and -enable-unsafe-fp-math prevent
-  // from implementing the canonicalization in visitFSUB.
+  // input expression into (fneg (fadd (fpext (fmul, x, y)), z). However,
+  // -fp-contract=fast prevent from implementing the canonicalization
+  // in visitFSUB.
   if (matcher.match(N0, ISD::FP_EXTEND)) {
     SDValue N00 = N0.getOperand(0);
     if (matcher.match(N00, ISD::FNEG)) {
@@ -17486,9 +17486,9 @@ SDValue DAGCombiner::visitFSUBForFMACombine(SDNode *N) {
   // fold (fsub (fneg (fpext (f...
[truncated]

Copy link
Contributor

@arsenm arsenm left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is a lot of changed files, can you break this up. The llvm and clang parts should be done separately

@paperchalice paperchalice deleted the rm-unsafe-fp-math branch October 22, 2025 08:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

backend:AArch64 backend:AMDGPU backend:ARM backend:Hexagon backend:MIPS backend:MSP430 backend:NVPTX backend:PowerPC backend:RISC-V backend:SPIR-V backend:SystemZ backend:WebAssembly backend:X86 clang:codegen IR generation bugs: mangling, exceptions, etc. clang:openmp OpenMP related changes to Clang clang Clang issues not falling into any other category compiler-rt:sanitizer coroutines C++20 coroutines debuginfo lld:COFF lld:MachO lld:wasm lld llvm:analysis Includes value tracking, cost tables and constant folding llvm:binary-utilities llvm:codegen llvm:globalisel llvm:instcombine Covers the InstCombine, InstSimplify and AggressiveInstCombine passes llvm:ir llvm:SelectionDAG SelectionDAGISel as well llvm:transforms LTO Link time optimization (regular/full LTO or ThinLTO) PGO Profile Guided Optimizations

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants