CodeGen peephole: fold redundant phys reg copies
[oota-llvm.git] / test / CodeGen / X86 / dagcombine-shifts.ll
index aed3550a9af2faf317666113ab208cd67f01900c..905cf052c39c5948afd2c501d89973ce89911ffb 100644 (file)
@@ -1,5 +1,3 @@
-; SCE: bug 39153
-
 ; RUN: llc < %s -mtriple=x86_64-linux-gnu | FileCheck %s
 
 ; fold (shl (zext (lshr (A, X))), X) -> (zext (shl (lshr (A, X)), X))
@@ -189,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
@@ -199,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)