================
@@ -1643,11 +1643,14 @@ int LoopInterchangeProfitability::getInstrOrderCost() {
       //
       // then it is a bad order.
       if (SE->isKnownPredicate(ICmpInst::ICMP_SLT, InnerStep, OuterStep))
-        GoodOrder++;
+        GoodBasePtrs.insert(BasePtr);
       else if (SE->isKnownPredicate(ICmpInst::ICMP_SLT, OuterStep, InnerStep))
-        BadOrder++;
+        BadBasePtrs.insert(BasePtr);
----------------
sjoerdmeijer wrote:

Ah yeah, of course, I see now, makes sense and adding to a set is an elegant 
way to avoid counting the same base pointer multiple times

One last nit: it would be good to add a little comment here that we are 
deduplicating the base pointers. 

https://github.com/llvm/llvm-project/pull/193477
_______________________________________________
llvm-branch-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits

Reply via email to