Fix a brain fart by our beloved leader (the content
authorDuncan Sands <baldrick@free.fr>
Fri, 21 Dec 2007 20:18:41 +0000 (20:18 +0000)
committerDuncan Sands <baldrick@free.fr>
Fri, 21 Dec 2007 20:18:41 +0000 (20:18 +0000)
of this patch is the last line).

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@45289 91177308-0d34-0410-b5e6-96231b3b80d8

lib/Target/TargetData.cpp

index 8c466543facc3f5784e427262029386ece423970..04ee98649237d006468c87201de97dbed48df172 100644 (file)
@@ -268,15 +268,14 @@ unsigned TargetData::getAlignmentInfo(AlignTypeEnum AlignType,
       return ABIInfo ? Alignments[i].ABIAlign : Alignments[i].PrefAlign;
     
     // The best match so far depends on what we're looking for.
-    if (AlignType == VECTOR_ALIGN) {
+    if (AlignType == VECTOR_ALIGN && Alignments[i].AlignType == VECTOR_ALIGN) {
       // If this is a specification for a smaller vector type, we will fall back
       // to it.  This happens because <128 x double> can be implemented in terms
       // of 64 <2 x double>.
-      if (Alignments[i].AlignType == VECTOR_ALIGN && 
-          Alignments[i].TypeBitWidth < BitWidth) {
+      if (Alignments[i].TypeBitWidth < BitWidth) {
         // Verify that we pick the biggest of the fallbacks.
         if (BestMatchIdx == -1 ||
-            Alignments[BestMatchIdx].TypeBitWidth < BitWidth)
+            Alignments[BestMatchIdx].TypeBitWidth < Alignments[i].TypeBitWidth)
           BestMatchIdx = i;
       }
     } else if (AlignType == INTEGER_ALIGN &&