This does for readability of returns within said function as what we do for the caller side when reasoning about what might be poison.
Couldn't figure out a small test. I'm working on this from SCEV, but that's blocked by other things as well.
Differential D111180
The result of a function with noundef return attribute must be well defined reames on Oct 5 2021, 1:36 PM. Authored by
Details This does for readability of returns within said function as what we do for the caller side when reasoning about what might be poison. Couldn't figure out a small test. I'm working on this from SCEV, but that's blocked by other things as well.
Diff Detail Event TimelineComment Actions If nothing else you could add a unit test, see programUndefinedIfPoison/isGuaranteedNotToBePoison tests in ValueTrackingTest.
Comment Actions Added D111186 as a dependency. Will rebase over updated tests once I can exercise this from SCEV. Comment Actions Add tests - key detail is that removing udiv no-longer has any effect as noimplicit defs serves as a immediate UB root. |
This should guard against void returns, in which case getOperand(0) would assert.