[PATCH] D83752: [ValueTracking] Let isGuaranteedNotToBeUndefOrPoison consider noundef and more operations

Juneyoung Lee via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Jul 14 20:02:17 PDT 2020


aqjune marked 2 inline comments as done.
aqjune added a comment.

After this patch is accepted, I'll make a separate commit for tests so only diffs are updated.



================
Comment at: llvm/include/llvm/Analysis/ValueTracking.h:610
+  /// If IgnorePadding is true, V's paddings are not inspected. If false,
+  /// the paddings should be frozen as well.
   bool isGuaranteedNotToBeUndefOrPoison(const Value *V,
----------------
nikic wrote:
> Why do we need this parameter? Padding only matters for the stored representation of a struct. For SSA struct values, the padding cannot be accessed.
It is because freeze can take an aggregate value.
I found that its behavior w.r.t aggregate values is not specified in LangRef, but I think it is good to make it freeze the paddings too because it guarantees that `v = freeze(load p); store v, q` will never have undef bits or poison in memory.
If this sounds good, I'll make a patch for this.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D83752





More information about the llvm-commits mailing list