[llvm] [Matrix] Propagate shape information through (f)abs insts (PR #141704)
Florian Hahn via llvm-commits
llvm-commits at lists.llvm.org
Mon Jun 2 08:47:04 PDT 2025
================
@@ -2198,6 +2210,49 @@ class LowerMatrixIntrinsics {
return true;
}
+ /// Lower uniform shape intrinsics, if shape information is available.
+ bool VisitUniformIntrinsic(IntrinsicInst *Inst) {
+ auto I = ShapeMap.find(Inst);
+ if (I == ShapeMap.end())
+ return false;
+
+ IRBuilder<> Builder(Inst);
+ ShapeInfo &Shape = I->second;
+
+ MatrixTy Result;
+
+ switch (Inst->getIntrinsicID()) {
+ case Intrinsic::abs:
+ case Intrinsic::fabs: {
+ Value *Op = Inst->getOperand(0);
+
+ MatrixTy M = getMatrix(Op, Shape, Builder);
----------------
fhahn wrote:
```suggestion
MatrixTy M = getMatrix(Inst->getOperand(0), Shape, Builder);
```
If it stays <= 80 chars might be worth folding into getMatrix call?
https://github.com/llvm/llvm-project/pull/141704
More information about the llvm-commits
mailing list