This is an archive of the discontinued LLVM Phabricator instance.

[Assignment Tracking] Ignore stores to a negative offset from an alloca
ClosedPublic

Authored by Orlando on May 24 2023, 6:13 AM.

Diff Detail

Event Timeline

Orlando created this revision.May 24 2023, 6:13 AM
Herald added a project: Restricted Project. · View Herald TranscriptMay 24 2023, 6:13 AM
Herald added a subscriber: hiraditya. · View Herald Transcript
Orlando requested review of this revision.May 24 2023, 6:13 AM
Herald added a project: Restricted Project. · View Herald TranscriptMay 24 2023, 6:13 AM
jryans accepted this revision.May 24 2023, 6:22 AM

The llvm.org/PR123-style link in the patch summary doesn't seem to work. Perhaps for GitHub-only issues you need to use a direct link like https://github.com/llvm/llvm-project/issues/62838?

The patch looks good to me overall, thanks for working on this. I am wondering though... What would happen with a positive-but-still-out-of-bounds offset here?

This revision is now accepted and ready to land.May 24 2023, 6:22 AM
Orlando edited the summary of this revision. (Show Details)May 24 2023, 6:32 AM

The llvm.org/PR123-style link in the patch summary doesn't seem to work. Perhaps for GitHub-only issues you need to use a direct link like https://github.com/llvm/llvm-project/issues/62838?

Aha, I didn't set the link target properly. Fixed, thanks for pointing that out.

The patch looks good to me overall, thanks for working on this. I am wondering though... What would happen with a positive-but-still-out-of-bounds offset here?

Good question. Those assignments are tracked, for better or for worse. e.g. we get a DBG_VALUE describing that out of bounds offset covering a fragment of the variable which is also out of bounds. I can see the argument for not tracking them. I don't think actively tracking them causes any issues though. Possibly we might see a location list rather than a single location if one of these out-of-bounds locations had been DSE'd. I think it is worth looking into further. I'll add it to my list as a low priority task (due to the apparent "harmless" nature of it), if you're happy with that?

What would happen with a positive-but-still-out-of-bounds offset here?

Good question. Those assignments are tracked, for better or for worse. e.g. we get a DBG_VALUE describing that out of bounds offset covering a fragment of the variable which is also out of bounds. I can see the argument for not tracking them. I don't think actively tracking them causes any issues though. Possibly we might see a location list rather than a single location if one of these out-of-bounds locations had been DSE'd. I think it is worth looking into further. I'll add it to my list as a low priority task (due to the apparent "harmless" nature of it), if you're happy with that?

Thanks for the initial thoughts on this. It would be good to investigate eventually, but I agree it's fine to consider that low priority future work.

Great, thanks for the review.