[llvm] [RISCV][DAG][TLI] Avoid scalarizing length decreasing shuffles (PR #115532)

Philip Reames via llvm-commits llvm-commits at lists.llvm.org
Mon Nov 25 07:58:55 PST 2024


================
@@ -4181,11 +4181,26 @@ void SelectionDAGBuilder::visitShuffleVector(const User &I) {
     return;
   }
 
-  // We can't use either concat vectors or extract subvectors so fall back to
+  // If the target prefers, emit a padded shuffle vector at the
+  // source operand width, then extract the original destination
+  // type.
+  if (!TLI.shouldScalarizeLengthDecreasingShuffle()) {
----------------
preames wrote:

The problem in this case is that there is no direct translation.  IR supports mixed length shuffles; DAG does not.  I happen to think the padding approach is "closer" to the just translate your asking for, but that's definite an opinion not objective fact.  

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


More information about the llvm-commits mailing list