[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 13:46:14 PDT 2021


nikic added a reviewer: nikic.
nikic added a comment.

If nothing else you could add a unit test, see programUndefinedIfPoison/isGuaranteedNotToBePoison tests in ValueTrackingTest.



================
Comment at: llvm/lib/Analysis/ValueTracking.cpp:5423
+      if (I->getFunction()->hasRetAttribute(Attribute::NoUndef))
+        Operands.insert(I->getOperand(0));
+      break;
----------------
This should guard against void returns, in which case getOperand(0) would assert.


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