[InstCombine] canNarrowShiftAmt - replace custom Constant matching with m_SpecificInt...
authorSimon Pilgrim <llvm-dev@redking.me.uk>
Thu, 8 Oct 2020 09:53:32 +0000 (10:53 +0100)
committerSimon Pilgrim <llvm-dev@redking.me.uk>
Thu, 8 Oct 2020 09:53:32 +0000 (10:53 +0100)
commitaa47962cc9493cd79ca78954e721ed02479729c7
treea78452d93eed379a0dd3b6821f966091e78facb1
parentcc83dc191c1ef04907ccd4308cc6aa5bf6fcd3c6
[InstCombine] canNarrowShiftAmt - replace custom Constant matching with m_SpecificInt_ICMP

The existing code ignores undef values which matches m_SpecificInt_ICMP, although m_SpecificInt_ICMP returns false for an all-undef constant, I've added test coverage at rGfe0197e194a64f9 to show that undef folding should already have dealt with that case.
llvm/lib/Transforms/InstCombine/InstCombineAndOrXor.cpp