[llvm] [Matrix] Propagate shape information through Select insts (PR #141876)

Jon Roelofs via llvm-commits llvm-commits at lists.llvm.org
Thu Jun 5 14:56:54 PDT 2025


================
@@ -269,6 +269,15 @@ computeShapeInfoForInst(Instruction *I,
       return OpShape->second;
   }
 
+  if (isa<SelectInst>(I)) {
+    auto OpShape = ShapeMap.find(I->getOperand(1));
+    if (OpShape != ShapeMap.end())
+      return OpShape->second;
+    OpShape = ShapeMap.find(I->getOperand(2));
+    if (OpShape != ShapeMap.end())
+      return OpShape->second;
----------------
jroelofs wrote:

I think it should _almost_ match, but not quite: we need to ignore the condition operand for shape info iff it is not a vector.

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


More information about the llvm-commits mailing list