[LICM] Fix NumSunk statistic (NFC)
authorNikita Popov <nikita.ppv@gmail.com>
Wed, 24 Mar 2021 17:20:03 +0000 (18:20 +0100)
committerNikita Popov <nikita.ppv@gmail.com>
Wed, 24 Mar 2021 17:28:19 +0000 (18:28 +0100)
commit8a168d2d70678164004fca8de78e98bfb6e1272d
treef6eb15cc73af8abd29d00c030fb140ee85aacbf2
parent0bf833f670bdc42009b0ff208e8266f528e0a82c
[LICM] Fix NumSunk statistic (NFC)

LICM can sink instructions that have uses inside the loop, as
long as these uses are considered "free". However, if there were
only free uses inside the loop, and no uses outside the loop at
all, the instruction would still count towards the NumSunk
statistic. This resulted in a wild inflation of the NumSunk metric.
After this patch it drops down from 1141787 to 5852 on test-suite O3.
llvm/lib/Transforms/Scalar/LICM.cpp