[PATCH] D98934: [SVE] Add instruction cost for fptrunc in loops

Sander de Smalen via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri Mar 19 02:45:00 PDT 2021


sdesmalen added inline comments.


================
Comment at: llvm/lib/Target/AArch64/AArch64TargetTransformInfo.cpp:461
+      // Complex, from v2f64: legal type is v2i32, 1 narrowing => ~2.
+      {ISD::FP_TO_SINT, MVT::v2i32, MVT::v2f64, 2},
+      {ISD::FP_TO_SINT, MVT::v2i16, MVT::v2f64, 2},
----------------
Please avoid changing the formatting of the table, because that makes this diff unnecessarily big.


================
Comment at: llvm/test/CodeGen/AArch64/fptrunc-cost.ll:1
+; RUN: opt -debug-only=loop-vectorize -loop-vectorize -mtriple aarch64-linux-gnu -mattr=+sve -S -o - < %s  2>&1| FileCheck %s
+
----------------
The test is in the wrong directory. SVE Cost-model tests should be added in `llvm/test/Analysis/CostModel/AArch64`


================
Comment at: llvm/test/CodeGen/AArch64/fptrunc-cost.ll:17
+
+for.body.preheader:                               ; preds = %entry
+  br label %for.body
----------------
I think you may be able to write the test very similar to what was done in D97758, where you can invoke the cost-model directly on the fptrunc operation.
Or is there a specific reason that invoking the loop-vectorizer is required here?


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D98934



More information about the llvm-commits mailing list