This is an archive of the discontinued LLVM Phabricator instance.

[InstCombine] MakeAnd/Or/Xor handling to reuse previous APInt computations
ClosedPublic

Authored by craig.topper on Apr 14 2017, 1:55 PM.

Details

Summary

When checking if we should return a constant, we create some temporary APInts to see if we know all bits. But the exact computations we do are needed in several other locations in the same code.

This patch moves them to named temporaries so we can reuse them.

Ideally we'd write directly to KnownZero/One, but we currently seem to only write those variables after all the simplifications checks and I didn't want to change that with this patch.

Diff Detail

Repository
rL LLVM

Event Timeline

craig.topper created this revision.Apr 14 2017, 1:55 PM
davide accepted this revision.Apr 14 2017, 2:13 PM
This revision is now accepted and ready to land.Apr 14 2017, 2:13 PM
This revision was automatically updated to reflect the committed changes.