This is an archive of the discontinued LLVM Phabricator instance.

[AggressiveInstCombine] Add `AssumptionCache` to aggressive instcombine
ClosedPublic

Authored by anton-afanasyev on Sep 2 2021, 1:59 AM.

Details

Summary

Add support for @llvm.assume() to TruncInstCombine allowing
optimizations based on these intrinsics while computing known bits.

Diff Detail

Event Timeline

anton-afanasyev created this revision.Sep 2 2021, 1:59 AM
anton-afanasyev requested review of this revision.Sep 2 2021, 1:59 AM
Herald added a project: Restricted Project. · View Herald TranscriptSep 2 2021, 1:59 AM
spatel added inline comments.Sep 2 2021, 10:34 AM
llvm/lib/Transforms/AggressiveInstCombine/TruncInstCombine.cpp
290

IIUC, there's a subtle difference apart from adding the assumption cache in these calls - we are also now passing in the context instruction and domtree.

I'm not sure if it is possible to expose that in a regression test, but should we make that a preliminary patch? So add the wrapper calls while passing a null AC as step 1?

anton-afanasyev marked an inline comment as done.Sep 5 2021, 6:45 AM
anton-afanasyev added inline comments.
llvm/lib/Transforms/AggressiveInstCombine/TruncInstCombine.cpp
290
anton-afanasyev marked an inline comment as done.

Rebase against wrapper calls

spatel accepted this revision.Sep 7 2021, 5:50 AM

LGTM

This revision is now accepted and ready to land.Sep 7 2021, 5:50 AM
lebedev.ri accepted this revision.Sep 7 2021, 6:04 AM