[PATCH] D50791: [SelectionDAG] unroll unsupported vector FP ops earlier to avoid libcalls on undef elements (PR38527)

Sanjay Patel via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Aug 15 10:53:36 PDT 2018


spatel created this revision.
spatel added reviewers: craig.topper, nagisa, efriedma.
Herald added subscribers: dmgreen, mcrosier.
Herald added a reviewer: javed.absar.

I haven't dealt with vector legalization, so this might not be the best or even correct approach. But I think this solves the motivating case from:
https://bugs.llvm.org/show_bug.cgi?id=38527

If we are legalizing an FP vector op that maps to 1 of the LLVM intrinsics that mimic libm calls, but we're going to end up with scalar libcalls for that vector type anyway, then we should unroll the vector op into scalars before widening. This avoids libcalls because we've lost the knowledge that some of the scalar elements are undef.

Please have a close look at the test diffs to make sure we didn't drop any necessary ops.


https://reviews.llvm.org/D50791

Files:
  lib/CodeGen/SelectionDAG/LegalizeVectorTypes.cpp
  test/CodeGen/AArch64/vec-libcalls.ll
  test/CodeGen/X86/vec-libcalls.ll

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D50791.160847.patch
Type: text/x-patch
Size: 30737 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20180815/404e49e7/attachment.bin>


More information about the llvm-commits mailing list