; on an 'and' that should have been killed. It's not obvious
; why, but removing anything hides the bug, hence the long test.
-define void @simplify_before_foldAndOfICmps() {
+define void @simplify_before_foldAndOfICmps(ptr %p) {
; CHECK-LABEL: @simplify_before_foldAndOfICmps(
; CHECK-NEXT: [[A8:%.*]] = alloca i16, align 2
; CHECK-NEXT: [[L7:%.*]] = load i16, ptr [[A8]], align 2
; CHECK-NEXT: [[C18:%.*]] = or i1 [[C7]], [[TMP3]]
; CHECK-NEXT: [[TMP4:%.*]] = sext i1 [[C3]] to i64
; CHECK-NEXT: [[G26:%.*]] = getelementptr i1, ptr null, i64 [[TMP4]]
-; CHECK-NEXT: store i16 [[L7]], ptr undef, align 2
-; CHECK-NEXT: store i1 [[C18]], ptr undef, align 1
-; CHECK-NEXT: store ptr [[G26]], ptr undef, align 8
+; CHECK-NEXT: store i16 [[L7]], ptr [[P:%.*]], align 2
+; CHECK-NEXT: store i1 [[C18]], ptr [[P]], align 1
+; CHECK-NEXT: store ptr [[G26]], ptr [[P]], align 8
; CHECK-NEXT: ret void
;
%A8 = alloca i16
store i16 undef, ptr %G21
%C18 = icmp ule i1 %C10, %C7
%G26 = getelementptr i1, ptr null, i1 %C3
- store i16 %B33, ptr undef
- store i1 %C18, ptr undef
- store ptr %G26, ptr undef
+ store i16 %B33, ptr %p
+ store i1 %C18, ptr %p
+ store ptr %G26, ptr %p
ret void
}
ret float %trunc
}
-define float @reduce_precision_multi_use_0(float %x, float %y) {
+define float @reduce_precision_multi_use_0(float %x, float %y, ptr %p) {
; CHECK-LABEL: @reduce_precision_multi_use_0(
; CHECK-NEXT: [[X_EXT:%.*]] = fpext float [[X:%.*]] to double
; CHECK-NEXT: [[Y_EXT:%.*]] = fpext float [[Y:%.*]] to double
-; CHECK-NEXT: store double [[X_EXT]], ptr undef, align 8
+; CHECK-NEXT: store double [[X_EXT]], ptr [[P:%.*]], align 8
; CHECK-NEXT: [[MAXNUM:%.*]] = call double @llvm.maxnum.f64(double [[X_EXT]], double [[Y_EXT]])
; CHECK-NEXT: [[TRUNC:%.*]] = fptrunc double [[MAXNUM]] to float
; CHECK-NEXT: ret float [[TRUNC]]
;
%x.ext = fpext float %x to double
%y.ext = fpext float %y to double
- store double %x.ext, ptr undef
+ store double %x.ext, ptr %p
%maxnum = call double @llvm.maxnum.f64(double %x.ext, double %y.ext)
%trunc = fptrunc double %maxnum to float
ret float %trunc
}
-define float @reduce_precision_multi_use_1(float %x, float %y) {
+define float @reduce_precision_multi_use_1(float %x, float %y, ptr %p) {
; CHECK-LABEL: @reduce_precision_multi_use_1(
; CHECK-NEXT: [[X_EXT:%.*]] = fpext float [[X:%.*]] to double
; CHECK-NEXT: [[Y_EXT:%.*]] = fpext float [[Y:%.*]] to double
-; CHECK-NEXT: store double [[Y_EXT]], ptr undef, align 8
+; CHECK-NEXT: store double [[Y_EXT]], ptr [[P:%.*]], align 8
; CHECK-NEXT: [[MAXNUM:%.*]] = call double @llvm.maxnum.f64(double [[X_EXT]], double [[Y_EXT]])
; CHECK-NEXT: [[TRUNC:%.*]] = fptrunc double [[MAXNUM]] to float
; CHECK-NEXT: ret float [[TRUNC]]
;
%x.ext = fpext float %x to double
%y.ext = fpext float %y to double
- store double %y.ext, ptr undef
+ store double %y.ext, ptr %p
%maxnum = call double @llvm.maxnum.f64(double %x.ext, double %y.ext)
%trunc = fptrunc double %maxnum to float
ret float %trunc
ret float %trunc
}
-define float @reduce_precision_multi_use_0(float %x, float %y) {
+define float @reduce_precision_multi_use_0(float %x, float %y, ptr %p) {
; CHECK-LABEL: @reduce_precision_multi_use_0(
; CHECK-NEXT: [[X_EXT:%.*]] = fpext float [[X:%.*]] to double
; CHECK-NEXT: [[Y_EXT:%.*]] = fpext float [[Y:%.*]] to double
-; CHECK-NEXT: store double [[X_EXT]], ptr undef, align 8
+; CHECK-NEXT: store double [[X_EXT]], ptr [[P:%.*]], align 8
; CHECK-NEXT: [[MINNUM:%.*]] = call double @llvm.minnum.f64(double [[X_EXT]], double [[Y_EXT]])
; CHECK-NEXT: [[TRUNC:%.*]] = fptrunc double [[MINNUM]] to float
; CHECK-NEXT: ret float [[TRUNC]]
;
%x.ext = fpext float %x to double
%y.ext = fpext float %y to double
- store double %x.ext, ptr undef
+ store double %x.ext, ptr %p
%minnum = call double @llvm.minnum.f64(double %x.ext, double %y.ext)
%trunc = fptrunc double %minnum to float
ret float %trunc
}
-define float @reduce_precision_multi_use_1(float %x, float %y) {
+define float @reduce_precision_multi_use_1(float %x, float %y, ptr %p) {
; CHECK-LABEL: @reduce_precision_multi_use_1(
; CHECK-NEXT: [[X_EXT:%.*]] = fpext float [[X:%.*]] to double
; CHECK-NEXT: [[Y_EXT:%.*]] = fpext float [[Y:%.*]] to double
-; CHECK-NEXT: store double [[Y_EXT]], ptr undef, align 8
+; CHECK-NEXT: store double [[Y_EXT]], ptr [[P:%.*]], align 8
; CHECK-NEXT: [[MINNUM:%.*]] = call double @llvm.minnum.f64(double [[X_EXT]], double [[Y_EXT]])
; CHECK-NEXT: [[TRUNC:%.*]] = fptrunc double [[MINNUM]] to float
; CHECK-NEXT: ret float [[TRUNC]]
;
%x.ext = fpext float %x to double
%y.ext = fpext float %y to double
- store double %y.ext, ptr undef
+ store double %y.ext, ptr %p
%minnum = call double @llvm.minnum.f64(double %x.ext, double %y.ext)
%trunc = fptrunc double %minnum to float
ret float %trunc