CodeGen peephole: fold redundant phys reg copies
[oota-llvm.git] / test / CodeGen / X86 / dagcombine-shifts.ll
index e5a67d7efc1ac4c89f076e49c23fcb176dee71d0..905cf052c39c5948afd2c501d89973ce89911ffb 100644 (file)
@@ -187,6 +187,8 @@ entry:
 ; Once the add is removed, the number of uses becomes one and therefore the
 ; dags are canonicalized. After Legalization, we need to make sure that the
 ; valuetype for the shift count is legal.
+; Verify also that we correctly fold the shl-shr sequence into an 
+; AND with bitmask.
 
 define void @g(i32 %a) {
   %b = lshr i32 %a, 2
@@ -197,5 +199,11 @@ define void @g(i32 %a) {
   ret void
 }
 
+; CHECK-LABEL: @g
+; CHECK-NOT: shr
+; CHECK-NOT: shl
+; CHECK: and
+; CHECK-NEXT: jmp
+
 declare void @f(i64)