[PATCH] D41895: [X86] Another attempt at support prefer-vector-width function attribute

Craig Topper via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Jan 18 12:49:40 PST 2018


craig.topper added inline comments.


================
Comment at: lib/Target/X86/X86Subtarget.cpp:260
+  if (PreferVectorWidthOverride)
+    PreferVectorWidth = PreferVectorWidthOverride;
+  else if (Prefer256Bit)
----------------
RKSimon wrote:
> craig.topper wrote:
> > RKSimon wrote:
> > > Do we need to assert for a sane value here (else in X86TargetMachine.cpp)?
> > What do you consider a sane value? There's no bounds checking on the attribute coming in.
> assert(IsPowerOf2(PreferVectorWidthOverride) && PreferVectorWidthOverride >= 128 )?
It comes from an unchecked command line argument passed to clang that was intended to be target independent. There's no guarantee of any particular value or range.


https://reviews.llvm.org/D41895





More information about the llvm-commits mailing list