[PATCH] D111180: The result of a function with noundef return attribute must be well defined
Nikita Popov via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Tue Oct 5 14:17:27 PDT 2021
nikic added inline comments.
================
Comment at: llvm/lib/Analysis/ValueTracking.cpp:5423
+ if (I->getFunction()->hasRetAttribute(Attribute::NoUndef))
+ Operands.insert(I->getOperand(0));
+ break;
----------------
nikic wrote:
> This should guard against void returns, in which case getOperand(0) would assert.
Hm, I guess this is not strictly necessary thanks to https://github.com/llvm/llvm-project/blob/7d541eb4d49aaaab6a51a3568b9214fd8691e2d3/llvm/lib/IR/Attributes.cpp#L1840. Having `noundef` implies that the return type cannot be void.
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D111180/new/
https://reviews.llvm.org/D111180
More information about the llvm-commits
mailing list