Generic: Make isMask_N and isShiftedMask_N consistent over 0
authorTim Northover <tnorthover@apple.com>
Fri, 10 Apr 2015 22:58:48 +0000 (22:58 +0000)
committerTim Northover <tnorthover@apple.com>
Fri, 10 Apr 2015 22:58:48 +0000 (22:58 +0000)
commitf5e4c28c3f1b0b997c14825bb46cd25a319f4479
treec1d55657d3e418375b53f805cd578a92751d391b
parentf894c7ecb211347b654334e08896713e622f4447
Generic: Make isMask_N and isShiftedMask_N consistent over 0

Previously, isMask_N returned false for 0 but isShiftedMask_N returned true.
Almost all uses are for pattern matching bitfield operations in the backends,
and expect false (this was discovered because of AArch64's copy of this logic).

Unfortunately, I couldn't put together a small non-fragile test for this. The
nature of the bitfield operations means that this edge case is only really
triggered for nodes like "(and N, 0)", which the DAG combiner is usually very
good at folding away before they get to this stage.

rdar://20501377

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@234659 91177308-0d34-0410-b5e6-96231b3b80d8
include/llvm/Support/MathExtras.h