[all-commits] [llvm/llvm-project] 2fe0ea: DAG: Handle expanding strict_fsub into fneg and st...

Matt Arsenault via All-commits all-commits at lists.llvm.org
Tue Jul 21 13:17:30 PDT 2020


  Branch: refs/heads/master
  Home:   https://github.com/llvm/llvm-project
  Commit: 2fe0ea8261cf40d9c1ccdb9af633328290dd925e
      https://github.com/llvm/llvm-project/commit/2fe0ea8261cf40d9c1ccdb9af633328290dd925e
  Author: Matt Arsenault <Matthew.Arsenault at amd.com>
  Date:   2020-07-21 (Tue, 21 Jul 2020)

  Changed paths:
    M llvm/lib/CodeGen/SelectionDAG/LegalizeDAG.cpp
    M llvm/lib/Target/AMDGPU/VOP2Instructions.td
    A llvm/test/CodeGen/AMDGPU/strict_fsub.f16.ll
    A llvm/test/CodeGen/AMDGPU/strict_fsub.f32.ll
    A llvm/test/CodeGen/AMDGPU/strict_fsub.f64.ll

  Log Message:
  -----------
  DAG: Handle expanding strict_fsub into fneg and strict_fadd

The AMDGPU handling of f16 vectors is terrible still since it gets
scalarized even when the vector operation is legal.

The code is is essentially duplicated between the non-strict and
strict case. Apparently no other expansions are currently trying to do
this. This is mostly because I found the behavior of
getStrictFPOperationAction to be confusing. In the ARM case, it would
expand strict_fsub even though it shouldn't due to the later check. At
that point, the logic required to check for legality was more complex
than just duplicating the 2 instruction expansion.




More information about the All-commits mailing list