[all-commits] [llvm/llvm-project] 0f5972: AMDGPU: Fold fneg into bitcast of build_vector

Matt Arsenault via All-commits all-commits at lists.llvm.org
Tue Apr 11 04:12:17 PDT 2023


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 0f59720e1c3416030a91fdfb6f016fd7fdf21e85
      https://github.com/llvm/llvm-project/commit/0f59720e1c3416030a91fdfb6f016fd7fdf21e85
  Author: Matt Arsenault <Matthew.Arsenault at amd.com>
  Date:   2023-04-11 (Tue, 11 Apr 2023)

  Changed paths:
    M llvm/lib/Target/AMDGPU/AMDGPUISelLowering.cpp
    M llvm/test/CodeGen/AMDGPU/fneg-combines.new.ll
    M llvm/test/CodeGen/AMDGPU/fneg-modifier-casting.ll

  Log Message:
  -----------
  AMDGPU: Fold fneg into bitcast of build_vector

The math libraries have a lot of code that performs
manual sign bit operations by bitcasting doubles to int2
and doing bithacking on them. This is a bad canonical form
we should rewrite to use high level sign operations directly
on double. To avoid codegen regressions, we need to do a better
job moving fnegs to operate only on the high 32-bits.

This is only halfway to fixing the real case.




More information about the All-commits mailing list