[llvm-branch-commits] [llvm-branch] r322680 - Merging r322106:

Hans Wennborg via llvm-branch-commits llvm-branch-commits at lists.llvm.org
Wed Jan 17 08:20:48 PST 2018


Author: hans
Date: Wed Jan 17 08:20:48 2018
New Revision: 322680

URL: http://llvm.org/viewvc/llvm-project?rev=322680&view=rev
Log:
Merging r322106:
------------------------------------------------------------------------
r322106 | abataev | 2018-01-09 11:08:22 -0800 (Tue, 09 Jan 2018) | 11 lines

[COST]Fix PR35865: Fix cost model evaluation for shuffle on X86.

Summary:
If the vector type is transformed to non-vector single type, the compile
may crash trying to get vector information about non-vector type.

Reviewers: RKSimon, spatel, mkuper, hfinkel

Subscribers: llvm-commits

Differential Revision: https://reviews.llvm.org/D41862
------------------------------------------------------------------------

Added:
    llvm/branches/release_60/test/Transforms/SLPVectorizer/X86/PR35865.ll
      - copied unchanged from r322106, llvm/trunk/test/Transforms/SLPVectorizer/X86/PR35865.ll
Modified:
    llvm/branches/release_60/   (props changed)
    llvm/branches/release_60/lib/Target/X86/X86TargetTransformInfo.cpp

Propchange: llvm/branches/release_60/
------------------------------------------------------------------------------
--- svn:mergeinfo (original)
+++ svn:mergeinfo Wed Jan 17 08:20:48 2018
@@ -1,3 +1,3 @@
 /llvm/branches/Apple/Pertwee:110850,110961
 /llvm/branches/type-system-rewrite:133420-134817
-/llvm/trunk:155241,321789,321791,321862,321870,321872,321980,321991,321993-321994,322056,322103,322272,322473,322623
+/llvm/trunk:155241,321789,321791,321862,321870,321872,321980,321991,321993-321994,322056,322103,322106,322272,322473,322623

Modified: llvm/branches/release_60/lib/Target/X86/X86TargetTransformInfo.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/branches/release_60/lib/Target/X86/X86TargetTransformInfo.cpp?rev=322680&r1=322679&r2=322680&view=diff
==============================================================================
--- llvm/branches/release_60/lib/Target/X86/X86TargetTransformInfo.cpp (original)
+++ llvm/branches/release_60/lib/Target/X86/X86TargetTransformInfo.cpp Wed Jan 17 08:20:48 2018
@@ -754,7 +754,8 @@ int X86TTIImpl::getShuffleCost(TTI::Shuf
   // type remains the same.
   if (Kind == TTI::SK_PermuteSingleSrc && LT.first != 1) {
     MVT LegalVT = LT.second;
-    if (LegalVT.getVectorElementType().getSizeInBits() ==
+    if (LegalVT.isVector() &&
+        LegalVT.getVectorElementType().getSizeInBits() ==
             Tp->getVectorElementType()->getPrimitiveSizeInBits() &&
         LegalVT.getVectorNumElements() < Tp->getVectorNumElements()) {
 




More information about the llvm-branch-commits mailing list