[PATCH] D134410: [clang][CodeGen] Add noundef metadata to load instructions (preliminary)

Vitaly Buka via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Sat Oct 15 13:20:58 PDT 2022


vitalybuka added a reviewer: vitalybuka.
vitalybuka added a comment.

In D134410#3817190 <https://reviews.llvm.org/D134410#3817190>, @vitalybuka wrote:

>> Also I applied this patch with D134698 <https://reviews.llvm.org/D134698> and used on our large test set, expecting significant number of pre-existing reports. To my surprise I see not many of them.
>
> Something wrong with my msan experiment, I'll re-evaluate size and reports tomorrow.

Finally I had a time to fix my msan experiment D134698 <https://reviews.llvm.org/D134698>
It's about 5.5% .text savings for Msan, and 10% for msan with "track origins", which is pretty good.
For context, for msan it's usually cheaper to report uninitialized ASAP, then propagating and report it later. With this metadata it will happen immediately after load.

However cleanup looks scary. Msan reports maybe 20% of unique tests on our code base. Many a of them share root cause, but still many unique root causes.
On quick looks I see no false report. A lot of stuff like this https://stackoverflow.com/questions/60112841/copying-structs-with-uninitialized-members which is technically is UB.
I assume with this patch landed, many such cases may change code behavior. So we will need to update msan to have a tool to detect cases like this anyway.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D134410



More information about the cfe-commits mailing list