[PATCH] D133300: [InstCombine] Matrix multiplication negation optimisation

Sanjay Patel via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri Sep 16 07:50:03 PDT 2022


spatel added inline comments.


================
Comment at: llvm/test/Transforms/InstCombine/matrix-multiplication-negation.ll:226
+; CHECK-NEXT:    [[RES:%.*]] = tail call <12 x double> @llvm.matrix.multiply.v12f64.v15f64.v20f64(<15 x double> [[A]], <20 x double> [[B:%.*]], i32 3, i32 5, i32 4)
+; CHECK-NEXT:    [[TMP1:%.*]] = fneg <12 x double> [[RES]]
 ; CHECK-NEXT:    store <15 x double> [[A_NEG]], ptr [[A_LOC:%.*]], align 128
----------------
zjaffal wrote:
> spatel wrote:
> > We added an fneg to this sequence without removing the existing one. How is this better?
> This is a result of removing the check if the negation has a single use.
Right - it made sense when **both** operands are negated in the other patch, but not when only 1 is negated. The one-use check should be present for this optimization.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D133300/new/

https://reviews.llvm.org/D133300



More information about the llvm-commits mailing list