Page MenuHomePhabricator

[Attr] Introduce the `nopoison` attribute
AbandonedPublic

Authored by bbn on Jun 22 2020, 8:10 AM.

Details

Summary

The nopoison IR attribute indicates that the value it associated with cannot be poison, so it will be safe for us to perform more optimizations to it.

For example, consider the following code[1]:

t = x + 1;
if (t == y) {
w = x + 1;
foo(w);
}

if we determine that y cannot be poison, then we can apply the GVN optimization to the code above.

[1] 2016 LLVM Developers’ Meeting: N. Lopes “Undefined Behavior: Long Live Poison!"

Diff Detail

Unit TestsFailed

TimeTest
5,100 mslinux > libFuzzer.libFuzzer::Unknown Unit Message ("")
Script: -- : 'RUN: at line 1'; /mnt/disks/ssd0/agent/llvm-project/build/./bin/clang --driver-mode=g++ -O2 -gline-tables-only -fsanitize=address,fuzzer -I/mnt/disks/ssd0/agent/llvm-project/compiler-rt/lib/fuzzer -m64 /mnt/disks/ssd0/agent/llvm-project/compiler-rt/test/fuzzer/CleanseTest.cpp -o /mnt/disks/ssd0/agent/llvm-project/build/projects/compiler-rt/test/fuzzer/X86_64DefaultLinuxConfig/Output/cleanse.test.tmp-CleanseTest

Event Timeline

bbn created this revision.Jun 22 2020, 8:10 AM
nikic added a subscriber: nikic.

This overlaps with D82316. I believe the attribute defined there is more useful, because we generally need values to be non-poison *and* non-undef to make meaningful optimizations.

bbn abandoned this revision.Jun 22 2020, 7:52 PM

This overlaps with D82316. I believe the attribute defined there is more useful, because we generally need values to be non-poison *and* non-undef to make meaningful optimizations.

Oh sorry I didn't notice that, lets close this revision and move to that one.