This patch is a follow up of D84733.
If a function has noundef attribute in returned position, instructions that return undef or poison value cause UB.
Details
Diff Detail
- Repository
- rG LLVM Github Monorepo
Event Timeline
Cool :)
There is a typo in your subject line [Attributor].
llvm/lib/Transforms/IPO/AttributorAttributes.cpp | ||
---|---|---|
2052 | I don't think we need to simplify the value here. If it is not simplified, it should happen as part of AAReturned. I guess we can just not do it for now? | |
2057 | Reading this makes me question if it should ever happen. I hope AAReturnedValues will not look at dead returns so they should not be part of the RetInsts set and if that set is empty this should never be called. | |
2074–2079 | ||
2085 | Note: When the other patch lands we should check if we want to ask the AANoUndef here. |
llvm/lib/Transforms/IPO/AttributorAttributes.cpp | ||
---|---|---|
2057 | I overlooked the fact that a dead return instruction is ignored in checkForAllReturnedValuesAndReturnInsts. I'll fix this comment. |
- clarify that dead returned values are ignored in checkForReturnedValuesAndReturnedInsts in a comment.
I don't think we need to simplify the value here. If it is not simplified, it should happen as part of AAReturned. I guess we can just not do it for now?