[LoopInterchange] Correcting the profitability check
authorRam-NK <ramkrishnan.nk@huawei.com>
Mon, 16 Jan 2023 19:23:46 +0000 (14:23 -0500)
committerCongzheUalberta <congzhecao@gmail.com>
Mon, 16 Jan 2023 19:36:06 +0000 (14:36 -0500)
commitee7188c8b2ab06e740470cee368b137e0781958c
treef562c13ed00c2f05c9cf1e32681372077e7f3b27
parent3f2f83ef41419507bcdaf751b86713ef193b7de0
[LoopInterchange] Correcting the profitability check

Before D135808, There would be endless loop interchange posibility (no
proper priority was there in profitability check. Any profitable check
may leads to loop-interchange). With this patch, there  is no endless
interchange (priority in profitable check is defined. Order of decision
is 'Cache cost' check, 'InstrOrderCost', 'Vectorization'). Corrected the
dependency checking inside isProfitableForVectorization(), corrected the
checking of bad order loops in isProfitablePerInstrOrderCost().

Reviewed By: Meinersbur, bmahjour, #loopoptwg

Differential Revision: https://reviews.llvm.org/D135808
llvm/lib/Transforms/Scalar/LoopInterchange.cpp
llvm/test/Transforms/LoopInterchange/loop-interchange-optimization-remarks.ll
llvm/test/Transforms/LoopInterchange/perserve-lcssa.ll
llvm/test/Transforms/LoopInterchange/pr57148.ll
llvm/test/Transforms/LoopInterchange/profitability.ll