This is an archive of the discontinued LLVM Phabricator instance.

Change Attribute::get to consider 0 value as IntValue
AbandonedPublic

Authored by anna on Apr 20 2022, 12:32 PM.

Details

Summary

Alternate approach to D124115. I honestly prefer D124115, but placing
this here to show the alternate way involving fixing locations where we
consider zero value for enum attributes. Note that without the change in
Transforms/IPO/Attributor.cpp, this change fails for the test
test/Transforms/Attributor/nonnull.ll.
There are couple of other failures as well, I just fixed this
Attributor.cpp, but we will need to do the same for other usages where
we make this assumption (enum attribute can contain zero value passed
in).

The benefit of this approach is that it makes the Attribute::get API
clearer and callers will need to honour the API.

Diff Detail