Files
clang-p2996/llvm/lib/Transforms/Utils/LoopConstrainer.cpp
Aleksandr Popov cd20600767 [LoopConstrainer] Apply loop gurads to check that loop bounds are safe (#71531)
Loop guards that apply to loop SCEV bounds allow IRCE for cases with
compound loop bounds such as:

if (K > 0 && M > 0)
  for (i = 0; i < min(K, M); i++) {...}

if (K > 0 && M > 0)
  for (i = min(K, M); i >= 0; i--) {...}

Otherwise SCEV couldn't prove that loops have safe bounds in these
cases.

Co-authored-by: Aleksander Popov <apopov@azul.com>
2024-03-13 18:30:03 +01:00

36 KiB