[PATCH] D71435: [WIP] [Attributor] Function level undefined behavior attribute

Stefanos Baziotis via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Dec 16 16:53:45 PST 2019


baziotis marked an inline comment as done.
baziotis added inline comments.


================
Comment at: llvm/lib/Transforms/IPO/Attributor.cpp:2040
+  }
+};
+
----------------
jdoerfert wrote:
> baziotis wrote:
> > jdoerfert wrote:
> > > Let's also add a manifest method to replace the loads that are still considered UB with an undef (for now). That should allow us to test this.
> > The whole instruction? Like replace `%a = load i32, i32* null` with `undef`. I don't think this can happen. Maybe I misunderstood and you meant replace it with this: `%a = load i32, i32* undef` (i.e. replace the pointer operand value).
> Your first interpretation was what I meant. Replace the load (instruction) with undef. We actually want to be more aggressive but we will need that step either way.
Sorry but I couldn't find a way to do that. I've seen in the language reference that one can do this: `%some_name = undef` and so I guess this is what we want, but I couldn't produce it. The closest thing I found is `deleteAfterManifest` which replaces _its uses_ with `undef` but will also delete the instruction. I guess we actually need the instruction (or, its replaced counterpart) so that the info of undefined behavior stays.


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

https://reviews.llvm.org/D71435





More information about the llvm-commits mailing list