This is an archive of the discontinued LLVM Phabricator instance.

[LVI] Handle `x & 0xfff0 == 0x1230` comparison
AbandonedPublic

Authored by antoniofrighetto on Jan 11 2023, 7:14 AM.

Details

Reviewers
nikic
reames
Summary

LazyValueInfo now handles the comparison of a value when masked in a certain way with a constant. For example, for a 16-bit integer, we might have x & 0xfff0 == 0x1230. This is a typical situation produced by InstCombine to efficiently check if x is between [0x1230, 0x1240).

Diff Detail

Event Timeline

Herald added a project: Restricted Project. · View Herald TranscriptJan 11 2023, 7:14 AM
antoniofrighetto requested review of this revision.Jan 11 2023, 7:14 AM
Herald added a project: Restricted Project. · View Herald TranscriptJan 11 2023, 7:14 AM
nikic added a comment.Jan 11 2023, 7:19 AM

Tests?

llvm/lib/Analysis/LazyValueInfo.cpp
1137

Please integrate your code here. It's not super obvious to me in what way it extends the existing handling.

nikic requested changes to this revision.Jan 12 2023, 12:54 AM
This revision now requires changes to proceed.Jan 12 2023, 12:54 AM
antoniofrighetto abandoned this revision.Jan 12 2023, 8:30 AM

Following thorough investigation, it turns out that the introduced interval range refinement has already been covered in db9d00c by @nikic. Closing this, sorry for the incident.