This is an archive of the discontinued LLVM Phabricator instance.

[InstCombine] collectBitParts - add fshl/fshr handling
ClosedPublic

Authored by RKSimon on Sep 25 2020, 4:50 AM.

Details

Summary

Pulled from D87452, this is a fixed version of the collectBitParts fshl/fshr handling which as @nikic noticed wasn't checking for different providers or had correct bit ordering (which was hid by only testing shift amounts of bitwidth/2).

Diff Detail

Event Timeline

RKSimon created this revision.Sep 25 2020, 4:50 AM
Herald added a project: Restricted Project. · View Herald TranscriptSep 25 2020, 4:50 AM
Herald added a subscriber: hiraditya. · View Herald Transcript
nikic accepted this revision.Sep 25 2020, 11:45 AM

This LGTM now, thanks!

llvm/lib/Transforms/Utils/Local.cpp
2947

I would if (auto *II = dyn_cast<IntrinsicInst>(I)) and then II->getInrinsicID() here. Doesn't seem necessary to explicitly go through the Function.

2950

modulo -> modulo the bitwidth?

This revision is now accepted and ready to land.Sep 25 2020, 11:45 AM
This revision was automatically updated to reflect the committed changes.