[llvm] [Matrix] Propagate shape information through (f)abs insts (PR #141704)

Florian Hahn via llvm-commits llvm-commits at lists.llvm.org
Thu Jun 5 12:51:24 PDT 2025


================
@@ -1138,8 +1135,36 @@ class LowerMatrixIntrinsics {
       LowerColumnMajorStore(Inst);
       break;
     case Intrinsic::abs:
-    case Intrinsic::fabs:
-      return VisitUniformIntrinsic(cast<IntrinsicInst>(Inst));
+    case Intrinsic::fabs: {
+      IRBuilder<> Builder(Inst);
+
+      MatrixTy Result;
+
+      MatrixTy M = getMatrix(Inst->getOperand(0), Shape, Builder);
+
+      Builder.setFastMathFlags(getFastMathFlags(Inst));
----------------
fhahn wrote:

```suggestion
      IRBuilder<> Builder(Inst);
      MatrixTy Result;
      MatrixTy M = getMatrix(Inst->getOperand(0), Shape, Builder);
      Builder.setFastMathFlags(getFastMathFlags(Inst));
```

not sure if we need newlines between all of those

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


More information about the llvm-commits mailing list