@struct_6xi32 = global {[6 x i32]} zeroinitializer
@struct_128xi16 = global {[128 x i16]} zeroinitializer
-declare void @llvm.memcpy.p0i8.p0i8.i64(i8* nocapture, i8* nocapture readonly, i64, i1)
+declare void @llvm.memcpy.p0.p0.i64(ptr nocapture, ptr nocapture readonly, i64, i1)
define inreg {i8} @ret_struct_i8() nounwind {
; O32-LABEL: ret_struct_i8:
; N64-LE-NEXT: jr $ra
; N64-LE-NEXT: lb $2, %lo(struct_byte)($1)
entry:
- %0 = load volatile {i8}, {i8}* @struct_byte
+ %0 = load volatile {i8}, ptr @struct_byte
ret {i8} %0
}
; N64-LE-NEXT: daddiu $sp, $sp, 16
entry:
%retval = alloca {i8,i8}, align 1
- %0 = bitcast {i8,i8}* %retval to i8*
- call void @llvm.memcpy.p0i8.p0i8.i64(i8* %0, i8* getelementptr inbounds ({i8,i8}, {i8,i8}* @struct_2byte, i32 0, i32 0), i64 2, i1 false)
- %1 = bitcast {i8,i8}* %retval to {i16}*
- %2 = load volatile {i16}, {i16}* %1
- ret {i16} %2
+ call void @llvm.memcpy.p0.p0.i64(ptr %retval, ptr @struct_2byte, i64 2, i1 false)
+ %0 = load volatile {i16}, ptr %retval
+ ret {i16} %0
}
; Ensure that structures bigger than 32-bits but smaller than 64-bits are
; O32-LE-NEXT: lui $1, %hi(struct_3xi16)
; O32-LE-NEXT: lw $2, %lo(struct_3xi16)($1)
; O32-LE-NEXT: addiu $1, $1, %lo(struct_3xi16)
-; O32-LE-NEXT: lhu $3, 4($1)
; O32-LE-NEXT: jr $ra
-; O32-LE-NEXT: nop
+; O32-LE-NEXT: lhu $3, 4($1)
;
; N32-BE-LABEL: ret_struct_3xi16:
; N32-BE: # %bb.0: # %entry
; N64-LE-NEXT: jr $ra
; N64-LE-NEXT: or $2, $2, $1
entry:
- %0 = load volatile i48, i48* bitcast ({[3 x i16]}* @struct_3xi16 to i48*), align 2
+ %0 = load volatile i48, ptr @struct_3xi16, align 2
%1 = insertvalue {i48} undef, i48 %0, 0
ret {i48} %1
}
; Ensure that large structures (>128-bit) are returned indirectly.
; We pick an extremely large structure so we don't have to match inlined memcpy's.
-define void @ret_struct_128xi16({[128 x i16]}* sret({[128 x i16]}) %returnval) {
+define void @ret_struct_128xi16(ptr sret({[128 x i16]}) %returnval) {
; O32-LABEL: ret_struct_128xi16:
; O32: # %bb.0: # %entry
; O32-NEXT: addiu $sp, $sp, -24
; N64-NEXT: jr $ra
; N64-NEXT: daddiu $sp, $sp, 16
entry:
- %0 = bitcast {[128 x i16]}* %returnval to i8*
- call void @llvm.memcpy.p0i8.p0i8.i64(i8* align 2 %0, i8* align 2 bitcast ({[128 x i16]}* @struct_128xi16 to i8*), i64 256, i1 false)
+ call void @llvm.memcpy.p0.p0.i64(ptr align 2 %returnval, ptr align 2 @struct_128xi16, i64 256, i1 false)
ret void
}
; N64-NEXT: jr $ra
; N64-NEXT: sw $2, 0($4)
entry:
- %0 = load volatile {[6 x i32]}, {[6 x i32]}* @struct_6xi32, align 2
+ %0 = load volatile {[6 x i32]}, ptr @struct_6xi32, align 2
ret {[6 x i32]} %0
}
; MIPS32-EL-NEXT: addu $1, $2, $25
; MIPS32-EL-NEXT: lw $1, %got(si)($1)
; MIPS32-EL-NEXT: lwl $2, 3($1)
-; MIPS32-EL-NEXT: lwr $2, 0($1)
; MIPS32-EL-NEXT: jr $ra
-; MIPS32-EL-NEXT: nop
+; MIPS32-EL-NEXT: lwr $2, 0($1)
;
; MIPS32-EB-LABEL: load_SI:
; MIPS32-EB: # %bb.0: # %entry
; MIPS32-EB-NEXT: addu $1, $2, $25
; MIPS32-EB-NEXT: lw $1, %got(si)($1)
; MIPS32-EB-NEXT: lwl $2, 0($1)
-; MIPS32-EB-NEXT: lwr $2, 3($1)
; MIPS32-EB-NEXT: jr $ra
-; MIPS32-EB-NEXT: nop
+; MIPS32-EB-NEXT: lwr $2, 3($1)
;
; MIPS32R6-LABEL: load_SI:
; MIPS32R6: # %bb.0: # %entry
; MIPS32R6-NEXT: addiu $2, $2, %lo(_gp_disp)
; MIPS32R6-NEXT: addu $1, $2, $25
; MIPS32R6-NEXT: lw $1, %got(si)($1)
+; MIPS32R6-NEXT: jr $ra
; MIPS32R6-NEXT: lw $2, 0($1)
-; MIPS32R6-NEXT: jrc $ra
;
; MIPS64-EL-LABEL: load_SI:
; MIPS64-EL: # %bb.0: # %entry
; MIPS64-EL-NEXT: daddiu $1, $1, %lo(%neg(%gp_rel(load_SI)))
; MIPS64-EL-NEXT: ld $1, %got_disp(si)($1)
; MIPS64-EL-NEXT: lwl $2, 3($1)
-; MIPS64-EL-NEXT: lwr $2, 0($1)
; MIPS64-EL-NEXT: jr $ra
-; MIPS64-EL-NEXT: nop
+; MIPS64-EL-NEXT: lwr $2, 0($1)
;
; MIPS64-EB-LABEL: load_SI:
; MIPS64-EB: # %bb.0: # %entry
; MIPS64-EB-NEXT: daddiu $1, $1, %lo(%neg(%gp_rel(load_SI)))
; MIPS64-EB-NEXT: ld $1, %got_disp(si)($1)
; MIPS64-EB-NEXT: lwl $2, 0($1)
-; MIPS64-EB-NEXT: lwr $2, 3($1)
; MIPS64-EB-NEXT: jr $ra
-; MIPS64-EB-NEXT: nop
+; MIPS64-EB-NEXT: lwr $2, 3($1)
;
; MIPS64R2-EL-LABEL: load_SI:
; MIPS64R2-EL: # %bb.0: # %entry
; MIPS64R2-EL-NEXT: daddiu $1, $1, %lo(%neg(%gp_rel(load_SI)))
; MIPS64R2-EL-NEXT: ld $1, %got_disp(si)($1)
; MIPS64R2-EL-NEXT: lwl $2, 3($1)
-; MIPS64R2-EL-NEXT: lwr $2, 0($1)
; MIPS64R2-EL-NEXT: jr $ra
-; MIPS64R2-EL-NEXT: nop
+; MIPS64R2-EL-NEXT: lwr $2, 0($1)
;
; MIPS64R2-EB-LABEL: load_SI:
; MIPS64R2-EB: # %bb.0: # %entry
; MIPS64R2-EB-NEXT: daddiu $1, $1, %lo(%neg(%gp_rel(load_SI)))
; MIPS64R2-EB-NEXT: ld $1, %got_disp(si)($1)
; MIPS64R2-EB-NEXT: lwl $2, 0($1)
-; MIPS64R2-EB-NEXT: lwr $2, 3($1)
; MIPS64R2-EB-NEXT: jr $ra
-; MIPS64R2-EB-NEXT: nop
+; MIPS64R2-EB-NEXT: lwr $2, 3($1)
;
; MIPS64R6-LABEL: load_SI:
; MIPS64R6: # %bb.0: # %entry
; MIPS64R6-NEXT: daddu $1, $1, $25
; MIPS64R6-NEXT: daddiu $1, $1, %lo(%neg(%gp_rel(load_SI)))
; MIPS64R6-NEXT: ld $1, %got_disp(si)($1)
+; MIPS64R6-NEXT: jr $ra
; MIPS64R6-NEXT: lw $2, 0($1)
-; MIPS64R6-NEXT: jrc $ra
entry:
- %0 = load i32, i32* getelementptr inbounds (%struct.SI, %struct.SI* @si, i32 0, i32 0), align 1
+ %0 = load i32, ptr @si, align 1
ret i32 %0
}
; MIPS64R6-NEXT: jr $ra
; MIPS64R6-NEXT: sw $4, 0($1)
entry:
- store i32 %a, i32* getelementptr inbounds (%struct.SI, %struct.SI* @si, i32 0, i32 0), align 1
+ store i32 %a, ptr @si, align 1
ret void
}
; MIPS32-EL-NEXT: lwl $2, 3($1)
; MIPS32-EL-NEXT: lwr $2, 0($1)
; MIPS32-EL-NEXT: lwl $3, 7($1)
-; MIPS32-EL-NEXT: lwr $3, 4($1)
; MIPS32-EL-NEXT: jr $ra
-; MIPS32-EL-NEXT: nop
+; MIPS32-EL-NEXT: lwr $3, 4($1)
;
; MIPS32-EB-LABEL: load_SLL:
; MIPS32-EB: # %bb.0: # %entry
; MIPS32-EB-NEXT: lwl $2, 0($1)
; MIPS32-EB-NEXT: lwr $2, 3($1)
; MIPS32-EB-NEXT: lwl $3, 4($1)
-; MIPS32-EB-NEXT: lwr $3, 7($1)
; MIPS32-EB-NEXT: jr $ra
-; MIPS32-EB-NEXT: nop
+; MIPS32-EB-NEXT: lwr $3, 7($1)
;
; MIPS32R6-LABEL: load_SLL:
; MIPS32R6: # %bb.0: # %entry
; MIPS32R6-NEXT: addu $1, $2, $25
; MIPS32R6-NEXT: lw $1, %got(sll)($1)
; MIPS32R6-NEXT: lw $2, 0($1)
+; MIPS32R6-NEXT: jr $ra
; MIPS32R6-NEXT: lw $3, 4($1)
-; MIPS32R6-NEXT: jrc $ra
;
; MIPS64-EL-LABEL: load_SLL:
; MIPS64-EL: # %bb.0: # %entry
; MIPS64-EL-NEXT: daddiu $1, $1, %lo(%neg(%gp_rel(load_SLL)))
; MIPS64-EL-NEXT: ld $1, %got_disp(sll)($1)
; MIPS64-EL-NEXT: ldl $2, 7($1)
-; MIPS64-EL-NEXT: ldr $2, 0($1)
; MIPS64-EL-NEXT: jr $ra
-; MIPS64-EL-NEXT: nop
+; MIPS64-EL-NEXT: ldr $2, 0($1)
;
; MIPS64-EB-LABEL: load_SLL:
; MIPS64-EB: # %bb.0: # %entry
; MIPS64-EB-NEXT: daddiu $1, $1, %lo(%neg(%gp_rel(load_SLL)))
; MIPS64-EB-NEXT: ld $1, %got_disp(sll)($1)
; MIPS64-EB-NEXT: ldl $2, 0($1)
-; MIPS64-EB-NEXT: ldr $2, 7($1)
; MIPS64-EB-NEXT: jr $ra
-; MIPS64-EB-NEXT: nop
+; MIPS64-EB-NEXT: ldr $2, 7($1)
;
; MIPS64R2-EL-LABEL: load_SLL:
; MIPS64R2-EL: # %bb.0: # %entry
; MIPS64R2-EL-NEXT: daddiu $1, $1, %lo(%neg(%gp_rel(load_SLL)))
; MIPS64R2-EL-NEXT: ld $1, %got_disp(sll)($1)
; MIPS64R2-EL-NEXT: ldl $2, 7($1)
-; MIPS64R2-EL-NEXT: ldr $2, 0($1)
; MIPS64R2-EL-NEXT: jr $ra
-; MIPS64R2-EL-NEXT: nop
+; MIPS64R2-EL-NEXT: ldr $2, 0($1)
;
; MIPS64R2-EB-LABEL: load_SLL:
; MIPS64R2-EB: # %bb.0: # %entry
; MIPS64R2-EB-NEXT: daddiu $1, $1, %lo(%neg(%gp_rel(load_SLL)))
; MIPS64R2-EB-NEXT: ld $1, %got_disp(sll)($1)
; MIPS64R2-EB-NEXT: ldl $2, 0($1)
-; MIPS64R2-EB-NEXT: ldr $2, 7($1)
; MIPS64R2-EB-NEXT: jr $ra
-; MIPS64R2-EB-NEXT: nop
+; MIPS64R2-EB-NEXT: ldr $2, 7($1)
;
; MIPS64R6-LABEL: load_SLL:
; MIPS64R6: # %bb.0: # %entry
; MIPS64R6-NEXT: daddu $1, $1, $25
; MIPS64R6-NEXT: daddiu $1, $1, %lo(%neg(%gp_rel(load_SLL)))
; MIPS64R6-NEXT: ld $1, %got_disp(sll)($1)
+; MIPS64R6-NEXT: jr $ra
; MIPS64R6-NEXT: ld $2, 0($1)
-; MIPS64R6-NEXT: jrc $ra
entry:
- %0 = load i64, i64* getelementptr inbounds (%struct.SLL, %struct.SLL* @sll, i64 0, i32 0), align 1
+ %0 = load i64, ptr @sll, align 1
ret i64 %0
}
; MIPS64-EL-NEXT: daddiu $1, $1, %lo(%neg(%gp_rel(load_SI_sext_to_i64)))
; MIPS64-EL-NEXT: ld $1, %got_disp(si)($1)
; MIPS64-EL-NEXT: lwl $2, 3($1)
-; MIPS64-EL-NEXT: lwr $2, 0($1)
; MIPS64-EL-NEXT: jr $ra
-; MIPS64-EL-NEXT: nop
+; MIPS64-EL-NEXT: lwr $2, 0($1)
;
; MIPS64-EB-LABEL: load_SI_sext_to_i64:
; MIPS64-EB: # %bb.0: # %entry
; MIPS64-EB-NEXT: daddiu $1, $1, %lo(%neg(%gp_rel(load_SI_sext_to_i64)))
; MIPS64-EB-NEXT: ld $1, %got_disp(si)($1)
; MIPS64-EB-NEXT: lwl $2, 0($1)
-; MIPS64-EB-NEXT: lwr $2, 3($1)
; MIPS64-EB-NEXT: jr $ra
-; MIPS64-EB-NEXT: nop
+; MIPS64-EB-NEXT: lwr $2, 3($1)
;
; MIPS64R2-EL-LABEL: load_SI_sext_to_i64:
; MIPS64R2-EL: # %bb.0: # %entry
; MIPS64R2-EL-NEXT: daddiu $1, $1, %lo(%neg(%gp_rel(load_SI_sext_to_i64)))
; MIPS64R2-EL-NEXT: ld $1, %got_disp(si)($1)
; MIPS64R2-EL-NEXT: lwl $2, 3($1)
-; MIPS64R2-EL-NEXT: lwr $2, 0($1)
; MIPS64R2-EL-NEXT: jr $ra
-; MIPS64R2-EL-NEXT: nop
+; MIPS64R2-EL-NEXT: lwr $2, 0($1)
;
; MIPS64R2-EB-LABEL: load_SI_sext_to_i64:
; MIPS64R2-EB: # %bb.0: # %entry
; MIPS64R2-EB-NEXT: daddiu $1, $1, %lo(%neg(%gp_rel(load_SI_sext_to_i64)))
; MIPS64R2-EB-NEXT: ld $1, %got_disp(si)($1)
; MIPS64R2-EB-NEXT: lwl $2, 0($1)
-; MIPS64R2-EB-NEXT: lwr $2, 3($1)
; MIPS64R2-EB-NEXT: jr $ra
-; MIPS64R2-EB-NEXT: nop
+; MIPS64R2-EB-NEXT: lwr $2, 3($1)
;
; MIPS64R6-LABEL: load_SI_sext_to_i64:
; MIPS64R6: # %bb.0: # %entry
; MIPS64R6-NEXT: daddu $1, $1, $25
; MIPS64R6-NEXT: daddiu $1, $1, %lo(%neg(%gp_rel(load_SI_sext_to_i64)))
; MIPS64R6-NEXT: ld $1, %got_disp(si)($1)
+; MIPS64R6-NEXT: jr $ra
; MIPS64R6-NEXT: lw $2, 0($1)
-; MIPS64R6-NEXT: jrc $ra
entry:
- %0 = load i32, i32* getelementptr inbounds (%struct.SI, %struct.SI* @si, i64 0, i32 0), align 1
+ %0 = load i32, ptr @si, align 1
%conv = sext i32 %0 to i64
ret i64 %conv
}
; MIPS64R6-NEXT: daddu $1, $1, $25
; MIPS64R6-NEXT: daddiu $1, $1, %lo(%neg(%gp_rel(load_UI)))
; MIPS64R6-NEXT: ld $1, %got_disp(sui)($1)
+; MIPS64R6-NEXT: jr $ra
; MIPS64R6-NEXT: lwu $2, 0($1)
-; MIPS64R6-NEXT: jrc $ra
entry:
- %0 = load i32, i32* getelementptr inbounds (%struct.SUI, %struct.SUI* @sui, i64 0, i32 0), align 1
+ %0 = load i32, ptr @sui, align 1
%conv = zext i32 %0 to i64
ret i64 %conv
}
; MIPS64R6-NEXT: jr $ra
; MIPS64R6-NEXT: sd $4, 0($1)
entry:
- store i64 %a, i64* getelementptr inbounds (%struct.SLL, %struct.SLL* @sll, i64 0, i32 0), align 1
+ store i64 %a, ptr @sll, align 1
ret void
}
; MIPS64R6-NEXT: jr $ra
; MIPS64R6-NEXT: sw $4, 0($1)
entry:
- store i32 %a, i32* getelementptr inbounds (%struct.SI, %struct.SI* @si, i64 0, i32 0), align 1
+ store i32 %a, ptr @si, align 1
ret void
}
; MIPS64R6-NEXT: jr $ra
; MIPS64R6-NEXT: sh $2, 2($1)
entry:
- %0 = load %struct.S0, %struct.S0* getelementptr inbounds (%struct.S0, %struct.S0* @struct_s0, i32 0), align 1
- store %struct.S0 %0, %struct.S0* getelementptr inbounds (%struct.S0, %struct.S0* @struct_s0, i32 1), align 1
+ %0 = load %struct.S0, ptr @struct_s0, align 1
+ store %struct.S0 %0, ptr getelementptr inbounds (%struct.S0, ptr @struct_s0, i32 1), align 1
ret void
}
; MIPS64R6-NEXT: jr $ra
; MIPS64R6-NEXT: sw $2, 4($1)
entry:
- %0 = load %struct.S1, %struct.S1* getelementptr inbounds (%struct.S1, %struct.S1* @struct_s1, i32 0), align 1
- store %struct.S1 %0, %struct.S1* getelementptr inbounds (%struct.S1, %struct.S1* @struct_s1, i32 1), align 1
+ %0 = load %struct.S1, ptr @struct_s1, align 1
+ store %struct.S1 %0, ptr getelementptr inbounds (%struct.S1, ptr @struct_s1, i32 1), align 1
ret void
}
; MIPS64R6-NEXT: jr $ra
; MIPS64R6-NEXT: sd $2, 8($1)
entry:
- %0 = load %struct.S2, %struct.S2* getelementptr inbounds (%struct.S2, %struct.S2* @struct_s2, i32 0), align 1
- store %struct.S2 %0, %struct.S2* getelementptr inbounds (%struct.S2, %struct.S2* @struct_s2, i32 1), align 1
+ %0 = load %struct.S2, ptr @struct_s2, align 1
+ store %struct.S2 %0, ptr getelementptr inbounds (%struct.S2, ptr @struct_s2, i32 1), align 1
ret void
}
; MIPS64R2-EB-NEXT: jr $ra
; MIPS64R2-EB-NEXT: daddiu $sp, $sp, 16
entry:
- tail call void @extern_func([7 x i8]* byval([7 x i8]) @arr) nounwind
+ tail call void @extern_func(ptr byval([7 x i8]) @arr) nounwind
ret void
}
-declare void @extern_func([7 x i8]* byval([7 x i8]))
+declare void @extern_func(ptr byval([7 x i8]))