[PATCH] D50233: [InstCombine] Transform str(n)cmp to memcmp

Eli Friedman via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Sep 4 14:11:29 PDT 2018


efriedma added a comment.

> for example it could update a thread local variable whenever it reads a byte and my program could then read this variable and hence observe the value of the uninitialized memory

We assume memcmp has the semantics described in the C standard unless you specify -fno-builtin or something; otherwise, we couldn't transform it at all.

> Do we guarantee the correctness of programs if a custom opt pipeline is used (eg. disabled ExpandMemCmp, enabled InstCombine pass)?

We try to, yes... and even if we didn't, I'd be worried about it getting out of sync.


Repository:
  rL LLVM

https://reviews.llvm.org/D50233





More information about the llvm-commits mailing list