This is an archive of the discontinued LLVM Phabricator instance.

[InstCombine] Propagate nsw flag when turning mul by pow2 into shift when the constant is a vector splat or the scalar bit width is larger than 64-bits
ClosedPublic

Authored by craig.topper on Jun 27 2017, 10:19 AM.

Details

Summary

The check to see if we can propagate the nsw flag used m_ConstantInt(uint64_t*&) which doesn't work with splat vectors and has a restriction that the bitwidth of the ConstantInt must be 64-bits are less.

This patch changes it to use m_APInt to remove both these issues.

Diff Detail

Repository
rL LLVM

Event Timeline

craig.topper created this revision.Jun 27 2017, 10:19 AM
spatel accepted this revision.Jun 27 2017, 11:57 AM

LGTM.

This revision is now accepted and ready to land.Jun 27 2017, 11:57 AM
This revision was automatically updated to reflect the committed changes.