ret i8 %t1
}
+; Freeze is transparent as far as negation is concerned
+define i4 @negate_freeze(i4 %x, i4 %y, i4 %z) {
+; CHECK-LABEL: @negate_freeze(
+; CHECK-NEXT: [[T0:%.*]] = sub i4 [[X:%.*]], [[Y:%.*]]
+; CHECK-NEXT: [[T1:%.*]] = freeze i4 [[T0]]
+; CHECK-NEXT: [[T2:%.*]] = sub i4 [[Z:%.*]], [[T1]]
+; CHECK-NEXT: ret i4 [[T2]]
+;
+ %t0 = sub i4 %x, %y
+ %t1 = freeze i4 %t0
+ %t2 = sub i4 %z, %t1
+ ret i4 %t2
+}
+define i4 @negate_freeze_extrause(i4 %x, i4 %y, i4 %z) {
+; CHECK-LABEL: @negate_freeze_extrause(
+; CHECK-NEXT: [[T0:%.*]] = sub i4 [[X:%.*]], [[Y:%.*]]
+; CHECK-NEXT: [[T1:%.*]] = freeze i4 [[T0]]
+; CHECK-NEXT: call void @use4(i4 [[T1]])
+; CHECK-NEXT: [[T2:%.*]] = sub i4 [[Z:%.*]], [[T1]]
+; CHECK-NEXT: ret i4 [[T2]]
+;
+ %t0 = sub i4 %x, %y
+ %t1 = freeze i4 %t0
+ call void @use4(i4 %t1)
+ %t2 = sub i4 %z, %t1
+ ret i4 %t2
+}
+
; CHECK: !0 = !{!"branch_weights", i32 40, i32 1}
!0 = !{!"branch_weights", i32 40, i32 1}