[llvm] [X86] Remove LowerFCanonicalize and use generic expansion (PR #147877)

via llvm-commits llvm-commits at lists.llvm.org
Thu Jul 10 01:01:48 PDT 2025


woruyu wrote:

> > > Do not add a new TLI hook for this
> > 
> > 
> > The hook is used to distinguish between X86 and (AMDGPU systemZ) behavior for vector FCANONICALIZE.
> 
> You should not be trying to distinguish these, and this problem has nothing to do with canonicalize and everything to do with how much of a mess the vector legalization logic and process is. The legalizer has a bias towards just scalarizing everything, so the AMDGPU workaround is to just custom lower all the vectors and manually split them for the cases where there are legal vector types.
> 
> Dealing with this is beyond the scope of this patch, just remove what's there and take whatever regression happens.

I've removed the target hook as suggested.
Currently failing tests include:
```
LLVM :: CodeGen/AMDGPU/fcanonicalize-elimination.ll
LLVM :: CodeGen/AMDGPU/fcanonicalize.f16.ll
LLVM :: CodeGen/AMDGPU/fcanonicalize.ll
LLVM :: CodeGen/AMDGPU/fmax3-maximumnum.ll
LLVM :: CodeGen/AMDGPU/fmin3-minimumnum.ll
LLVM :: CodeGen/AMDGPU/llvm.maxnum.f16.ll
LLVM :: CodeGen/AMDGPU/llvm.minnum.f16.ll
LLVM :: CodeGen/AMDGPU/mad-mix-lo.ll
LLVM :: CodeGen/AMDGPU/maximumnum.ll
LLVM :: CodeGen/AMDGPU/minimumnum.ll
LLVM :: CodeGen/AMDGPU/reduction.ll
LLVM :: CodeGen/SystemZ/canonicalize-vars.ll
```
I’ll analyze the failures in more detail and post the results shortly.

https://github.com/llvm/llvm-project/pull/147877


More information about the llvm-commits mailing list