[PATCH] D102515: [CostModel] Return an invalid cost for memory ops with unsupported types

Daniil Fukalov via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Jun 2 01:04:29 PDT 2021


dfukalov added inline comments.


================
Comment at: llvm/lib/CodeGen/TargetLoweringBase.cpp:1826-1828
+    if (LK.first == TypeScalarizeScalableVector)
+      return std::make_pair(InstructionCost::getInvalid(), MVT::getVT(Ty));
+
----------------
My observation was that here less destructive for test is to just `Cost.setInvalid()` instead of return 'empty' invalid value. So the function continues to return the same numeric value but with `invalid` flag. It will create less impact on the current flow.

Most of operations with `InstructionCost` are not aware of invalid flag. I guess it might be be next separated step to stop loop here and just return invalid value and then gather all side effects of 'changed' cost numeric value.

Btw my D102915, D103407 and D103406 are preparation to return invalid cost flag from the function and to reduce impact of the change.


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

https://reviews.llvm.org/D102515



More information about the llvm-commits mailing list