[llvm] 1604c24 - [AArch64] Fix copy and paste error in tryCombineMULLWithUZP1() (NFCI) (#97729)

via llvm-commits llvm-commits at lists.llvm.org
Mon Jul 8 00:42:47 PDT 2024


Author: Nikita Popov
Date: 2024-07-08T09:42:43+02:00
New Revision: 1604c24981a73fd7689626db87c23165d7303d7a

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

LOG: [AArch64] Fix copy and paste error in tryCombineMULLWithUZP1() (NFCI) (#97729)

The bitcast check was performed on the wrong value in one of the
branches.

I believe this doesn't actually result in any behavior difference,
because the following code looking at ExtractHigh users currently
doesn't try to look through BITCASTS. I've left a TODO for that.

Fixes https://github.com/llvm/llvm-project/issues/94761.

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 341cf51173ccc..6345d0703aca1 100644
--- a/llvm/lib/Target/AArch64/AArch64ISelLowering.cpp
+++ b/llvm/lib/Target/AArch64/AArch64ISelLowering.cpp
@@ -24833,7 +24833,7 @@ static SDValue tryCombineMULLWithUZP1(SDNode *N,
   } else if (isEssentiallyExtractHighSubvector(RHS) &&
              LHS.getOpcode() == ISD::TRUNCATE) {
     TruncHigh = LHS;
-    if (LHS.getOpcode() == ISD::BITCAST)
+    if (RHS.getOpcode() == ISD::BITCAST)
       ExtractHigh = RHS.getOperand(0);
     else
       ExtractHigh = RHS;
@@ -24862,6 +24862,7 @@ static SDValue tryCombineMULLWithUZP1(SDNode *N,
   // This dagcombine assumes the two extract_high uses same source vector in
   // order to detect the pair of the mull. If they have 
diff erent source vector,
   // this code will not work.
+  // TODO: Should also try to look through a bitcast.
   bool HasFoundMULLow = true;
   SDValue ExtractHighSrcVec = ExtractHigh.getOperand(0);
   if (ExtractHighSrcVec->use_size() != 2)


        


More information about the llvm-commits mailing list