As pointed out by Eli Friedman, the ARM backend should call setBooleanContents so that it can use known bits to make some optimizations.
In addition, this patch also contains a simple optimization to avoid duplicate ands in one of the test cases.
Unfortunately, this change causes a number of the existing tests to stop being useful. All but the last of the modified tests no longer test what they initially intended to do, mostly due to different undef handling (e.g., cse-call no longer generates any cmps).
I added a new testcase where the first mov is caused by the new code.