This is an archive of the discontinued LLVM Phabricator instance.

[InstCombine] In SimplifyDemandedUseBits, use computeKnownBits directly to handle Constants
ClosedPublic

Authored by craig.topper on Apr 16 2017, 10:17 PM.

Details

Summary

Currently we don't explicitly process ConstantDataSequential, ConstantAggregateZero, or ConstantVector, or Undef before applying the Depth limit. Instead they occur after the depth check in the non-instruction path.

For the constant types that we do handle, the code is replicated from computeKnownBits.

This patch fixes the missing constant handling and the reduces the amount of code by just using computeKnownBits directly for any type of Constant.

Diff Detail

Repository
rL LLVM

Event Timeline

craig.topper created this revision.Apr 16 2017, 10:17 PM
spatel accepted this revision.Apr 20 2017, 6:44 AM

LGTM.

This revision is now accepted and ready to land.Apr 20 2017, 6:44 AM
This revision was automatically updated to reflect the committed changes.