This is an archive of the discontinued LLVM Phabricator instance.

[SCEV] Fix potentially empty set for unsigned ranges
ClosedPublic

Authored by tejas on Aug 29 2023, 9:26 PM.

Details

Summary

The following commit enabled the analysis of ranges for heap allocations:
22ca38da25e19a7c5fcfeb3f22159aba92ec381e

The range turns out to be empty in cases such as the one in test (which
is [1,1)), leading to an assertion failure. This patch fixes for the
same case.

Fixes https://github.com/llvm/llvm-project/issues/63856

Diff Detail

Event Timeline

tejas created this revision.Aug 29 2023, 9:26 PM
Herald added a project: Restricted Project. · View Herald TranscriptAug 29 2023, 9:26 PM
Herald added a subscriber: hiraditya. · View Herald Transcript
tejas requested review of this revision.Aug 29 2023, 9:26 PM
Herald added a project: Restricted Project. · View Herald TranscriptAug 29 2023, 9:26 PM
fhahn added a subscriber: davide.Aug 30 2023, 7:44 AM

Looks like this fixes the same issue as D155255. @davide are you planning on addressing the outstanding comments for D155255?

Fine to get this one instead.

tejas added a comment.Aug 30 2023, 8:36 PM

@davide @fhahn Oops! I didn't check if there was already a patch about to be submitted. Pardon, I didn't check before sending this one in.

fhahn accepted this revision.Sep 1 2023, 2:02 AM

LGTM, thanks!

llvm/test/Analysis/ScalarEvolution/malloc.ll
33

nit: fix indent here.

This revision is now accepted and ready to land.Sep 1 2023, 2:02 AM
fhahn added a comment.Sep 1 2023, 2:02 AM

Please add Fixes https://github.com/llvm/llvm-project/issues/63856 to the commit message to auto-close the related issue.

tejas updated this revision to Diff 555648.Sep 3 2023, 8:31 PM
tejas edited the summary of this revision. (Show Details)

Added the github issue link for the fix.

tejas added a comment.Sep 3 2023, 8:32 PM

@fhahn Can you please commit on my behalf? I do not have the permissions. Thanks!

This revision was landed with ongoing or failed builds.Sep 4 2023, 2:48 AM
This revision was automatically updated to reflect the committed changes.