[PATCH] D105169: [Clang/Test]: Rename enable_noundef_analysis to disable-noundef-analysis and turn it off by default

Hyeongyu Kim via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Sun Sep 12 23:27:32 PDT 2021


hyeongyukim added a comment.

I did some experiments to confirm the benefits of adding a noundef attribute to the function parameter. (test result link <https://docs.google.com/spreadsheets/d/1NC1LwwCE1UXsPIKE4B9_uADKE3hiNbiBxtpvuF5Ei_c/edit#gid=0>)

One of the most significant advantages of this patch is that it can improve performance by removing unnecessary Freeze.
To check whether the performance is improved, first, I checked how much performance regression occurred on SPECrate2017 <https://www.spec.org/cpu2017/> when we fixed the miscompilation problem of LoopUnswitch through the Freeze (D106041 <https://reviews.llvm.org/D106041>.)
Then, I applied this patch to see if the unnecessary Freeze was removed and performance was improved.
>From the experimental results, the following facts were found.

- Fixing only LoopUnswitch(D106041 <https://reviews.llvm.org/D106041>) reduces runtime performance and increases object size.
- Freeze added that fixing the LoopUnswitch interferes with other optimizations, increasing the number of instructions. (There is still a problem with LoopUnswitch due to these performance problems)

- Applying this patch improves runtime and makes the object size almost the same as the LLVM trunk.
- Knowing that Function arguments are not noundef/poison, some freezes were removed, and performance and binary size have been improved.

The second sheet compares the performance of the LLVM trunk and this patch, but there is no noticeable change.
In the last sheet, about 2,000 LLVM test-suites were compiled, and the object size was compared. In most cases, the object size was improved.

I think many advantages can be obtained by applying this patch.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D105169/new/

https://reviews.llvm.org/D105169



More information about the cfe-commits mailing list