Skip to content

Conversation

@RKSimon
Copy link
Collaborator

@RKSimon RKSimon commented Apr 9, 2025

Noticed while investigating #133947 regressions - if we peek through bitcasts we can lose track of oneuse/combined nodes in shuffle combining

Currently the same codegen as combineX86ShufflesRecursively still peeks through the bitcasts itself, but we will soon handle this consistently as another part of #133947

…patterns should return bitcasted source values

Noticed while investigating llvm#133947 regressions - if we peek through bitcasts we can lose track of oneuse/combined nodes

Same current codegen as combineX86ShufflesRecursively still peeks through the bitcasts itself, but we will soon handle this consistently as another part of llvm#133947
@llvmbot
Copy link
Member

llvmbot commented Apr 9, 2025

@llvm/pr-subscribers-backend-x86

Author: Simon Pilgrim (RKSimon)

Changes

Noticed while investigating #133947 regressions - if we peek through bitcasts we can lose track of oneuse/combined nodes in shuffle combining

Currently the same codegen as combineX86ShufflesRecursively still peeks through the bitcasts itself, but we will soon handle this consistently as another part of #133947


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

1 Files Affected:

  • (modified) llvm/lib/Target/X86/X86ISelLowering.cpp (+2-2)
diff --git a/llvm/lib/Target/X86/X86ISelLowering.cpp b/llvm/lib/Target/X86/X86ISelLowering.cpp
index 47ac1ee571269..53bed634c3cc6 100644
--- a/llvm/lib/Target/X86/X86ISelLowering.cpp
+++ b/llvm/lib/Target/X86/X86ISelLowering.cpp
@@ -6155,8 +6155,8 @@ static bool getFauxShuffleMask(SDValue N, const APInt &DemandedElts,
       else
         return false;
     }
-    Ops.push_back(N0);
-    Ops.push_back(N1);
+    Ops.push_back(N.getOperand(0));
+    Ops.push_back(N.getOperand(1));
     return true;
   }
   case ISD::CONCAT_VECTORS: {

@RKSimon RKSimon merged commit 747214e into llvm:main Apr 9, 2025
5 of 8 checks passed
@RKSimon RKSimon deleted the x86-faux-or-shuffle-ops branch April 9, 2025 11:54
AllinLeeYL pushed a commit to AllinLeeYL/llvm-project that referenced this pull request Apr 10, 2025
…patterns should return bitcasted source values (llvm#134993)

Noticed while investigating llvm#133947 regressions - if we peek through
bitcasts we can lose track of oneuse/combined nodes in shuffle combining

Currently the same codegen as combineX86ShufflesRecursively still peeks
through the bitcasts itself, but we will soon handle this consistently
as another part of llvm#133947
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants