llvm-project
4c14735e - [LoopVectorize] Verify the function once per pass, not once per loop (#216448)

Commit
1 day ago
[LoopVectorize] Verify the function once per pass, not once per loop (#216448) processLoop verifies the whole function once per vectorized loop, making LoopVectorize quadratic in the number of loops per function on assertion builds. In an `opt -O3` run the verifier accounts for 59% of the instructions for a function with 800 vectorizable loops, and 5.6% for SingleSource/Benchmarks/Linpack/linpack-pc.c. Move the call to the end of runImpl. Assertion builds still verify what LoopVectorize produces, but once per function instead of once per vectorized loop, which costs 0.1-0.7% of the O3 run. The call was added under DEBUG() in 2012 and became unconditional on assertion builds in c9f63297e24a. 0aa75fb12faa hit the same problem in SLPVectorizer and fixed it with EXPENSIVE_CHECKS (#48033).
Author
Parents
Loading