[PATCH] D43306: [X86] Add pass to infer required-vector-width attribute based on size of function arguments and use of intrinsics

Craig Topper via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Feb 14 11:24:34 PST 2018


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

This patch adds a pass that determines if 512 bit registers are definitely needed based on the size of function arguments it detects. It explicitly ignores target independent intrinsics assuming that selection dag can gracefully split those.

I'm hoping what's here is enough to protect ABI, inline assembly, and intrinsic requirements. Anything else we need for correctness that I haven't thought of?

This doesn't help with any explicit vector code created in the original source code that get lowered to native IR without using in target specific intrinsics. We'll need to set the attribute from clang or an earlier IR pass to detect that. This pass is intended to get something testable so we can see if we can enable prefer vector width and get the legalizer to clip to 256 bit safely on real source code. Nothing will happen if -mprefer-vector-width=256 is not passed to clang.


https://reviews.llvm.org/D43306

Files:
  lib/Target/X86/CMakeLists.txt
  lib/Target/X86/X86.h
  lib/Target/X86/X86TargetMachine.cpp
  lib/Target/X86/X86VectorWidthInfer.cpp

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D43306.134269.patch
Type: text/x-patch
Size: 6115 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20180214/b0e7fbf5/attachment.bin>


More information about the llvm-commits mailing list