AMDGPU: Override getNegatedExpression constant handling
authorMatt Arsenault <Matthew.Arsenault@amd.com>
Mon, 13 Feb 2023 18:27:29 +0000 (14:27 -0400)
committerMatt Arsenault <arsenm2@gmail.com>
Wed, 15 Feb 2023 09:21:00 +0000 (05:21 -0400)
commit11c3cead23783e65fb30e673d62771352078ff05
tree74c970e13acbb61431ad34633494e7887f9dda10
parenta4e8347b36617ed81accbf5c5fb3b532db941f4f
AMDGPU: Override getNegatedExpression constant handling

Ignore the multiple use heuristics of the default
implementation, and report cost based on inline immediates. This
is mostly interesting for -0 vs. 0. Gets a few small improvements.
fneg_fadd_0_f16 is a small regression. We could probably avoid this
if we handled folding fneg into div_fixup.
llvm/lib/Target/AMDGPU/AMDGPUISelLowering.cpp
llvm/test/CodeGen/AMDGPU/fdiv32-to-rcp-folding.ll
llvm/test/CodeGen/AMDGPU/fneg-combines.f16.ll
llvm/test/CodeGen/AMDGPU/fneg-combines.new.ll
llvm/test/CodeGen/AMDGPU/v_pack.ll