[PATCH] D79163: [Target][ARM] Tune getCastInstrCost for extending masked loads and truncating masked stores

Dave Green via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue May 12 10:44:07 PDT 2020


dmgreen added inline comments.


================
Comment at: llvm/lib/Target/ARM/ARMTargetTransformInfo.cpp:212
+  // The extend of other kinds of load is free
+  if (I && isLoadOrMaskedLoad(I->getOperand(0))) {
     static const TypeConversionCostTblEntry LoadConversionTbl[] = {
----------------
This should now be (CCH == Normal || CCh  == Masked) ?
The costs wouldn't really be right for other types I don't think.
We may need to fix those up later, but that can be done in a different patch.


================
Comment at: llvm/test/Analysis/CostModel/ARM/cast.ll:2157
+
+  %v4i16_to_v4i32_zext = zext <4 x i16> %maskedloadv4i16 to <4 x i32>
+  %v4i16_to_v4i32_sext = sext <4 x i16> %maskedloadv4i16 to <4 x i32>
----------------
Can you make sure there are tests for the legal types: <4xi8>-><4xi32>, <4xi16>-><4xi32> and <8xi8>-><8xi16>


================
Comment at: llvm/test/Analysis/CostModel/ARM/cast.ll:2187
+
+  %v8i64_to_v8i8_trunc = trunc <8 x i64> undef to <8 x i8>
+  call void @llvm.masked.store.v8i8.p0v8i8(<8 x i8> %v8i64_to_v8i8_trunc, <8 x i8>* undef, i32 1, <8 x i1> undef)
----------------
Again you add stores for trunc of legal types, <4xi32>-><4xi8>, <4xi32>-><4xi16> and <8xi16>-><8xi8>


================
Comment at: llvm/test/Transforms/LoopVectorize/ARM/tail-folding-reduces-vf.ll:115
+
+attributes #0 = { nofree norecurse nounwind "correctly-rounded-divide-sqrt-fp-math"="false" "denormal-fp-math"="preserve-sign,preserve-sign" "denormal-fp-math-f32"="ieee,ieee" "disable-tail-calls"="false" "frame-pointer"="none" "less-precise-fpmad"="false" "min-legal-vector-width"="0" "no-infs-fp-math"="true" "no-jump-tables"="false" "no-nans-fp-math"="true" "no-signed-zeros-fp-math"="true" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="generic" "target-features"="+armv8.1-m.main,+dsp,+fp-armv8d16sp,+fp16,+fullfp16,+hwdiv,+lob,+mve,+mve.fp,+ras,+thumb-mode,+vfp2sp,+vfp3d16sp,+vfp4d16sp" "unsafe-fp-math"="false" "use-soft-float"="false" }
+
----------------
Can you try and cleanup the test.


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

https://reviews.llvm.org/D79163





More information about the llvm-commits mailing list