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

via llvm-commits llvm-commits at lists.llvm.org
Thu Jul 4 06:33:36 PDT 2024


llvmbot wrote:


<!--LLVM PR SUMMARY COMMENT-->

@llvm/pr-subscribers-backend-aarch64

Author: Nikita Popov (nikic)

<details>
<summary>Changes</summary>

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.

---
Full diff: https://github.com/llvm/llvm-project/pull/97729.diff


1 Files Affected:

- (modified) llvm/lib/Target/AArch64/AArch64ISelLowering.cpp (+2-1) 


``````````diff
diff --git a/llvm/lib/Target/AArch64/AArch64ISelLowering.cpp b/llvm/lib/Target/AArch64/AArch64ISelLowering.cpp
index e0c3cc5eddb82..760ae32d1059a 100644
--- a/llvm/lib/Target/AArch64/AArch64ISelLowering.cpp
+++ b/llvm/lib/Target/AArch64/AArch64ISelLowering.cpp
@@ -24829,7 +24829,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;
@@ -24858,6 +24858,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 different 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)

``````````

</details>


https://github.com/llvm/llvm-project/pull/97729


More information about the llvm-commits mailing list