This is an archive of the discontinued LLVM Phabricator instance.

[InstCombine] Use APInt for all the math in foldICmpDivConstant
ClosedPublic

Authored by craig.topper on Sep 29 2017, 10:26 PM.

Details

Summary

This currently uses ConstantExpr to do its math, but as noted in a TODO it can all be done directly on APInt.

Diff Detail

Event Timeline

craig.topper created this revision.Sep 29 2017, 10:26 PM
majnemer added inline comments.Sep 30 2017, 4:05 PM
lib/Transforms/InstCombine/InstCombineCompares.cpp
61–71

This appears to handle non-splat vectors. Does the new code achieve the same result?

craig.topper added inline comments.Sep 30 2017, 11:32 PM
lib/Transforms/InstCombine/InstCombineCompares.cpp
61–71

Yes the existing code handled splat vectors, but I don't think the capability was ever used. The caller ensure it was either a scalar or a splat vector before we ever did any math.

This revision is now accepted and ready to land.Sep 30 2017, 11:43 PM
This revision was automatically updated to reflect the committed changes.