[PATCH] D91957: [Support] Migrate more high level cost functions to using InstructionCost

David Sherwood via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Dec 15 04:31:46 PST 2020


david-arm marked 4 inline comments as done.
david-arm added inline comments.


================
Comment at: llvm/lib/Transforms/Scalar/LoopFlatten.cpp:320
   // loop but not in the inner loop to be executed extra times.
-  if (RepeatedInstrCost > RepeatedInstructionThreshold) {
+  if (!RepeatedInstrCost.isValid() ||
+      RepeatedInstrCost > RepeatedInstructionThreshold) {
----------------
sdesmalen wrote:
> The same holds true here (that you can just dereference RepeatedInstrCost) because the cost should never be Invalid.
Hi @sdesmalen, I wasn't sure if that was the case here because we're iterating through blocks in the FlattenInfo structure that the caller created. I wondered if there was a possibility someone might have created some new instructions or modified existing ones and it seemed trivial to add a check here.


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

https://reviews.llvm.org/D91957



More information about the llvm-commits mailing list