[llvm] a93607c - [AArch64] Remove always true Perfect cost check. NFC

David Green via llvm-commits llvm-commits at lists.llvm.org
Fri Apr 8 04:16:38 PDT 2022


Author: David Green
Date: 2022-04-08T12:16:34+01:00
New Revision: a93607c479092ccae41c033f8d27fe99621ddef3

URL: https://github.com/llvm/llvm-project/commit/a93607c479092ccae41c033f8d27fe99621ddef3
DIFF: https://github.com/llvm/llvm-project/commit/a93607c479092ccae41c033f8d27fe99621ddef3.diff

LOG: [AArch64] Remove always true Perfect cost check. NFC

Perfect shuffle costs are always encoded less than 4, and shouldn't
really have a cost more than 3, so it makes no sense to check it when
generating shuffles. The perfect shuffle is likely always better than a
tbl too (although that may depend on whether it is in a loop).

Added: 
    

Modified: 
    llvm/lib/Target/AArch64/AArch64ISelLowering.cpp

Removed: 
    


################################################################################
diff  --git a/llvm/lib/Target/AArch64/AArch64ISelLowering.cpp b/llvm/lib/Target/AArch64/AArch64ISelLowering.cpp
index a43dbdb3353d4..65aff576ed71b 100644
--- a/llvm/lib/Target/AArch64/AArch64ISelLowering.cpp
+++ b/llvm/lib/Target/AArch64/AArch64ISelLowering.cpp
@@ -10204,10 +10204,7 @@ SDValue AArch64TargetLowering::LowerVECTOR_SHUFFLE(SDValue Op,
     unsigned PFTableIndex = PFIndexes[0] * 9 * 9 * 9 + PFIndexes[1] * 9 * 9 +
                             PFIndexes[2] * 9 + PFIndexes[3];
     unsigned PFEntry = PerfectShuffleTable[PFTableIndex];
-    unsigned Cost = (PFEntry >> 30);
-
-    if (Cost <= 4)
-      return GeneratePerfectShuffle(PFEntry, V1, V2, DAG, dl);
+    return GeneratePerfectShuffle(PFEntry, V1, V2, DAG, dl);
   }
 
   return GenerateTBL(Op, ShuffleMask, DAG);


        


More information about the llvm-commits mailing list