[PATCH] D94065: [NFC] Make remaining cost functions in LoopVectorize.cpp use InstructionCost

Christopher Tetreault via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Jan 12 15:39:21 PST 2021


ctetreau added inline comments.


================
Comment at: llvm/lib/Transforms/Vectorize/LoopVectorize.cpp:6947
       }
+      assert(InterleaveCost.isValid() && "Invalid interleave cost");
 
----------------
I assume that this assert is being added to ensure that this patch is NFC. I don't believe that this is necessary. Everywhere that currently returns invalid used to assert prior to this effort. So, if we just let the invalids flow through the system, and unconditionally dereference them, we will still get an assert when the resulting value is evaluated. Prior to this change, if this function was called, and an invalid cost would have been created, an assertion failure would result. After this change, this will still be the case because the callsites are not being updated in this patch.

Therefore, I submit that we only get functional changes when we introduce logic to handle invalid costs. Any code that accumulates costs or compares costs does not represent a functional change.


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

https://reviews.llvm.org/D94065



More information about the llvm-commits mailing list