[PATCH] D53649: [TargetLowering] Improve vXi64 UITOFP vXf64 support (P38226)

Simon Pilgrim via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Oct 24 08:39:23 PDT 2018


RKSimon created this revision.
RKSimon added reviewers: craig.topper, spatel, hfinkel, andreadb.
Herald added a subscriber: dmgreen.

As suggested on https://reviews.llvm.org/D52965, this patch moves the i64 to f64 UINT_TO_FP expansion code from LegalizeDAG into TargetLowering, generalizes it to work for vectors and makes it available to LegalizeVectorOps as well.

Not only does this help perform X86 lowering as a true vectorization instead of (partially vectorized) scalar conversions, it avoids the HADDPD op from the scalar code which can be slow on most targets.

My only minor concern is that AVX512F does have the vcvtusi2sdq scalar operation but we don't use it as (a) for some reason we don't set it as legal, and (b) it seems to only help for the v2f64 case - otherwise the unrolling cost will certainly be too high. My feeling is that we should leave it to the vectorizers - and if it generates the vector UINT_TO_FP we should use it.


Repository:
  rL LLVM

https://reviews.llvm.org/D53649

Files:
  include/llvm/CodeGen/TargetLowering.h
  lib/CodeGen/SelectionDAG/LegalizeDAG.cpp
  lib/CodeGen/SelectionDAG/LegalizeVectorOps.cpp
  lib/CodeGen/SelectionDAG/TargetLowering.cpp
  test/CodeGen/X86/avx512-cvt.ll
  test/CodeGen/X86/ftrunc.ll
  test/CodeGen/X86/vec_int_to_fp.ll

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D53649.170905.patch
Type: text/x-patch
Size: 56303 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20181024/1edb2ac7/attachment.bin>


More information about the llvm-commits mailing list