HomePhabricator

[APInt] Add unittests that demonstrate how very broken APIntOps::isShiftedMask…

Description

[APInt] Add unittests that demonstrate how very broken APIntOps::isShiftedMask is.

Did you know that 0 is a shifted mask? But 0x0000ff00 and 0x000000ff aren't? At least we get 0xff000000 right.

I only see one usage of this function in the code base today and its in InstCombine. I think its protected against 0 being misreported as a mask. I guess we just don't have tests for the missed cases.

Details

Committed
ctopperMar 30 2017, 11:30 PM
Parents
rL299186: [Scalarizer] Handle scalar arguments in vector GEP
Branches
Unknown
Tags
Unknown