This is an archive of the discontinued LLVM Phabricator instance.

[LLVM] Accept `noundef` attribute in function definitions/calls
ClosedPublic

Authored by guiand on Jul 8 2020, 10:30 AM.

Details

Summary

The noundef attribute indicates an argument or return value which
may never have an undef value representation.

This patch allows LLVM to parse the attribute.

Isolated out of D82316.

Diff Detail

Event Timeline

guiand created this revision.Jul 8 2020, 10:30 AM
nikic accepted this revision.Jul 8 2020, 11:33 AM

LGTM

llvm/include/llvm/IR/Attributes.td
42

nit: Missing period at the end.

llvm/lib/AsmParser/LLLexer.cpp
700

It looks like apart from immarg this is sorted alphabetically, so I'd move noundef before nounwind.

This revision is now accepted and ready to land.Jul 8 2020, 11:33 AM

This needs to include tests for bitcode writing and parsing.

guiand updated this revision to Diff 276503.Jul 8 2020, 11:44 AM

Added a test to attributes.ll, which seems to be where other attributes are tested. Is this sufficient?

guiand marked 2 inline comments as done.Jul 8 2020, 11:44 AM
eugenis accepted this revision.Jul 8 2020, 11:48 AM

LGTM

This revision was automatically updated to reflect the committed changes.