6 changes: 3 additions & 3 deletions llvm/test/CodeGen/PowerPC/pcrel-local-caller-toc.ll
Original file line number Diff line number Diff line change
Expand Up @@ -57,11 +57,11 @@ define dso_local void @caller(i32 signext %a) local_unnamed_addr #2 {
; CHECK-NEXT: mtlr r0
; CHECK-NEXT: blr
entry:
%0 = load i32, i32* @global, align 4
%0 = load i32, ptr @global, align 4
%add = add nsw i32 %0, %a
%call = tail call signext i32 @callee(i32 signext %add)
%mul = mul nsw i32 %call, %call
store i32 %mul, i32* @global, align 4
store i32 %mul, ptr @global, align 4
ret void
}

Expand All @@ -83,7 +83,7 @@ define dso_local signext i32 @tail_caller(i32 signext %a) local_unnamed_addr #2
; CHECK-NEXT: mtlr r0
; CHECK-NEXT: blr
entry:
%0 = load i32, i32* @global, align 4
%0 = load i32, ptr @global, align 4
%add = add nsw i32 %0, %a
%call = tail call signext i32 @callee(i32 signext %add)
ret i32 %call
Expand Down
8 changes: 4 additions & 4 deletions llvm/test/CodeGen/PowerPC/pcrel-relocation-plus-offset.ll
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ define dso_local signext i32 @getElementLocal7() local_unnamed_addr {
; CHECK-O-NEXT: R_PPC64_PCREL34 array2+0x1c
; CHECK-O-NEXT: blr
entry:
%0 = load i32, i32* getelementptr inbounds ([10 x i32], [10 x i32]* @array2, i64 0, i64 7), align 4
%0 = load i32, ptr getelementptr inbounds ([10 x i32], ptr @array2, i64 0, i64 7), align 4
ret i32 %0
}

Expand All @@ -42,7 +42,7 @@ define dso_local signext i32 @getElementLocalNegative() local_unnamed_addr {
; CHECK-O-NEXT: R_PPC64_PCREL34 array2-0x8
; CHECK-O-NEXT: blr
entry:
%0 = load i32, i32* getelementptr inbounds ([10 x i32], [10 x i32]* @array2, i64 0, i64 -2), align 4
%0 = load i32, ptr getelementptr inbounds ([10 x i32], ptr @array2, i64 0, i64 -2), align 4
ret i32 %0
}

Expand All @@ -61,7 +61,7 @@ define dso_local signext i32 @getElementExtern4() local_unnamed_addr {
; CHECK-O: lwa 3, 16(3)
; CHECK-O-NEXT: blr
entry:
%0 = load i32, i32* getelementptr inbounds ([10 x i32], [10 x i32]* @array1, i64 0, i64 4), align 4
%0 = load i32, ptr getelementptr inbounds ([10 x i32], ptr @array1, i64 0, i64 4), align 4
ret i32 %0
}

Expand All @@ -80,7 +80,7 @@ define dso_local signext i32 @getElementExternNegative() local_unnamed_addr {
; CHECK-O: lwa 3, -4(3)
; CHECK-O-NEXT: blr
entry:
%0 = load i32, i32* getelementptr inbounds ([10 x i32], [10 x i32]* @array1, i64 0, i64 -1), align 4
%0 = load i32, ptr getelementptr inbounds ([10 x i32], ptr @array1, i64 0, i64 -1), align 4
ret i32 %0
}

Expand Down
30 changes: 14 additions & 16 deletions llvm/test/CodeGen/PowerPC/pcrel-tail-calls.ll
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@
; the past as we no longer need to restore the TOC pointer into R2 after
; most calls.

@Func = external local_unnamed_addr global i32 (...)*, align 8
@FuncLocal = common dso_local local_unnamed_addr global i32 (...)* null, align 8
@Func = external local_unnamed_addr global ptr, align 8
@FuncLocal = common dso_local local_unnamed_addr global ptr null, align 8

; No calls in this function but we assign the function pointers.
define dso_local void @AssignFuncPtr() local_unnamed_addr {
Expand All @@ -25,8 +25,8 @@ define dso_local void @AssignFuncPtr() local_unnamed_addr {
; CHECK-NEXT: pstd r4, FuncLocal@PCREL(0), 1
; CHECK-NEXT: blr
entry:
store i32 (...)* @Function, i32 (...)** @Func, align 8
store i32 (...)* @Function, i32 (...)** @FuncLocal, align 8
store ptr @Function, ptr @Func, align 8
store ptr @Function, ptr @FuncLocal, align 8
ret void
}

Expand All @@ -40,7 +40,7 @@ define dso_local void @TailCallLocalFuncPtr() local_unnamed_addr {
; CHECK-NEXT: bctr
; CHECK-NEXT: #TC_RETURNr8 ctr 0
entry:
%0 = load i32 ()*, i32 ()** bitcast (i32 (...)** @FuncLocal to i32 ()**), align 8
%0 = load ptr, ptr @FuncLocal, align 8
%call = tail call signext i32 %0()
ret void
}
Expand All @@ -56,25 +56,24 @@ define dso_local void @TailCallExtrnFuncPtr() local_unnamed_addr {
; CHECK-NEXT: bctr
; CHECK-NEXT: #TC_RETURNr8 ctr 0
entry:
%0 = load i32 ()*, i32 ()** bitcast (i32 (...)** @Func to i32 ()**), align 8
%0 = load ptr, ptr @Func, align 8
%call = tail call signext i32 %0()
ret void
}

define dso_local signext i32 @TailCallParamFuncPtr(i32 (...)* nocapture %passedfunc) local_unnamed_addr {
define dso_local signext i32 @TailCallParamFuncPtr(ptr nocapture %passedfunc) local_unnamed_addr {
; CHECK-LABEL: TailCallParamFuncPtr:
; CHECK: # %bb.0: # %entry
; CHECK-NEXT: mtctr r3
; CHECK-NEXT: mr r12, r3
; CHECK-NEXT: bctr
; CHECK-NEXT: #TC_RETURNr8 ctr 0
entry:
%callee.knr.cast = bitcast i32 (...)* %passedfunc to i32 ()*
%call = tail call signext i32 %callee.knr.cast()
%call = tail call signext i32 %passedfunc()
ret i32 %call
}

define dso_local signext i32 @NoTailIndirectCall(i32 (...)* nocapture %passedfunc, i32 signext %a) local_unnamed_addr {
define dso_local signext i32 @NoTailIndirectCall(ptr nocapture %passedfunc, i32 signext %a) local_unnamed_addr {
; CHECK-LABEL: NoTailIndirectCall:
; CHECK: # %bb.0: # %entry
; CHECK-NEXT: mflr r0
Expand All @@ -96,8 +95,7 @@ define dso_local signext i32 @NoTailIndirectCall(i32 (...)* nocapture %passedfun
; CHECK-NEXT: mtlr r0
; CHECK-NEXT: blr
entry:
%callee.knr.cast = bitcast i32 (...)* %passedfunc to i32 ()*
%call = tail call signext i32 %callee.knr.cast()
%call = tail call signext i32 %passedfunc()
%add = add nsw i32 %call, %a
ret i32 %add
}
Expand All @@ -108,7 +106,7 @@ define dso_local signext i32 @TailCallDirect() local_unnamed_addr {
; CHECK-NEXT: b Function@notoc
; CHECK-NEXT: #TC_RETURNd8 Function@notoc 0
entry:
%call = tail call signext i32 bitcast (i32 (...)* @Function to i32 ()*)()
%call = tail call signext i32 @Function()
ret i32 %call
}

Expand All @@ -132,7 +130,7 @@ define dso_local signext i32 @NoTailCallDirect(i32 signext %a) local_unnamed_add
; CHECK-NEXT: mtlr r0
; CHECK-NEXT: blr
entry:
%call = tail call signext i32 bitcast (i32 (...)* @Function to i32 ()*)()
%call = tail call signext i32 @Function()
%add = add nsw i32 %call, %a
ret i32 %add
}
Expand Down Expand Up @@ -181,7 +179,7 @@ define dso_local signext i32 @TailCallAbs() local_unnamed_addr {
; CHECK-NEXT: bctr
; CHECK-NEXT: #TC_RETURNr8 ctr 0
entry:
%call = tail call signext i32 inttoptr (i64 400 to i32 ()*)()
%call = tail call signext i32 inttoptr (i64 400 to ptr)()
ret i32 %call
}

Expand All @@ -208,7 +206,7 @@ define dso_local signext i32 @NoTailCallAbs(i32 signext %a) local_unnamed_addr {
; CHECK-NEXT: mtlr r0
; CHECK-NEXT: blr
entry:
%call = tail call signext i32 inttoptr (i64 400 to i32 ()*)()
%call = tail call signext i32 inttoptr (i64 400 to ptr)()
%add = add nsw i32 %call, %a
ret i32 %add
}
Expand Down
6 changes: 3 additions & 3 deletions llvm/test/CodeGen/PowerPC/pcrel-tls-general-dynamic.ll
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@

@x = external thread_local global i32, align 4

define nonnull i32* @GeneralDynamicAddressLoad() {
define nonnull ptr @GeneralDynamicAddressLoad() {
; CHECK-S-LABEL: GeneralDynamicAddressLoad:
; CHECK-S: paddi r3, 0, x@got@tlsgd@pcrel, 1
; CHECK-S-NEXT: bl __tls_get_addr@notoc(x@tlsgd)
Expand All @@ -25,7 +25,7 @@ define nonnull i32* @GeneralDynamicAddressLoad() {
; CHECK-O-NEXT: 0000000000000014: R_PPC64_TLSGD x
; CHECK-O-NEXT: 0000000000000014: R_PPC64_REL24_NOTOC __tls_get_addr
entry:
ret i32* @x
ret ptr @x
}

define i32 @GeneralDynamicValueLoad() {
Expand All @@ -48,6 +48,6 @@ define i32 @GeneralDynamicValueLoad() {
; CHECK-SYM-LABEL: Symbol table '.symtab' contains 7 entries
; CHECK-SYM: 0000000000000000 0 TLS GLOBAL DEFAULT UND x
entry:
%0 = load i32, i32* @x, align 4
%0 = load i32, ptr @x, align 4
ret i32 %0
}
6 changes: 3 additions & 3 deletions llvm/test/CodeGen/PowerPC/pcrel-tls-initial-exec.ll
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@

@x = external thread_local global i32, align 4

define i32* @InitialExecAddressLoad() {
define ptr @InitialExecAddressLoad() {
; CHECK-S-LABEL: InitialExecAddressLoad:
; CHECK-S: # %bb.0: # %entry
; CHECK-S-NEXT: pld r3, x@got@tprel@pcrel(0), 1
Expand All @@ -26,7 +26,7 @@ define i32* @InitialExecAddressLoad() {
; CHECK-O-NEXT: 0000000000000009: R_PPC64_TLS x
; CHECK-O-NEXT: 20 00 80 4e blr
entry:
ret i32* @x
ret ptr @x
}

define i32 @InitialExecValueLoad() {
Expand All @@ -45,6 +45,6 @@ define i32 @InitialExecValueLoad() {
; CHECK-SYM-LABEL: Symbol table '.symtab' contains 6 entries
; CHECK-SYM: 0000000000000000 0 TLS GLOBAL DEFAULT UND x
entry:
%0 = load i32, i32* @x, align 4
%0 = load i32, ptr @x, align 4
ret i32 %0
}
6 changes: 3 additions & 3 deletions llvm/test/CodeGen/PowerPC/pcrel-tls-local-dynamic.ll
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@

@x = hidden thread_local global i32 0, align 4

define nonnull i32* @LocalDynamicAddressLoad() {
define nonnull ptr @LocalDynamicAddressLoad() {
; CHECK-S-LABEL: LocalDynamicAddressLoad:
; CHECK-S: paddi r3, 0, x@got@tlsld@pcrel, 1
; CHECK-S-NEXT: bl __tls_get_addr@notoc(x@tlsld)
Expand All @@ -27,7 +27,7 @@ define nonnull i32* @LocalDynamicAddressLoad() {
; CHECK-O-NEXT: 18: paddi 3, 3, 0, 0
; CHECK-O-NEXT: 0000000000000018: R_PPC64_DTPREL34 x
entry:
ret i32* @x
ret ptr @x
}

define i32 @LocalDynamicValueLoad() {
Expand All @@ -50,6 +50,6 @@ define i32 @LocalDynamicValueLoad() {
; CHECK-O-NEXT: 0000000000000058: R_PPC64_DTPREL34 x
; CHECK-O-NEXT: 60: lwz 3, 0(3)
entry:
%0 = load i32, i32* @x, align 4
%0 = load i32, ptr @x, align 4
ret i32 %0
}
14 changes: 7 additions & 7 deletions llvm/test/CodeGen/PowerPC/pcrel-tls-local-exec.ll
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
@x = dso_local thread_local global i32 0, align 4
@y = dso_local thread_local global [5 x i32] [i32 0, i32 0, i32 0, i32 0, i32 0], align 4

define dso_local i32* @LocalExecAddressLoad() {
define dso_local ptr @LocalExecAddressLoad() {
; CHECK-S-LABEL: LocalExecAddressLoad:
; CHECK-S: # %bb.0: # %entry
; CHECK-S-NEXT: paddi r3, r13, x@TPREL, 0
Expand All @@ -21,7 +21,7 @@ define dso_local i32* @LocalExecAddressLoad() {
; CHECK-O-NEXT: 0000000000000000: R_PPC64_TPREL34 x
; CHECK-O-NEXT: 8: blr
entry:
ret i32* @x
ret ptr @x
}

define dso_local i32 @LocalExecValueLoad() {
Expand All @@ -36,7 +36,7 @@ define dso_local i32 @LocalExecValueLoad() {
; CHECK-O-NEXT: 28: lwz 3, 0(3)
; CHECK-O-NEXT: 2c: blr
entry:
%0 = load i32, i32* @x, align 4
%0 = load i32, ptr @x, align 4
ret i32 %0
}

Expand All @@ -52,7 +52,7 @@ define dso_local void @LocalExecValueStore(i32 %in) {
; CHECK-O-NEXT: 48: stw 3, 0(4)
; CHECK-O-NEXT: 4c: blr
entry:
store i32 %in, i32* @x, align 4
store i32 %in, ptr @x, align 4
ret void
}

Expand All @@ -68,12 +68,12 @@ define dso_local i32 @LocalExecValueLoadOffset() {
; CHECK-O-NEXT: 68: lwz 3, 12(3)
; CHECK-O-NEXT: 6c: blr
entry:
%0 = load i32, i32* getelementptr inbounds ([5 x i32], [5 x i32]* @y, i64 0, i64 3), align 4
%0 = load i32, ptr getelementptr inbounds ([5 x i32], ptr @y, i64 0, i64 3), align 4
ret i32 %0
}


define dso_local i32* @LocalExecValueLoadOffsetNoLoad() {
define dso_local ptr @LocalExecValueLoadOffsetNoLoad() {
; CHECK-S-LABEL: LocalExecValueLoadOffsetNoLoad:
; CHECK-S: # %bb.0: # %entry
; CHECK-S-NEXT: paddi r3, r13, y@TPREL, 0
Expand All @@ -85,5 +85,5 @@ define dso_local i32* @LocalExecValueLoadOffsetNoLoad() {
; CHECK-O-NEXT: 88: addi 3, 3, 12
; CHECK-O-NEXT: 8c: blr
entry:
ret i32* getelementptr inbounds ([5 x i32], [5 x i32]* @y, i64 0, i64 3)
ret ptr getelementptr inbounds ([5 x i32], ptr @y, i64 0, i64 3)
}
8 changes: 4 additions & 4 deletions llvm/test/CodeGen/PowerPC/pcrel-tls_get_addr_clobbers.ll
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
; RUN: llc -verify-machineinstrs -mtriple="powerpc64le-unknown-linux-gnu" \
; RUN: -ppc-asm-full-reg-names -mcpu=pwr10 -relocation-model=pic < %s | FileCheck %s

%0 = type { i32 (...)**, %0* }
@x = external dso_local thread_local unnamed_addr global %0*, align 8
define void @test(i8* %arg) {
%0 = type { ptr, ptr }
@x = external dso_local thread_local unnamed_addr global ptr, align 8
define void @test(ptr %arg) {
; CHECK-LABEL: test:
; CHECK: # %bb.0: # %entry
; CHECK-NEXT: mflr r0
Expand All @@ -20,6 +20,6 @@ define void @test(i8* %arg) {
; CHECK-NEXT: ld r30, -16(r1)
; CHECK-NEXT: mtlr r0
entry:
store i8* %arg, i8** bitcast (%0** @x to i8**), align 8
store ptr %arg, ptr @x, align 8
ret void
}
4 changes: 2 additions & 2 deletions llvm/test/CodeGen/PowerPC/pcrel.ll
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ define dso_local signext i32 @ReadLocalVarInt() local_unnamed_addr {
; CHECK-O-NEXT: R_PPC64_PCREL34 valIntLoc
; CHECK-O-NEXT: blr
entry:
%0 = load i32, i32* @valIntLoc, align 4
%0 = load i32, ptr @valIntLoc, align 4
ret i32 %0
}

Expand All @@ -54,6 +54,6 @@ define dso_local signext i32 @ReadGlobalVarInt() local_unnamed_addr {
; CHECK-O-NEXT: lwa 3, 0(3)
; CHECK-O-NEXT: blr
entry:
%0 = load i32, i32* @valIntGlob, align 4
%0 = load i32, ptr @valIntGlob, align 4
ret i32 %0
}
312 changes: 156 additions & 156 deletions llvm/test/CodeGen/PowerPC/pcrel_ldst.ll

Large diffs are not rendered by default.

102 changes: 51 additions & 51 deletions llvm/test/CodeGen/PowerPC/peephole-align.ll
Original file line number Diff line number Diff line change
Expand Up @@ -44,18 +44,18 @@ target triple = "powerpc64-unknown-linux-gnu"

define dso_local void @test_b4() nounwind {
entry:
%0 = load i8, i8* getelementptr inbounds (%struct.b4, %struct.b4* @b4v, i32 0, i32 0), align 1
%0 = load i8, ptr @b4v, align 1
%inc0 = add nsw i8 %0, 1
store i8 %inc0, i8* getelementptr inbounds (%struct.b4, %struct.b4* @b4v, i32 0, i32 0), align 1
%1 = load i8, i8* getelementptr inbounds (%struct.b4, %struct.b4* @b4v, i32 0, i32 1), align 1
store i8 %inc0, ptr @b4v, align 1
%1 = load i8, ptr getelementptr inbounds (%struct.b4, ptr @b4v, i32 0, i32 1), align 1
%inc1 = add nsw i8 %1, 2
store i8 %inc1, i8* getelementptr inbounds (%struct.b4, %struct.b4* @b4v, i32 0, i32 1), align 1
%2 = load i8, i8* getelementptr inbounds (%struct.b4, %struct.b4* @b4v, i32 0, i32 2), align 1
store i8 %inc1, ptr getelementptr inbounds (%struct.b4, ptr @b4v, i32 0, i32 1), align 1
%2 = load i8, ptr getelementptr inbounds (%struct.b4, ptr @b4v, i32 0, i32 2), align 1
%inc2 = add nsw i8 %2, 3
store i8 %inc2, i8* getelementptr inbounds (%struct.b4, %struct.b4* @b4v, i32 0, i32 2), align 1
%3 = load i8, i8* getelementptr inbounds (%struct.b4, %struct.b4* @b4v, i32 0, i32 3), align 1
store i8 %inc2, ptr getelementptr inbounds (%struct.b4, ptr @b4v, i32 0, i32 2), align 1
%3 = load i8, ptr getelementptr inbounds (%struct.b4, ptr @b4v, i32 0, i32 3), align 1
%inc3 = add nsw i8 %3, 4
store i8 %inc3, i8* getelementptr inbounds (%struct.b4, %struct.b4* @b4v, i32 0, i32 3), align 1
store i8 %inc3, ptr getelementptr inbounds (%struct.b4, ptr @b4v, i32 0, i32 3), align 1
ret void
}

Expand All @@ -70,12 +70,12 @@ entry:

define dso_local void @test_h2() nounwind {
entry:
%0 = load i16, i16* getelementptr inbounds (%struct.h2, %struct.h2* @h2v, i32 0, i32 0), align 2
%0 = load i16, ptr @h2v, align 2
%inc0 = add nsw i16 %0, 1
store i16 %inc0, i16* getelementptr inbounds (%struct.h2, %struct.h2* @h2v, i32 0, i32 0), align 2
%1 = load i16, i16* getelementptr inbounds (%struct.h2, %struct.h2* @h2v, i32 0, i32 1), align 2
store i16 %inc0, ptr @h2v, align 2
%1 = load i16, ptr getelementptr inbounds (%struct.h2, ptr @h2v, i32 0, i32 1), align 2
%inc1 = add nsw i16 %1, 2
store i16 %inc1, i16* getelementptr inbounds (%struct.h2, %struct.h2* @h2v, i32 0, i32 1), align 2
store i16 %inc1, ptr getelementptr inbounds (%struct.h2, ptr @h2v, i32 0, i32 1), align 2
ret void
}

Expand All @@ -89,12 +89,12 @@ entry:
; CHECK-DAG: sth [[REG1_1]], h2v@toc@l+2([[REGSTRUCT]])
define dso_local void @test_h2_optsize() optsize nounwind {
entry:
%0 = load i16, i16* getelementptr inbounds (%struct.h2, %struct.h2* @h2v, i32 0, i32 0), align 2
%0 = load i16, ptr @h2v, align 2
%inc0 = add nsw i16 %0, 1
store i16 %inc0, i16* getelementptr inbounds (%struct.h2, %struct.h2* @h2v, i32 0, i32 0), align 2
%1 = load i16, i16* getelementptr inbounds (%struct.h2, %struct.h2* @h2v, i32 0, i32 1), align 2
store i16 %inc0, ptr @h2v, align 2
%1 = load i16, ptr getelementptr inbounds (%struct.h2, ptr @h2v, i32 0, i32 1), align 2
%inc1 = add nsw i16 %1, 2
store i16 %inc1, i16* getelementptr inbounds (%struct.h2, %struct.h2* @h2v, i32 0, i32 1), align 2
store i16 %inc1, ptr getelementptr inbounds (%struct.h2, ptr @h2v, i32 0, i32 1), align 2
ret void
}

Expand Down Expand Up @@ -127,30 +127,30 @@ entry:

define dso_local void @test_b8() nounwind {
entry:
%0 = load i8, i8* getelementptr inbounds (%struct.b8, %struct.b8* @b8v, i32 0, i32 0), align 1
%0 = load i8, ptr @b8v, align 1
%inc0 = add nsw i8 %0, 1
store i8 %inc0, i8* getelementptr inbounds (%struct.b8, %struct.b8* @b8v, i32 0, i32 0), align 1
%1 = load i8, i8* getelementptr inbounds (%struct.b8, %struct.b8* @b8v, i32 0, i32 1), align 1
store i8 %inc0, ptr @b8v, align 1
%1 = load i8, ptr getelementptr inbounds (%struct.b8, ptr @b8v, i32 0, i32 1), align 1
%inc1 = add nsw i8 %1, 2
store i8 %inc1, i8* getelementptr inbounds (%struct.b8, %struct.b8* @b8v, i32 0, i32 1), align 1
%2 = load i8, i8* getelementptr inbounds (%struct.b8, %struct.b8* @b8v, i32 0, i32 2), align 1
store i8 %inc1, ptr getelementptr inbounds (%struct.b8, ptr @b8v, i32 0, i32 1), align 1
%2 = load i8, ptr getelementptr inbounds (%struct.b8, ptr @b8v, i32 0, i32 2), align 1
%inc2 = add nsw i8 %2, 3
store i8 %inc2, i8* getelementptr inbounds (%struct.b8, %struct.b8* @b8v, i32 0, i32 2), align 1
%3 = load i8, i8* getelementptr inbounds (%struct.b8, %struct.b8* @b8v, i32 0, i32 3), align 1
store i8 %inc2, ptr getelementptr inbounds (%struct.b8, ptr @b8v, i32 0, i32 2), align 1
%3 = load i8, ptr getelementptr inbounds (%struct.b8, ptr @b8v, i32 0, i32 3), align 1
%inc3 = add nsw i8 %3, 4
store i8 %inc3, i8* getelementptr inbounds (%struct.b8, %struct.b8* @b8v, i32 0, i32 3), align 1
%4 = load i8, i8* getelementptr inbounds (%struct.b8, %struct.b8* @b8v, i32 0, i32 4), align 1
store i8 %inc3, ptr getelementptr inbounds (%struct.b8, ptr @b8v, i32 0, i32 3), align 1
%4 = load i8, ptr getelementptr inbounds (%struct.b8, ptr @b8v, i32 0, i32 4), align 1
%inc4 = add nsw i8 %4, 5
store i8 %inc4, i8* getelementptr inbounds (%struct.b8, %struct.b8* @b8v, i32 0, i32 4), align 1
%5 = load i8, i8* getelementptr inbounds (%struct.b8, %struct.b8* @b8v, i32 0, i32 5), align 1
store i8 %inc4, ptr getelementptr inbounds (%struct.b8, ptr @b8v, i32 0, i32 4), align 1
%5 = load i8, ptr getelementptr inbounds (%struct.b8, ptr @b8v, i32 0, i32 5), align 1
%inc5 = add nsw i8 %5, 6
store i8 %inc5, i8* getelementptr inbounds (%struct.b8, %struct.b8* @b8v, i32 0, i32 5), align 1
%6 = load i8, i8* getelementptr inbounds (%struct.b8, %struct.b8* @b8v, i32 0, i32 6), align 1
store i8 %inc5, ptr getelementptr inbounds (%struct.b8, ptr @b8v, i32 0, i32 5), align 1
%6 = load i8, ptr getelementptr inbounds (%struct.b8, ptr @b8v, i32 0, i32 6), align 1
%inc6 = add nsw i8 %6, 7
store i8 %inc6, i8* getelementptr inbounds (%struct.b8, %struct.b8* @b8v, i32 0, i32 6), align 1
%7 = load i8, i8* getelementptr inbounds (%struct.b8, %struct.b8* @b8v, i32 0, i32 7), align 1
store i8 %inc6, ptr getelementptr inbounds (%struct.b8, ptr @b8v, i32 0, i32 6), align 1
%7 = load i8, ptr getelementptr inbounds (%struct.b8, ptr @b8v, i32 0, i32 7), align 1
%inc7 = add nsw i8 %7, 8
store i8 %inc7, i8* getelementptr inbounds (%struct.b8, %struct.b8* @b8v, i32 0, i32 7), align 1
store i8 %inc7, ptr getelementptr inbounds (%struct.b8, ptr @b8v, i32 0, i32 7), align 1
ret void
}

Expand All @@ -171,18 +171,18 @@ entry:

define dso_local void @test_h4() nounwind {
entry:
%0 = load i16, i16* getelementptr inbounds (%struct.h4, %struct.h4* @h4v, i32 0, i32 0), align 2
%0 = load i16, ptr @h4v, align 2
%inc0 = add nsw i16 %0, 1
store i16 %inc0, i16* getelementptr inbounds (%struct.h4, %struct.h4* @h4v, i32 0, i32 0), align 2
%1 = load i16, i16* getelementptr inbounds (%struct.h4, %struct.h4* @h4v, i32 0, i32 1), align 2
store i16 %inc0, ptr @h4v, align 2
%1 = load i16, ptr getelementptr inbounds (%struct.h4, ptr @h4v, i32 0, i32 1), align 2
%inc1 = add nsw i16 %1, 2
store i16 %inc1, i16* getelementptr inbounds (%struct.h4, %struct.h4* @h4v, i32 0, i32 1), align 2
%2 = load i16, i16* getelementptr inbounds (%struct.h4, %struct.h4* @h4v, i32 0, i32 2), align 2
store i16 %inc1, ptr getelementptr inbounds (%struct.h4, ptr @h4v, i32 0, i32 1), align 2
%2 = load i16, ptr getelementptr inbounds (%struct.h4, ptr @h4v, i32 0, i32 2), align 2
%inc2 = add nsw i16 %2, 3
store i16 %inc2, i16* getelementptr inbounds (%struct.h4, %struct.h4* @h4v, i32 0, i32 2), align 2
%3 = load i16, i16* getelementptr inbounds (%struct.h4, %struct.h4* @h4v, i32 0, i32 3), align 2
store i16 %inc2, ptr getelementptr inbounds (%struct.h4, ptr @h4v, i32 0, i32 2), align 2
%3 = load i16, ptr getelementptr inbounds (%struct.h4, ptr @h4v, i32 0, i32 3), align 2
%inc3 = add nsw i16 %3, 4
store i16 %inc3, i16* getelementptr inbounds (%struct.h4, %struct.h4* @h4v, i32 0, i32 3), align 2
store i16 %inc3, ptr getelementptr inbounds (%struct.h4, ptr @h4v, i32 0, i32 3), align 2
ret void
}

Expand All @@ -197,12 +197,12 @@ entry:

define dso_local void @test_w2() nounwind {
entry:
%0 = load i32, i32* getelementptr inbounds (%struct.w2, %struct.w2* @w2v, i32 0, i32 0), align 4
%0 = load i32, ptr @w2v, align 4
%inc0 = add nsw i32 %0, 1
store i32 %inc0, i32* getelementptr inbounds (%struct.w2, %struct.w2* @w2v, i32 0, i32 0), align 4
%1 = load i32, i32* getelementptr inbounds (%struct.w2, %struct.w2* @w2v, i32 0, i32 1), align 4
store i32 %inc0, ptr @w2v, align 4
%1 = load i32, ptr getelementptr inbounds (%struct.w2, ptr @w2v, i32 0, i32 1), align 4
%inc1 = add nsw i32 %1, 2
store i32 %inc1, i32* getelementptr inbounds (%struct.w2, %struct.w2* @w2v, i32 0, i32 1), align 4
store i32 %inc1, ptr getelementptr inbounds (%struct.w2, ptr @w2v, i32 0, i32 1), align 4
ret void
}

Expand All @@ -218,12 +218,12 @@ entry:

define dso_local void @test_d2() nounwind {
entry:
%0 = load i64, i64* getelementptr inbounds (%struct.d2, %struct.d2* @d2v, i32 0, i32 0), align 8
%0 = load i64, ptr @d2v, align 8
%inc0 = add nsw i64 %0, 1
store i64 %inc0, i64* getelementptr inbounds (%struct.d2, %struct.d2* @d2v, i32 0, i32 0), align 8
%1 = load i64, i64* getelementptr inbounds (%struct.d2, %struct.d2* @d2v, i32 0, i32 1), align 8
store i64 %inc0, ptr @d2v, align 8
%1 = load i64, ptr getelementptr inbounds (%struct.d2, ptr @d2v, i32 0, i32 1), align 8
%inc1 = add nsw i64 %1, 2
store i64 %inc1, i64* getelementptr inbounds (%struct.d2, %struct.d2* @d2v, i32 0, i32 1), align 8
store i64 %inc1, ptr getelementptr inbounds (%struct.d2, ptr @d2v, i32 0, i32 1), align 8
ret void
}

Expand All @@ -232,7 +232,7 @@ entry:
; CHECK: ld 3, d2v@toc@l+8([[REG]])
define i64 @test_singleuse() nounwind {
entry:
%0 = load i64, i64* getelementptr inbounds (%struct.d2, %struct.d2* @d2v, i32 0, i32 1), align 8
%0 = load i64, ptr getelementptr inbounds (%struct.d2, ptr @d2v, i32 0, i32 1), align 8
ret i64 %0
}

Expand All @@ -246,8 +246,8 @@ entry:
; CHECK: stdx [[REG0_1]], [[REGSTRUCT]], [[OFFSET_REG]]
define dso_local void @test_misalign() nounwind {
entry:
%0 = load i64, i64* getelementptr inbounds (%struct.misalign, %struct.misalign* @misalign_v, i32 0, i32 1), align 1
%0 = load i64, ptr getelementptr inbounds (%struct.misalign, ptr @misalign_v, i32 0, i32 1), align 1
%inc0 = add nsw i64 %0, 1
store i64 %inc0, i64* getelementptr inbounds (%struct.misalign, %struct.misalign* @misalign_v, i32 0, i32 1), align 1
store i64 %inc0, ptr getelementptr inbounds (%struct.misalign, ptr @misalign_v, i32 0, i32 1), align 1
ret void
}
26 changes: 13 additions & 13 deletions llvm/test/CodeGen/PowerPC/pgo-ref-directive.ll
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,9 @@ target triple = "powerpc-ibm-aix7.2.0.0"
@__profd_main = private global i64 zeroinitializer, section "__llvm_prf_data", align 8
@__llvm_prf_nm = private constant [6 x i8] c"\04\00main", section "__llvm_prf_names", align 1

@llvm.used = appending global [2 x i8*]
[i8* bitcast (i64* @__profd_main to i8*),
i8* getelementptr inbounds ([6 x i8], [6 x i8]* @__llvm_prf_nm, i32 0, i32 0)], section "llvm.metadata"
@llvm.used = appending global [2 x ptr]
[ptr @__profd_main,
ptr @__llvm_prf_nm], section "llvm.metadata"

define i32 @main() #0 {
entry:
Expand All @@ -37,10 +37,10 @@ target triple = "powerpc-ibm-aix7.2.0.0"
@__profd_main = private global i64 zeroinitializer, section "__llvm_prf_data", align 8
@__llvm_prf_nm = private constant [6 x i8] c"\04\00main", section "__llvm_prf_names", align 1

@llvm.used = appending global [3 x i8*]
[i8* bitcast ([1 x i64]* @__profc_main to i8*),
i8* bitcast (i64* @__profd_main to i8*),
i8* getelementptr inbounds ([6 x i8], [6 x i8]* @__llvm_prf_nm, i32 0, i32 0)], section "llvm.metadata"
@llvm.used = appending global [3 x ptr]
[ptr @__profc_main,
ptr @__profd_main,
ptr @__llvm_prf_nm], section "llvm.metadata"

define i32 @main() #0 {
entry:
Expand All @@ -62,13 +62,13 @@ entry:
@__profc_main = private global [1 x i64] zeroinitializer, section "__llvm_prf_cnts", align 8
@__profd_main = private global i64 zeroinitializer, section "__llvm_prf_data", align 8
@__llvm_prf_nm = private constant [6 x i8] c"\04\00main", section "__llvm_prf_names", align 1
@__llvm_prf_vnodes = private global [10 x { i64, i64, i8* }] zeroinitializer, section "__llvm_prf_vnds"
@__llvm_prf_vnodes = private global [10 x { i64, i64, ptr }] zeroinitializer, section "__llvm_prf_vnds"

@llvm.used = appending global [4 x i8*]
[i8* bitcast ([1 x i64]* @__profc_main to i8*),
i8* bitcast (i64* @__profd_main to i8*),
i8* getelementptr inbounds ([6 x i8], [6 x i8]* @__llvm_prf_nm, i32 0, i32 0),
i8* bitcast ([10 x { i64, i64, i8* }]* @__llvm_prf_vnodes to i8*)], section "llvm.metadata"
@llvm.used = appending global [4 x ptr]
[ptr @__profc_main,
ptr @__profd_main,
ptr @__llvm_prf_nm,
ptr @__llvm_prf_vnodes], section "llvm.metadata"

define i32 @main() #0 {
entry:
Expand Down
14 changes: 7 additions & 7 deletions llvm/test/CodeGen/PowerPC/pip-inner.ll
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ target datalayout = "E-m:e-i64:64-n32:64"
target triple = "powerpc64-unknown-linux-gnu"

; Function Attrs: nounwind
define void @foo(double* %x, double* nocapture readonly %y) #0 {
define void @foo(ptr %x, ptr nocapture readonly %y) #0 {
entry:
br label %for.cond1.preheader

Expand All @@ -13,17 +13,17 @@ for.cond1.preheader: ; preds = %for.end, %entry

for.body3: ; preds = %for.body3, %for.cond1.preheader
%indvars.iv = phi i64 [ 0, %for.cond1.preheader ], [ %indvars.iv.next, %for.body3 ]
%arrayidx = getelementptr inbounds double, double* %y, i64 %indvars.iv
%0 = load double, double* %arrayidx, align 8
%arrayidx = getelementptr inbounds double, ptr %y, i64 %indvars.iv
%0 = load double, ptr %arrayidx, align 8
%add = fadd double %0, 1.000000e+00
%arrayidx5 = getelementptr inbounds double, double* %x, i64 %indvars.iv
store double %add, double* %arrayidx5, align 8
%arrayidx5 = getelementptr inbounds double, ptr %x, i64 %indvars.iv
store double %add, ptr %arrayidx5, align 8
%indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
%exitcond = icmp eq i64 %indvars.iv.next, 16000
br i1 %exitcond, label %for.end, label %for.body3

for.end: ; preds = %for.body3
tail call void @bar(double* %x) #2
tail call void @bar(ptr %x) #2
%inc7 = add nuw nsw i32 %i.015, 1
%exitcond16 = icmp eq i32 %inc7, 1000
br i1 %exitcond16, label %for.end8, label %for.cond1.preheader
Expand All @@ -44,7 +44,7 @@ for.end8: ; preds = %for.end
; CHECK: blr
}

declare void @bar(double*) #1
declare void @bar(ptr) #1

attributes #0 = { nounwind "target-cpu"="a2" }
attributes #1 = { "target-cpu"="a2" }
Expand Down
8 changes: 4 additions & 4 deletions llvm/test/CodeGen/PowerPC/popcount.ll
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
; RUN: llc < %s -O0 -mtriple=powerpc64le-unknown-unknown | FileCheck %s

; Function Attrs: nobuiltin nounwind readonly
define i8 @popcount128(i128* nocapture nonnull readonly %0) {
define i8 @popcount128(ptr nocapture nonnull readonly %0) {
; CHECK-LABEL: popcount128:
; CHECK: # %bb.0: # %Entry
; CHECK-NEXT: mr 4, 3
Expand All @@ -15,7 +15,7 @@ define i8 @popcount128(i128* nocapture nonnull readonly %0) {
; CHECK-NEXT: clrldi 3, 3, 56
; CHECK-NEXT: blr
Entry:
%1 = load i128, i128* %0, align 16
%1 = load i128, ptr %0, align 16
%2 = tail call i128 @llvm.ctpop.i128(i128 %1)
%3 = trunc i128 %2 to i8
ret i8 %3
Expand All @@ -25,7 +25,7 @@ Entry:
declare i128 @llvm.ctpop.i128(i128)

; Function Attrs: nobuiltin nounwind readonly
define i16 @popcount256(i256* nocapture nonnull readonly %0) {
define i16 @popcount256(ptr nocapture nonnull readonly %0) {
; CHECK-LABEL: popcount256:
; CHECK: # %bb.0: # %Entry
; CHECK-NEXT: mr 6, 3
Expand All @@ -44,7 +44,7 @@ define i16 @popcount256(i256* nocapture nonnull readonly %0) {
; CHECK-NEXT: clrldi 3, 3, 48
; CHECK-NEXT: blr
Entry:
%1 = load i256, i256* %0, align 16
%1 = load i256, ptr %0, align 16
%2 = tail call i256 @llvm.ctpop.i256(i256 %1)
%3 = trunc i256 %2 to i16
ret i16 %3
Expand Down
27 changes: 13 additions & 14 deletions llvm/test/CodeGen/PowerPC/post-ra-ec.ll
Original file line number Diff line number Diff line change
Expand Up @@ -2,27 +2,27 @@
target datalayout = "E-m:e-i64:64-n32:64"
target triple = "powerpc64-unknown-linux-gnu"

%struct.inode.0.12.120 = type { i8* }
%struct.inode.0.12.120 = type { ptr }
%struct.kstat2.1.13.121 = type { i32 }
%struct.task_struct.4.16.124 = type { i8*, %struct.atomic_t.2.14.122, %struct.signal_struct.3.15.123* }
%struct.task_struct.4.16.124 = type { ptr, %struct.atomic_t.2.14.122, ptr }
%struct.atomic_t.2.14.122 = type { i32 }
%struct.signal_struct.3.15.123 = type { i64 }
%struct.pid.5.17.125 = type { i8* }
%struct.pid.5.17.125 = type { ptr }

; Function Attrs: nounwind
define signext i32 @proc_task_getattr(%struct.inode.0.12.120* nocapture readonly %inode, %struct.kstat2.1.13.121* nocapture %stat) #0 {
define signext i32 @proc_task_getattr(ptr nocapture readonly %inode, ptr nocapture %stat) #0 {
entry:
%call1.i = tail call %struct.task_struct.4.16.124* @get_pid_task(%struct.pid.5.17.125* undef, i32 zeroext 0) #0
%call1.i = tail call ptr @get_pid_task(ptr undef, i32 zeroext 0) #0
br i1 undef, label %if.end, label %if.then

if.then: ; preds = %entry
%0 = load i64, i64* undef, align 8
%0 = load i64, ptr undef, align 8
%conv.i = trunc i64 %0 to i32
%1 = load i32, i32* null, align 4
%1 = load i32, ptr null, align 4
%add = add i32 %1, %conv.i
store i32 %add, i32* null, align 4
%counter.i.i = getelementptr inbounds %struct.task_struct.4.16.124, %struct.task_struct.4.16.124* %call1.i, i64 0, i32 1, i32 0
%2 = tail call i32 asm sideeffect "\09lwsync\0A1:\09lwarx\09$0,0,$1\09\09# atomic_dec_return\0A\09addic\09$0,$0,-1\0A\09stwcx.\09$0,0,$1\0A\09bne-\091b\0A\09sync\0A", "=&r,r,~{cr0},~{xer},~{memory}"(i32* %counter.i.i) #0
store i32 %add, ptr null, align 4
%counter.i.i = getelementptr inbounds %struct.task_struct.4.16.124, ptr %call1.i, i64 0, i32 1, i32 0
%2 = tail call i32 asm sideeffect "\09lwsync\0A1:\09lwarx\09$0,0,$1\09\09# atomic_dec_return\0A\09addic\09$0,$0,-1\0A\09stwcx.\09$0,0,$1\0A\09bne-\091b\0A\09sync\0A", "=&r,r,~{cr0},~{xer},~{memory}"(ptr %counter.i.i) #0
%cmp.i = icmp eq i32 %2, 0
br i1 %cmp.i, label %if.then.i, label %if.end

Expand All @@ -31,17 +31,16 @@ if.then: ; preds = %entry
; CHECK: blr

if.then.i: ; preds = %if.then
%3 = bitcast %struct.task_struct.4.16.124* %call1.i to i8*
tail call void @foo(i8* %3) #0
tail call void @foo(ptr %call1.i) #0
unreachable

if.end: ; preds = %if.then, %entry
ret i32 0
}

declare void @foo(i8*)
declare void @foo(ptr)

declare %struct.task_struct.4.16.124* @get_pid_task(%struct.pid.5.17.125*, i32 zeroext)
declare ptr @get_pid_task(ptr, i32 zeroext)

attributes #0 = { nounwind }

167 changes: 74 additions & 93 deletions llvm/test/CodeGen/PowerPC/pow_massv_075_025exp.ll
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
; RUN: llc -vector-library=MASSV < %s -mtriple=powerpc-ibm-aix-xcoff -mcpu=pwr7 | FileCheck -check-prefixes=CHECK-PWR7 %s

; Exponent is a variable
define void @vpow_var(double* nocapture %z, double* nocapture readonly %y, double* nocapture readonly %x) {
define void @vpow_var(ptr nocapture %z, ptr nocapture readonly %y, ptr nocapture readonly %x) {
; CHECK-LABEL: @vpow_var
; CHECK-PWR10: __powd2_P10
; CHECK-PWR9: __powd2_P9
Expand All @@ -19,26 +19,23 @@ entry:

vector.body:
%index = phi i64 [ %index.next, %vector.body ], [ 0, %entry ]
%next.gep = getelementptr double, double* %z, i64 %index
%next.gep31 = getelementptr double, double* %y, i64 %index
%next.gep32 = getelementptr double, double* %x, i64 %index
%0 = bitcast double* %next.gep32 to <2 x double>*
%wide.load = load <2 x double>, <2 x double>* %0, align 8
%1 = bitcast double* %next.gep31 to <2 x double>*
%wide.load33 = load <2 x double>, <2 x double>* %1, align 8
%2 = call ninf afn nsz <2 x double> @__powd2(<2 x double> %wide.load, <2 x double> %wide.load33)
%3 = bitcast double* %next.gep to <2 x double>*
store <2 x double> %2, <2 x double>* %3, align 8
%next.gep = getelementptr double, ptr %z, i64 %index
%next.gep31 = getelementptr double, ptr %y, i64 %index
%next.gep32 = getelementptr double, ptr %x, i64 %index
%wide.load = load <2 x double>, ptr %next.gep32, align 8
%wide.load33 = load <2 x double>, ptr %next.gep31, align 8
%0 = call ninf afn nsz <2 x double> @__powd2(<2 x double> %wide.load, <2 x double> %wide.load33)
store <2 x double> %0, ptr %next.gep, align 8
%index.next = add i64 %index, 2
%4 = icmp eq i64 %index.next, 1024
br i1 %4, label %for.end, label %vector.body
%1 = icmp eq i64 %index.next, 1024
br i1 %1, label %for.end, label %vector.body

for.end:
ret void
}

; Exponent is a constant != 0.75 and !=0.25
define void @vpow_const(double* nocapture %y, double* nocapture readonly %x) {
define void @vpow_const(ptr nocapture %y, ptr nocapture readonly %x) {
; CHECK-LABEL: @vpow_const
; CHECK-PWR10: __powd2_P10
; CHECK-PWR9: __powd2_P9
Expand All @@ -50,23 +47,21 @@ entry:

vector.body:
%index = phi i64 [ %index.next, %vector.body ], [ 0, %entry ]
%next.gep = getelementptr double, double* %y, i64 %index
%next.gep19 = getelementptr double, double* %x, i64 %index
%0 = bitcast double* %next.gep19 to <2 x double>*
%wide.load = load <2 x double>, <2 x double>* %0, align 8
%1 = call ninf afn nsz <2 x double> @__powd2(<2 x double> %wide.load, <2 x double> <double 7.600000e-01, double 7.600000e-01>)
%2 = bitcast double* %next.gep to <2 x double>*
store <2 x double> %1, <2 x double>* %2, align 8
%next.gep = getelementptr double, ptr %y, i64 %index
%next.gep19 = getelementptr double, ptr %x, i64 %index
%wide.load = load <2 x double>, ptr %next.gep19, align 8
%0 = call ninf afn nsz <2 x double> @__powd2(<2 x double> %wide.load, <2 x double> <double 7.600000e-01, double 7.600000e-01>)
store <2 x double> %0, ptr %next.gep, align 8
%index.next = add i64 %index, 2
%3 = icmp eq i64 %index.next, 1024
br i1 %3, label %for.end, label %vector.body
%1 = icmp eq i64 %index.next, 1024
br i1 %1, label %for.end, label %vector.body

for.end:
ret void
}

; Exponent is a constant != 0.75 and !=0.25 and they are different
define void @vpow_noeq_const(double* nocapture %y, double* nocapture readonly %x) {
define void @vpow_noeq_const(ptr nocapture %y, ptr nocapture readonly %x) {
; CHECK-LABEL: @vpow_noeq_const
; CHECK-PWR10: __powd2_P10
; CHECK-PWR9: __powd2_P9
Expand All @@ -78,23 +73,21 @@ entry:

vector.body:
%index = phi i64 [ %index.next, %vector.body ], [ 0, %entry ]
%next.gep = getelementptr double, double* %y, i64 %index
%next.gep19 = getelementptr double, double* %x, i64 %index
%0 = bitcast double* %next.gep19 to <2 x double>*
%wide.load = load <2 x double>, <2 x double>* %0, align 8
%1 = call ninf afn nsz <2 x double> @__powd2(<2 x double> %wide.load, <2 x double> <double 7.700000e-01, double 7.600000e-01>)
%2 = bitcast double* %next.gep to <2 x double>*
store <2 x double> %1, <2 x double>* %2, align 8
%next.gep = getelementptr double, ptr %y, i64 %index
%next.gep19 = getelementptr double, ptr %x, i64 %index
%wide.load = load <2 x double>, ptr %next.gep19, align 8
%0 = call ninf afn nsz <2 x double> @__powd2(<2 x double> %wide.load, <2 x double> <double 7.700000e-01, double 7.600000e-01>)
store <2 x double> %0, ptr %next.gep, align 8
%index.next = add i64 %index, 2
%3 = icmp eq i64 %index.next, 1024
br i1 %3, label %for.end, label %vector.body
%1 = icmp eq i64 %index.next, 1024
br i1 %1, label %for.end, label %vector.body

for.end:
ret void
}

; Exponent is a constant != 0.75 and !=0.25 and they are different
define void @vpow_noeq075_const(double* nocapture %y, double* nocapture readonly %x) {
define void @vpow_noeq075_const(ptr nocapture %y, ptr nocapture readonly %x) {
; CHECK-LABEL: @vpow_noeq075_const
; CHECK-PWR10: __powd2_P10
; CHECK-PWR9: __powd2_P9
Expand All @@ -106,23 +99,21 @@ entry:

vector.body:
%index = phi i64 [ %index.next, %vector.body ], [ 0, %entry ]
%next.gep = getelementptr double, double* %y, i64 %index
%next.gep19 = getelementptr double, double* %x, i64 %index
%0 = bitcast double* %next.gep19 to <2 x double>*
%wide.load = load <2 x double>, <2 x double>* %0, align 8
%1 = call ninf afn nsz <2 x double> @__powd2(<2 x double> %wide.load, <2 x double> <double 7.700000e-01, double 7.500000e-01>)
%2 = bitcast double* %next.gep to <2 x double>*
store <2 x double> %1, <2 x double>* %2, align 8
%next.gep = getelementptr double, ptr %y, i64 %index
%next.gep19 = getelementptr double, ptr %x, i64 %index
%wide.load = load <2 x double>, ptr %next.gep19, align 8
%0 = call ninf afn nsz <2 x double> @__powd2(<2 x double> %wide.load, <2 x double> <double 7.700000e-01, double 7.500000e-01>)
store <2 x double> %0, ptr %next.gep, align 8
%index.next = add i64 %index, 2
%3 = icmp eq i64 %index.next, 1024
br i1 %3, label %for.end, label %vector.body
%1 = icmp eq i64 %index.next, 1024
br i1 %1, label %for.end, label %vector.body

for.end:
ret void
}

; Exponent is a constant != 0.75 and !=0.25 and they are different
define void @vpow_noeq025_const(double* nocapture %y, double* nocapture readonly %x) {
define void @vpow_noeq025_const(ptr nocapture %y, ptr nocapture readonly %x) {
; CHECK-LABEL: @vpow_noeq025_const
; CHECK-PWR10: __powd2_P10
; CHECK-PWR9: __powd2_P9
Expand All @@ -134,23 +125,21 @@ entry:

vector.body:
%index = phi i64 [ %index.next, %vector.body ], [ 0, %entry ]
%next.gep = getelementptr double, double* %y, i64 %index
%next.gep19 = getelementptr double, double* %x, i64 %index
%0 = bitcast double* %next.gep19 to <2 x double>*
%wide.load = load <2 x double>, <2 x double>* %0, align 8
%1 = call ninf afn nsz <2 x double> @__powd2(<2 x double> %wide.load, <2 x double> <double 7.700000e-01, double 2.500000e-01>)
%2 = bitcast double* %next.gep to <2 x double>*
store <2 x double> %1, <2 x double>* %2, align 8
%next.gep = getelementptr double, ptr %y, i64 %index
%next.gep19 = getelementptr double, ptr %x, i64 %index
%wide.load = load <2 x double>, ptr %next.gep19, align 8
%0 = call ninf afn nsz <2 x double> @__powd2(<2 x double> %wide.load, <2 x double> <double 7.700000e-01, double 2.500000e-01>)
store <2 x double> %0, ptr %next.gep, align 8
%index.next = add i64 %index, 2
%3 = icmp eq i64 %index.next, 1024
br i1 %3, label %for.end, label %vector.body
%1 = icmp eq i64 %index.next, 1024
br i1 %1, label %for.end, label %vector.body

for.end:
ret void
}

; Exponent is 0.75
define void @vpow_075(double* nocapture %y, double* nocapture readonly %x) {
define void @vpow_075(ptr nocapture %y, ptr nocapture readonly %x) {
; CHECK-LABEL: @vpow_075
; CHECK-NOT: __powd2_P{{[7,8,9,10]}}
; CHECK: xvrsqrtesp
Expand All @@ -160,23 +149,21 @@ entry:

vector.body:
%index = phi i64 [ %index.next, %vector.body ], [ 0, %entry ]
%next.gep = getelementptr double, double* %y, i64 %index
%next.gep19 = getelementptr double, double* %x, i64 %index
%0 = bitcast double* %next.gep19 to <2 x double>*
%wide.load = load <2 x double>, <2 x double>* %0, align 8
%1 = call ninf afn <2 x double> @__powd2(<2 x double> %wide.load, <2 x double> <double 7.500000e-01, double 7.500000e-01>)
%2 = bitcast double* %next.gep to <2 x double>*
store <2 x double> %1, <2 x double>* %2, align 8
%next.gep = getelementptr double, ptr %y, i64 %index
%next.gep19 = getelementptr double, ptr %x, i64 %index
%wide.load = load <2 x double>, ptr %next.gep19, align 8
%0 = call ninf afn <2 x double> @__powd2(<2 x double> %wide.load, <2 x double> <double 7.500000e-01, double 7.500000e-01>)
store <2 x double> %0, ptr %next.gep, align 8
%index.next = add i64 %index, 2
%3 = icmp eq i64 %index.next, 1024
br i1 %3, label %for.end, label %vector.body
%1 = icmp eq i64 %index.next, 1024
br i1 %1, label %for.end, label %vector.body

for.end:
ret void
}

; Exponent is 0.25
define void @vpow_025(double* nocapture %y, double* nocapture readonly %x) {
define void @vpow_025(ptr nocapture %y, ptr nocapture readonly %x) {
; CHECK-LABEL: @vpow_025
; CHECK-NOT: __powd2_P{{[7,8,9,10]}}
; CHECK: xvrsqrtesp
Expand All @@ -186,23 +173,21 @@ entry:

vector.body:
%index = phi i64 [ %index.next, %vector.body ], [ 0, %entry ]
%next.gep = getelementptr double, double* %y, i64 %index
%next.gep19 = getelementptr double, double* %x, i64 %index
%0 = bitcast double* %next.gep19 to <2 x double>*
%wide.load = load <2 x double>, <2 x double>* %0, align 8
%1 = call ninf afn nsz <2 x double> @__powd2(<2 x double> %wide.load, <2 x double> <double 2.500000e-01, double 2.500000e-01>)
%2 = bitcast double* %next.gep to <2 x double>*
store <2 x double> %1, <2 x double>* %2, align 8
%next.gep = getelementptr double, ptr %y, i64 %index
%next.gep19 = getelementptr double, ptr %x, i64 %index
%wide.load = load <2 x double>, ptr %next.gep19, align 8
%0 = call ninf afn nsz <2 x double> @__powd2(<2 x double> %wide.load, <2 x double> <double 2.500000e-01, double 2.500000e-01>)
store <2 x double> %0, ptr %next.gep, align 8
%index.next = add i64 %index, 2
%3 = icmp eq i64 %index.next, 1024
br i1 %3, label %for.end, label %vector.body
%1 = icmp eq i64 %index.next, 1024
br i1 %1, label %for.end, label %vector.body

for.end:
ret void
}

; Exponent is 0.75 but no proper fast-math flags
define void @vpow_075_nofast(double* nocapture %y, double* nocapture readonly %x) {
define void @vpow_075_nofast(ptr nocapture %y, ptr nocapture readonly %x) {
; CHECK-LABEL: @vpow_075_nofast
; CHECK-PWR10: __powd2_P10
; CHECK-PWR9: __powd2_P9
Expand All @@ -215,23 +200,21 @@ entry:

vector.body:
%index = phi i64 [ %index.next, %vector.body ], [ 0, %entry ]
%next.gep = getelementptr double, double* %y, i64 %index
%next.gep19 = getelementptr double, double* %x, i64 %index
%0 = bitcast double* %next.gep19 to <2 x double>*
%wide.load = load <2 x double>, <2 x double>* %0, align 8
%1 = call <2 x double> @__powd2(<2 x double> %wide.load, <2 x double> <double 7.500000e-01, double 7.500000e-01>)
%2 = bitcast double* %next.gep to <2 x double>*
store <2 x double> %1, <2 x double>* %2, align 8
%next.gep = getelementptr double, ptr %y, i64 %index
%next.gep19 = getelementptr double, ptr %x, i64 %index
%wide.load = load <2 x double>, ptr %next.gep19, align 8
%0 = call <2 x double> @__powd2(<2 x double> %wide.load, <2 x double> <double 7.500000e-01, double 7.500000e-01>)
store <2 x double> %0, ptr %next.gep, align 8
%index.next = add i64 %index, 2
%3 = icmp eq i64 %index.next, 1024
br i1 %3, label %for.end, label %vector.body
%1 = icmp eq i64 %index.next, 1024
br i1 %1, label %for.end, label %vector.body

for.end:
ret void
}

; Exponent is 0.25 but no proper fast-math flags
define void @vpow_025_nofast(double* nocapture %y, double* nocapture readonly %x) {
define void @vpow_025_nofast(ptr nocapture %y, ptr nocapture readonly %x) {
; CHECK-LABEL: @vpow_025_nofast
; CHECK-PWR10: __powd2_P10
; CHECK-PWR9: __powd2_P9
Expand All @@ -244,16 +227,14 @@ entry:

vector.body:
%index = phi i64 [ %index.next, %vector.body ], [ 0, %entry ]
%next.gep = getelementptr double, double* %y, i64 %index
%next.gep19 = getelementptr double, double* %x, i64 %index
%0 = bitcast double* %next.gep19 to <2 x double>*
%wide.load = load <2 x double>, <2 x double>* %0, align 8
%1 = call <2 x double> @__powd2(<2 x double> %wide.load, <2 x double> <double 2.500000e-01, double 2.500000e-01>)
%2 = bitcast double* %next.gep to <2 x double>*
store <2 x double> %1, <2 x double>* %2, align 8
%next.gep = getelementptr double, ptr %y, i64 %index
%next.gep19 = getelementptr double, ptr %x, i64 %index
%wide.load = load <2 x double>, ptr %next.gep19, align 8
%0 = call <2 x double> @__powd2(<2 x double> %wide.load, <2 x double> <double 2.500000e-01, double 2.500000e-01>)
store <2 x double> %0, ptr %next.gep, align 8
%index.next = add i64 %index, 2
%3 = icmp eq i64 %index.next, 1024
br i1 %3, label %for.end, label %vector.body
%1 = icmp eq i64 %index.next, 1024
br i1 %1, label %for.end, label %vector.body

for.end:
ret void
Expand Down
18 changes: 9 additions & 9 deletions llvm/test/CodeGen/PowerPC/power9-moves-and-splats.ll
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ entry:
ret i64 %0
}

define <4 x i32> @test4(i32* nocapture readonly %in) {
define <4 x i32> @test4(ptr nocapture readonly %in) {
; CHECK-LABEL: test4:
; CHECK: # %bb.0: # %entry
; CHECK-NEXT: lxvwsx v2, 0, r3
Expand All @@ -70,13 +70,13 @@ define <4 x i32> @test4(i32* nocapture readonly %in) {
; CHECK-BE-NEXT: blr

entry:
%0 = load i32, i32* %in, align 4
%0 = load i32, ptr %in, align 4
%splat.splatinsert = insertelement <4 x i32> undef, i32 %0, i32 0
%splat.splat = shufflevector <4 x i32> %splat.splatinsert, <4 x i32> undef, <4 x i32> zeroinitializer
ret <4 x i32> %splat.splat
}

define <4 x float> @test5(float* nocapture readonly %in) {
define <4 x float> @test5(ptr nocapture readonly %in) {
; CHECK-LABEL: test5:
; CHECK: # %bb.0: # %entry
; CHECK-NEXT: lxvwsx v2, 0, r3
Expand All @@ -88,7 +88,7 @@ define <4 x float> @test5(float* nocapture readonly %in) {
; CHECK-BE-NEXT: blr

entry:
%0 = load float, float* %in, align 4
%0 = load float, ptr %in, align 4
%splat.splatinsert = insertelement <4 x float> undef, float %0, i32 0
%splat.splat = shufflevector <4 x float> %splat.splatinsert, <4 x float> undef, <4 x i32> zeroinitializer
ret <4 x float> %splat.splat
Expand All @@ -110,7 +110,7 @@ define <4 x i32> @test6() {
; CHECK-BE-NEXT: blr

entry:
%0 = load i32, i32* @Globi, align 4
%0 = load i32, ptr @Globi, align 4
%splat.splatinsert = insertelement <4 x i32> undef, i32 %0, i32 0
%splat.splat = shufflevector <4 x i32> %splat.splatinsert, <4 x i32> undef, <4 x i32> zeroinitializer
ret <4 x i32> %splat.splat
Expand All @@ -132,7 +132,7 @@ define <4 x float> @test7() {
; CHECK-BE-NEXT: blr

entry:
%0 = load float, float* @Globf, align 4
%0 = load float, ptr @Globf, align 4
%splat.splatinsert = insertelement <4 x float> undef, float %0, i32 0
%splat.splat = shufflevector <4 x float> %splat.splatinsert, <4 x float> undef, <4 x i32> zeroinitializer
ret <4 x float> %splat.splat
Expand Down Expand Up @@ -243,7 +243,7 @@ entry:
ret <16 x i8> <i8 200, i8 200, i8 200, i8 200, i8 200, i8 200, i8 200, i8 200, i8 200, i8 200, i8 200, i8 200, i8 200, i8 200, i8 200, i8 200>
}

define <4 x i32> @test14(<4 x i32> %a, i32* nocapture readonly %b) {
define <4 x i32> @test14(<4 x i32> %a, ptr nocapture readonly %b) {
; CHECK-LABEL: test14:
; CHECK: # %bb.0: # %entry
; CHECK-NEXT: lwz r3, 0(r5)
Expand All @@ -263,10 +263,10 @@ define <4 x i32> @test14(<4 x i32> %a, i32* nocapture readonly %b) {
; CHECK-BE-NEXT: blr

entry:
%0 = load i32, i32* %b, align 4
%0 = load i32, ptr %b, align 4
%splat.splatinsert = insertelement <4 x i32> undef, i32 %0, i32 0
%splat.splat = shufflevector <4 x i32> %splat.splatinsert, <4 x i32> undef, <4 x i32> zeroinitializer
%1 = add i32 %0, 5
store i32 %1, i32* %b, align 4
store i32 %1, ptr %b, align 4
ret <4 x i32> %splat.splat
}
167 changes: 74 additions & 93 deletions llvm/test/CodeGen/PowerPC/powf_massv_075_025exp.ll
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
; RUN: llc -vector-library=MASSV < %s -mtriple=powerpc-ibm-aix-xcoff -mcpu=pwr7 | FileCheck -check-prefixes=CHECK-PWR7 %s

; Exponent is a variable
define void @vspow_var(float* nocapture %z, float* nocapture readonly %y, float* nocapture readonly %x) {
define void @vspow_var(ptr nocapture %z, ptr nocapture readonly %y, ptr nocapture readonly %x) {
; CHECK-LABEL: @vspow_var
; CHECK-PWR10: __powf4_P10
; CHECK-PWR9: __powf4_P9
Expand All @@ -19,26 +19,23 @@ entry:

vector.body:
%index = phi i64 [ %index.next, %vector.body ], [ 0, %entry ]
%next.gep = getelementptr float, float* %z, i64 %index
%next.gep31 = getelementptr float, float* %y, i64 %index
%next.gep32 = getelementptr float, float* %x, i64 %index
%0 = bitcast float* %next.gep32 to <4 x float>*
%wide.load = load <4 x float>, <4 x float>* %0, align 4
%1 = bitcast float* %next.gep31 to <4 x float>*
%wide.load33 = load <4 x float>, <4 x float>* %1, align 4
%2 = call ninf afn nsz <4 x float> @__powf4(<4 x float> %wide.load, <4 x float> %wide.load33)
%3 = bitcast float* %next.gep to <4 x float>*
store <4 x float> %2, <4 x float>* %3, align 4
%next.gep = getelementptr float, ptr %z, i64 %index
%next.gep31 = getelementptr float, ptr %y, i64 %index
%next.gep32 = getelementptr float, ptr %x, i64 %index
%wide.load = load <4 x float>, ptr %next.gep32, align 4
%wide.load33 = load <4 x float>, ptr %next.gep31, align 4
%0 = call ninf afn nsz <4 x float> @__powf4(<4 x float> %wide.load, <4 x float> %wide.load33)
store <4 x float> %0, ptr %next.gep, align 4
%index.next = add i64 %index, 4
%4 = icmp eq i64 %index.next, 1024
br i1 %4, label %for.end, label %vector.body
%1 = icmp eq i64 %index.next, 1024
br i1 %1, label %for.end, label %vector.body

for.end:
ret void
}

; Exponent is a constant != 0.75 and !=0.25
define void @vspow_const(float* nocapture %y, float* nocapture readonly %x) {
define void @vspow_const(ptr nocapture %y, ptr nocapture readonly %x) {
; CHECK-LABEL: @vspow_const
; CHECK-PWR10: __powf4_P10
; CHECK-PWR9: __powf4_P9
Expand All @@ -50,23 +47,21 @@ entry:

vector.body:
%index = phi i64 [ %index.next, %vector.body ], [ 0, %entry ]
%next.gep = getelementptr float, float* %y, i64 %index
%next.gep19 = getelementptr float, float* %x, i64 %index
%0 = bitcast float* %next.gep19 to <4 x float>*
%wide.load = load <4 x float>, <4 x float>* %0, align 4
%1 = call ninf afn nsz <4 x float> @__powf4(<4 x float> %wide.load, <4 x float> <float 0x3FE851EB80000000, float 0x3FE851EB80000000, float 0x3FE851EB80000000, float 0x3FE851EB80000000>)
%2 = bitcast float* %next.gep to <4 x float>*
store <4 x float> %1, <4 x float>* %2, align 4
%next.gep = getelementptr float, ptr %y, i64 %index
%next.gep19 = getelementptr float, ptr %x, i64 %index
%wide.load = load <4 x float>, ptr %next.gep19, align 4
%0 = call ninf afn nsz <4 x float> @__powf4(<4 x float> %wide.load, <4 x float> <float 0x3FE851EB80000000, float 0x3FE851EB80000000, float 0x3FE851EB80000000, float 0x3FE851EB80000000>)
store <4 x float> %0, ptr %next.gep, align 4
%index.next = add i64 %index, 4
%3 = icmp eq i64 %index.next, 1024
br i1 %3, label %for.end, label %vector.body
%1 = icmp eq i64 %index.next, 1024
br i1 %1, label %for.end, label %vector.body

for.end:
ret void
}

; Exponent is a constant != 0.75 and !=0.25 and they are different
define void @vspow_neq_const(float* nocapture %y, float* nocapture readonly %x) {
define void @vspow_neq_const(ptr nocapture %y, ptr nocapture readonly %x) {
; CHECK-LABEL: @vspow_neq_const
; CHECK-PWR10: __powf4_P10
; CHECK-PWR9: __powf4_P9
Expand All @@ -78,23 +73,21 @@ entry:

vector.body:
%index = phi i64 [ %index.next, %vector.body ], [ 0, %entry ]
%next.gep = getelementptr float, float* %y, i64 %index
%next.gep19 = getelementptr float, float* %x, i64 %index
%0 = bitcast float* %next.gep19 to <4 x float>*
%wide.load = load <4 x float>, <4 x float>* %0, align 4
%1 = call ninf afn nsz <4 x float> @__powf4(<4 x float> %wide.load, <4 x float> <float 0x3FE861EB80000000, float 0x3FE871EB80000000, float 0x3FE851EB80000000, float 0x3FE851EB80000000>)
%2 = bitcast float* %next.gep to <4 x float>*
store <4 x float> %1, <4 x float>* %2, align 4
%next.gep = getelementptr float, ptr %y, i64 %index
%next.gep19 = getelementptr float, ptr %x, i64 %index
%wide.load = load <4 x float>, ptr %next.gep19, align 4
%0 = call ninf afn nsz <4 x float> @__powf4(<4 x float> %wide.load, <4 x float> <float 0x3FE861EB80000000, float 0x3FE871EB80000000, float 0x3FE851EB80000000, float 0x3FE851EB80000000>)
store <4 x float> %0, ptr %next.gep, align 4
%index.next = add i64 %index, 4
%3 = icmp eq i64 %index.next, 1024
br i1 %3, label %for.end, label %vector.body
%1 = icmp eq i64 %index.next, 1024
br i1 %1, label %for.end, label %vector.body

for.end:
ret void
}

; Exponent is a constant != 0.75 and !=0.25
define void @vspow_neq075_const(float* nocapture %y, float* nocapture readonly %x) {
define void @vspow_neq075_const(ptr nocapture %y, ptr nocapture readonly %x) {
; CHECK-LABEL: @vspow_neq075_const
; CHECK-PWR10: __powf4_P10
; CHECK-PWR9: __powf4_P9
Expand All @@ -106,23 +99,21 @@ entry:

vector.body:
%index = phi i64 [ %index.next, %vector.body ], [ 0, %entry ]
%next.gep = getelementptr float, float* %y, i64 %index
%next.gep19 = getelementptr float, float* %x, i64 %index
%0 = bitcast float* %next.gep19 to <4 x float>*
%wide.load = load <4 x float>, <4 x float>* %0, align 4
%1 = call ninf afn nsz <4 x float> @__powf4(<4 x float> %wide.load, <4 x float> <float 7.500000e-01, float 7.500000e-01, float 7.500000e-01, float 0x3FE851EB80000000>)
%2 = bitcast float* %next.gep to <4 x float>*
store <4 x float> %1, <4 x float>* %2, align 4
%next.gep = getelementptr float, ptr %y, i64 %index
%next.gep19 = getelementptr float, ptr %x, i64 %index
%wide.load = load <4 x float>, ptr %next.gep19, align 4
%0 = call ninf afn nsz <4 x float> @__powf4(<4 x float> %wide.load, <4 x float> <float 7.500000e-01, float 7.500000e-01, float 7.500000e-01, float 0x3FE851EB80000000>)
store <4 x float> %0, ptr %next.gep, align 4
%index.next = add i64 %index, 4
%3 = icmp eq i64 %index.next, 1024
br i1 %3, label %for.end, label %vector.body
%1 = icmp eq i64 %index.next, 1024
br i1 %1, label %for.end, label %vector.body

for.end:
ret void
}

; Exponent is a constant != 0.75 and !=0.25
define void @vspow_neq025_const(float* nocapture %y, float* nocapture readonly %x) {
define void @vspow_neq025_const(ptr nocapture %y, ptr nocapture readonly %x) {
; CHECK-LABEL: @vspow_neq025_const
; CHECK-PWR10: __powf4_P10
; CHECK-PWR9: __powf4_P9
Expand All @@ -134,23 +125,21 @@ entry:

vector.body:
%index = phi i64 [ %index.next, %vector.body ], [ 0, %entry ]
%next.gep = getelementptr float, float* %y, i64 %index
%next.gep19 = getelementptr float, float* %x, i64 %index
%0 = bitcast float* %next.gep19 to <4 x float>*
%wide.load = load <4 x float>, <4 x float>* %0, align 4
%1 = call ninf afn nsz <4 x float> @__powf4(<4 x float> %wide.load, <4 x float> <float 0x3FE851EB80000000, float 2.500000e-01, float 0x3FE851EB80000000, float 2.500000e-01>)
%2 = bitcast float* %next.gep to <4 x float>*
store <4 x float> %1, <4 x float>* %2, align 4
%next.gep = getelementptr float, ptr %y, i64 %index
%next.gep19 = getelementptr float, ptr %x, i64 %index
%wide.load = load <4 x float>, ptr %next.gep19, align 4
%0 = call ninf afn nsz <4 x float> @__powf4(<4 x float> %wide.load, <4 x float> <float 0x3FE851EB80000000, float 2.500000e-01, float 0x3FE851EB80000000, float 2.500000e-01>)
store <4 x float> %0, ptr %next.gep, align 4
%index.next = add i64 %index, 4
%3 = icmp eq i64 %index.next, 1024
br i1 %3, label %for.end, label %vector.body
%1 = icmp eq i64 %index.next, 1024
br i1 %1, label %for.end, label %vector.body

for.end:
ret void
}

; Exponent is 0.75
define void @vspow_075(float* nocapture %y, float* nocapture readonly %x) {
define void @vspow_075(ptr nocapture %y, ptr nocapture readonly %x) {
; CHECK-LABEL: @vspow_075
; CHECK-NOT: __powf4_P{{[7,8,9,10]}}
; CHECK: xvrsqrtesp
Expand All @@ -160,23 +149,21 @@ entry:

vector.body:
%index = phi i64 [ %index.next, %vector.body ], [ 0, %entry ]
%next.gep = getelementptr float, float* %y, i64 %index
%next.gep19 = getelementptr float, float* %x, i64 %index
%0 = bitcast float* %next.gep19 to <4 x float>*
%wide.load = load <4 x float>, <4 x float>* %0, align 4
%1 = call ninf afn <4 x float> @__powf4(<4 x float> %wide.load, <4 x float> <float 7.500000e-01, float 7.500000e-01, float 7.500000e-01, float 7.500000e-01>)
%2 = bitcast float* %next.gep to <4 x float>*
store <4 x float> %1, <4 x float>* %2, align 4
%next.gep = getelementptr float, ptr %y, i64 %index
%next.gep19 = getelementptr float, ptr %x, i64 %index
%wide.load = load <4 x float>, ptr %next.gep19, align 4
%0 = call ninf afn <4 x float> @__powf4(<4 x float> %wide.load, <4 x float> <float 7.500000e-01, float 7.500000e-01, float 7.500000e-01, float 7.500000e-01>)
store <4 x float> %0, ptr %next.gep, align 4
%index.next = add i64 %index, 4
%3 = icmp eq i64 %index.next, 1024
br i1 %3, label %for.end, label %vector.body
%1 = icmp eq i64 %index.next, 1024
br i1 %1, label %for.end, label %vector.body

for.end:
ret void
}

; Exponent is 0.25
define void @vspow_025(float* nocapture %y, float* nocapture readonly %x) {
define void @vspow_025(ptr nocapture %y, ptr nocapture readonly %x) {
; CHECK-LABEL: @vspow_025
; CHECK-NOT: __powf4_P{{[7,8,9,10]}}
; CHECK: xvrsqrtesp
Expand All @@ -186,23 +173,21 @@ entry:

vector.body:
%index = phi i64 [ %index.next, %vector.body ], [ 0, %entry ]
%next.gep = getelementptr float, float* %y, i64 %index
%next.gep19 = getelementptr float, float* %x, i64 %index
%0 = bitcast float* %next.gep19 to <4 x float>*
%wide.load = load <4 x float>, <4 x float>* %0, align 4
%1 = call ninf afn nsz <4 x float> @__powf4(<4 x float> %wide.load, <4 x float> <float 2.500000e-01, float 2.500000e-01, float 2.500000e-01, float 2.500000e-01>)
%2 = bitcast float* %next.gep to <4 x float>*
store <4 x float> %1, <4 x float>* %2, align 4
%next.gep = getelementptr float, ptr %y, i64 %index
%next.gep19 = getelementptr float, ptr %x, i64 %index
%wide.load = load <4 x float>, ptr %next.gep19, align 4
%0 = call ninf afn nsz <4 x float> @__powf4(<4 x float> %wide.load, <4 x float> <float 2.500000e-01, float 2.500000e-01, float 2.500000e-01, float 2.500000e-01>)
store <4 x float> %0, ptr %next.gep, align 4
%index.next = add i64 %index, 4
%3 = icmp eq i64 %index.next, 1024
br i1 %3, label %for.end, label %vector.body
%1 = icmp eq i64 %index.next, 1024
br i1 %1, label %for.end, label %vector.body

for.end:
ret void
}

; Exponent is 0.75 but no proper fast-math flags
define void @vspow_075_nofast(float* nocapture %y, float* nocapture readonly %x) {
define void @vspow_075_nofast(ptr nocapture %y, ptr nocapture readonly %x) {
; CHECK-LABEL: @vspow_075_nofast
; CHECK-PWR10: __powf4_P10
; CHECK-PWR9: __powf4_P9
Expand All @@ -215,23 +200,21 @@ entry:

vector.body:
%index = phi i64 [ %index.next, %vector.body ], [ 0, %entry ]
%next.gep = getelementptr float, float* %y, i64 %index
%next.gep19 = getelementptr float, float* %x, i64 %index
%0 = bitcast float* %next.gep19 to <4 x float>*
%wide.load = load <4 x float>, <4 x float>* %0, align 4
%1 = call <4 x float> @__powf4(<4 x float> %wide.load, <4 x float> <float 7.500000e-01, float 7.500000e-01, float 7.500000e-01, float 7.500000e-01>)
%2 = bitcast float* %next.gep to <4 x float>*
store <4 x float> %1, <4 x float>* %2, align 4
%next.gep = getelementptr float, ptr %y, i64 %index
%next.gep19 = getelementptr float, ptr %x, i64 %index
%wide.load = load <4 x float>, ptr %next.gep19, align 4
%0 = call <4 x float> @__powf4(<4 x float> %wide.load, <4 x float> <float 7.500000e-01, float 7.500000e-01, float 7.500000e-01, float 7.500000e-01>)
store <4 x float> %0, ptr %next.gep, align 4
%index.next = add i64 %index, 4
%3 = icmp eq i64 %index.next, 1024
br i1 %3, label %for.end, label %vector.body
%1 = icmp eq i64 %index.next, 1024
br i1 %1, label %for.end, label %vector.body

for.end:
ret void
}

; Exponent is 0.25 but no proper fast-math flags
define void @vspow_025_nofast(float* nocapture %y, float* nocapture readonly %x) {
define void @vspow_025_nofast(ptr nocapture %y, ptr nocapture readonly %x) {
; CHECK-LABEL: @vspow_025_nofast
; CHECK-PWR10: __powf4_P10
; CHECK-PWR9: __powf4_P9
Expand All @@ -244,16 +227,14 @@ entry:

vector.body:
%index = phi i64 [ %index.next, %vector.body ], [ 0, %entry ]
%next.gep = getelementptr float, float* %y, i64 %index
%next.gep19 = getelementptr float, float* %x, i64 %index
%0 = bitcast float* %next.gep19 to <4 x float>*
%wide.load = load <4 x float>, <4 x float>* %0, align 4
%1 = call <4 x float> @__powf4(<4 x float> %wide.load, <4 x float> <float 2.500000e-01, float 2.500000e-01, float 2.500000e-01, float 2.500000e-01>)
%2 = bitcast float* %next.gep to <4 x float>*
store <4 x float> %1, <4 x float>* %2, align 4
%next.gep = getelementptr float, ptr %y, i64 %index
%next.gep19 = getelementptr float, ptr %x, i64 %index
%wide.load = load <4 x float>, ptr %next.gep19, align 4
%0 = call <4 x float> @__powf4(<4 x float> %wide.load, <4 x float> <float 2.500000e-01, float 2.500000e-01, float 2.500000e-01, float 2.500000e-01>)
store <4 x float> %0, ptr %next.gep, align 4
%index.next = add i64 %index, 4
%3 = icmp eq i64 %index.next, 1024
br i1 %3, label %for.end, label %vector.body
%1 = icmp eq i64 %index.next, 1024
br i1 %1, label %for.end, label %vector.body

for.end:
ret void
Expand Down
2 changes: 1 addition & 1 deletion llvm/test/CodeGen/PowerPC/ppc-32bit-build-vector.ll
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ define dso_local fastcc void @BuildVectorICE() unnamed_addr {
while.body: ; preds = %while.body, %entry
%newelement = phi i32 [ 0, %entry ], [ %5, %while.body ]
%0 = insertelement <4 x i32> <i32 undef, i32 0, i32 0, i32 0>, i32 %newelement, i32 0
%1 = load <4 x i32>, <4 x i32>* undef, align 1
%1 = load <4 x i32>, ptr undef, align 1
%2 = add <4 x i32> %1, %0
%3 = shufflevector <4 x i32> %2, <4 x i32> undef, <4 x i32> <i32 1, i32 undef, i32 undef, i32 undef>
%4 = add <4 x i32> %2, %3
Expand Down
4 changes: 2 additions & 2 deletions llvm/test/CodeGen/PowerPC/ppc-32bit-shift.ll
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
; RUN: llc -verify-machineinstrs -mtriple=powerpc64 \
; RUN: -mcpu=pwr9 < %s | FileCheck %s --check-prefix=64BIT

define dso_local void @foo(i32 %inta, i64* %long_intb) {
define dso_local void @foo(i32 %inta, ptr %long_intb) {
; 32BIT-LABEL: foo:
; 32BIT: # %bb.0: # %entry
; 32BIT-NEXT: srawi 5, 3, 31
Expand All @@ -24,6 +24,6 @@ define dso_local void @foo(i32 %inta, i64* %long_intb) {
entry:
%conv = sext i32 %inta to i64
%shl = shl nsw i64 %conv, 8
store i64 %shl, i64* %long_intb, align 8
store i64 %shl, ptr %long_intb, align 8
ret void
}
6 changes: 3 additions & 3 deletions llvm/test/CodeGen/PowerPC/ppc-ctr-dead-code.ll
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
; RUN: llc < %s -mtriple=powerpc64-unknown-linux-gnu -mcpu=pwr8 -verify-machineinstrs | FileCheck %s

; Function Attrs: norecurse nounwind readonly
define signext i32 @limit_loop(i32 signext %iters, i32* nocapture readonly %vec, i32 signext %limit) local_unnamed_addr {
define signext i32 @limit_loop(i32 signext %iters, ptr nocapture readonly %vec, i32 signext %limit) local_unnamed_addr {
entry:
%cmp5 = icmp sgt i32 %iters, 0
br i1 %cmp5, label %for.body.preheader, label %cleanup
Expand All @@ -19,8 +19,8 @@ for.cond: ; preds = %for.body

for.body: ; preds = %for.body.preheader, %for.cond
%indvars.iv = phi i64 [ 0, %for.body.preheader ], [ %indvars.iv.next, %for.cond ]
%arrayidx = getelementptr inbounds i32, i32* %vec, i64 %indvars.iv
%1 = load i32, i32* %arrayidx, align 4
%arrayidx = getelementptr inbounds i32, ptr %vec, i64 %indvars.iv
%1 = load i32, ptr %arrayidx, align 4
%cmp1 = icmp slt i32 %1, %limit
%indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
br i1 %cmp1, label %for.cond, label %cleanup
Expand Down
4 changes: 2 additions & 2 deletions llvm/test/CodeGen/PowerPC/ppc-disable-non-volatile-cr.ll
Original file line number Diff line number Diff line change
Expand Up @@ -29,11 +29,11 @@ entry:
br i1 %cmp, label %if.then, label %if.else

if.then: ; preds = %entry
tail call void bitcast (void (...)* @fa to void ()*)()
tail call void @fa()
br label %if.end

if.else: ; preds = %entry
tail call void bitcast (void (...)* @fb to void ()*)()
tail call void @fb()
br label %if.end

if.end: ; preds = %if.else, %if.then
Expand Down
11 changes: 4 additions & 7 deletions llvm/test/CodeGen/PowerPC/ppc-empty-fs.ll
Original file line number Diff line number Diff line change
Expand Up @@ -8,21 +8,18 @@ target triple = "powerpc64-unknown-linux-gnu"
%struct.fab = type { float, float }

; Function Attrs: nounwind
define void @func_fab(%struct.fab* noalias sret(%struct.fab) %agg.result, i64 %x.coerce) #0 {
define void @func_fab(ptr noalias sret(%struct.fab) %agg.result, i64 %x.coerce) #0 {
entry:
%x = alloca %struct.fab, align 8
%0 = bitcast %struct.fab* %x to i64*
store i64 %x.coerce, i64* %0, align 1
%1 = bitcast %struct.fab* %agg.result to i8*
%2 = bitcast %struct.fab* %x to i8*
call void @llvm.memcpy.p0i8.p0i8.i64(i8* align 4 %1, i8* align 4 %2, i64 8, i1 false)
store i64 %x.coerce, ptr %x, align 1
call void @llvm.memcpy.p0.p0.i64(ptr align 4 %agg.result, ptr align 4 %x, i64 8, i1 false)
ret void
}

; CHECK: func_fab

; Function Attrs: nounwind
declare void @llvm.memcpy.p0i8.p0i8.i64(i8* nocapture, i8* nocapture readonly, i64, i1) #1
declare void @llvm.memcpy.p0.p0.i64(ptr nocapture, ptr nocapture readonly, i64, i1) #1

attributes #0 = { nounwind "less-precise-fpmad"="false" "frame-pointer"="none" "no-infs-fp-math"="false" "no-nans-fp-math"="false" "no-realign-stack" "stack-protector-buffer-size"="8" "target-features"="" "unsafe-fp-math"="false" "use-soft-float"="false" }
attributes #1 = { nounwind }
Expand Down
4 changes: 2 additions & 2 deletions llvm/test/CodeGen/PowerPC/ppc-label.ll
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
; };
;
; unsigned int ret = foo();
; void* g = (void *) ((unsigned int)&&L + arr[ret]);
; ptr g = (ptr) ((unsigned int)&&L + arr[ret]);
; goto *g;
;
; x:
Expand All @@ -32,7 +32,7 @@ entry:
br label %L

L: ; preds = %L, %entry
indirectbr i8* inttoptr (i32 add (i32 ptrtoint (i8* blockaddress(@main, %L) to i32), i32 sub (i32 ptrtoint (i8* blockaddress(@main, %return) to i32), i32 ptrtoint (i8* blockaddress(@main, %L) to i32))) to i8*), [label %return, label %L]
indirectbr ptr inttoptr (i32 add (i32 ptrtoint (ptr blockaddress(@main, %L) to i32), i32 sub (i32 ptrtoint (ptr blockaddress(@main, %return) to i32), i32 ptrtoint (ptr blockaddress(@main, %L) to i32))) to ptr), [label %return, label %L]

return: ; preds = %L
ret i32 15
Expand Down
2 changes: 1 addition & 1 deletion llvm/test/CodeGen/PowerPC/ppc-label2.ll
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ entry:
br label %__here

__here: ; preds = %entry
ret i64 ptrtoint (i8* blockaddress(@foo, %__here) to i64)
ret i64 ptrtoint (ptr blockaddress(@foo, %__here) to i64)
}

; CHECK-PIC32: lwz {{r[0-9]+}}, .LC0-.LTOC(r30)
Expand Down
8 changes: 4 additions & 4 deletions llvm/test/CodeGen/PowerPC/ppc-partword-atomic.ll
Original file line number Diff line number Diff line change
Expand Up @@ -52,9 +52,9 @@ define dso_local zeroext i32 @testI8(i8 zeroext %val) local_unnamed_addr #0 {
; PWR9-NEXT: li 3, 55
; PWR9-NEXT: blr
entry:
%0 = atomicrmw xchg i8* getelementptr inbounds ({ i8 }, { i8 }* @value8, i64 0, i32 0), i8 %val seq_cst, align 1
%0 = atomicrmw xchg ptr @value8, i8 %val seq_cst, align 1
%conv = zext i8 %0 to i32
store i32 %conv, i32* @global_int, align 4
store i32 %conv, ptr @global_int, align 4
ret i32 55
}

Expand Down Expand Up @@ -105,9 +105,9 @@ define dso_local zeroext i32 @testI16(i16 zeroext %val) local_unnamed_addr #0 {
; PWR9-NEXT: li 3, 55
; PWR9-NEXT: blr
entry:
%0 = atomicrmw xchg i16* getelementptr inbounds ({ i16 }, { i16 }* @value16, i64 0, i32 0), i16 %val seq_cst, align 2
%0 = atomicrmw xchg ptr @value16, i16 %val seq_cst, align 2
%conv = zext i16 %0 to i32
store i32 %conv, i32* @global_int, align 4
store i32 %conv, ptr @global_int, align 4
ret i32 55
}

Expand Down
20 changes: 10 additions & 10 deletions llvm/test/CodeGen/PowerPC/ppc-prologue.ll
Original file line number Diff line number Diff line change
Expand Up @@ -7,20 +7,20 @@ define i32 @_Z4funci(i32 %a) ssp {
; CHECK-NEXT: stw 31, 28(1)
; CHECK: mr 31, 1
entry:
%a_addr = alloca i32 ; <i32*> [#uses=2]
%retval = alloca i32 ; <i32*> [#uses=2]
%0 = alloca i32 ; <i32*> [#uses=2]
%a_addr = alloca i32 ; <ptr> [#uses=2]
%retval = alloca i32 ; <ptr> [#uses=2]
%0 = alloca i32 ; <ptr> [#uses=2]
%"alloca point" = bitcast i32 0 to i32 ; <i32> [#uses=0]
store i32 %a, i32* %a_addr
%1 = call i32 @_Z3barPi(i32* %a_addr) ; <i32> [#uses=1]
store i32 %1, i32* %0, align 4
%2 = load i32, i32* %0, align 4 ; <i32> [#uses=1]
store i32 %2, i32* %retval, align 4
store i32 %a, ptr %a_addr
%1 = call i32 @_Z3barPi(ptr %a_addr) ; <i32> [#uses=1]
store i32 %1, ptr %0, align 4
%2 = load i32, ptr %0, align 4 ; <i32> [#uses=1]
store i32 %2, ptr %retval, align 4
br label %return

return: ; preds = %entry
%retval1 = load i32, i32* %retval ; <i32> [#uses=1]
%retval1 = load i32, ptr %retval ; <i32> [#uses=1]
ret i32 %retval1
}

declare i32 @_Z3barPi(i32*)
declare i32 @_Z3barPi(ptr)
106 changes: 52 additions & 54 deletions llvm/test/CodeGen/PowerPC/ppc-shrink-wrapping.ll
Original file line number Diff line number Diff line change
Expand Up @@ -61,8 +61,8 @@ define i32 @foo(i32 %a, i32 %b) {
br i1 %tmp2, label %true, label %false

true:
store i32 %a, i32* %tmp, align 4
%tmp4 = call i32 @doSomething(i32 0, i32* %tmp)
store i32 %a, ptr %tmp, align 4
%tmp4 = call i32 @doSomething(i32 0, ptr %tmp)
br label %false

false:
Expand All @@ -71,7 +71,7 @@ false:
}

; Function Attrs: optsize
declare i32 @doSomething(i32, i32*)
declare i32 @doSomething(i32, ptr)


; Check that we do not perform the restore inside the loop whereas the save
Expand Down Expand Up @@ -133,7 +133,7 @@ for.preheader:
for.body: ; preds = %entry, %for.body
%i.05 = phi i32 [ %inc, %for.body ], [ 0, %for.preheader ]
%sum.04 = phi i32 [ %add, %for.body ], [ 0, %for.preheader ]
%call = tail call i32 bitcast (i32 (...)* @something to i32 ()*)()
%call = tail call i32 @something()
%add = add nsw i32 %call, %sum.04
%inc = add nuw nsw i32 %i.05, 1
%exitcond = icmp eq i32 %inc, 10
Expand Down Expand Up @@ -190,7 +190,7 @@ for.preheader:
for.body: ; preds = %for.body, %entry
%i.04 = phi i32 [ 0, %for.preheader ], [ %inc, %for.body ]
%sum.03 = phi i32 [ 0, %for.preheader ], [ %add, %for.body ]
%call = tail call i32 bitcast (i32 (...)* @something to i32 ()*)()
%call = tail call i32 @something()
%add = add nsw i32 %call, %sum.03
%inc = add nuw nsw i32 %i.04, 1
%exitcond = icmp eq i32 %inc, 10
Expand Down Expand Up @@ -277,14 +277,14 @@ for.preheader:
for.body: ; preds = %entry, %for.body
%i.05 = phi i32 [ %inc, %for.body ], [ 0, %for.preheader ]
%sum.04 = phi i32 [ %add, %for.body ], [ 0, %for.preheader ]
%call = tail call i32 bitcast (i32 (...)* @something to i32 ()*)()
%call = tail call i32 @something()
%add = add nsw i32 %call, %sum.04
%inc = add nuw nsw i32 %i.05, 1
%exitcond = icmp eq i32 %inc, 10
br i1 %exitcond, label %for.end, label %for.body

for.end: ; preds = %for.body
tail call void bitcast (void (...)* @somethingElse to void ()*)()
tail call void @somethingElse()
%shl = shl i32 %add, 3
br label %if.end

Expand Down Expand Up @@ -364,13 +364,13 @@ entry:
br i1 %tobool, label %if.else, label %if.then

if.then: ; preds = %entry
tail call void bitcast (void (...)* @somethingElse to void ()*)()
tail call void @somethingElse()
br label %for.body

for.body: ; preds = %for.body, %if.then
%i.05 = phi i32 [ 0, %if.then ], [ %inc, %for.body ]
%sum.04 = phi i32 [ 0, %if.then ], [ %add, %for.body ]
%call = tail call i32 bitcast (i32 (...)* @something to i32 ()*)()
%call = tail call i32 @something()
%add = add nsw i32 %call, %sum.04
%inc = add nuw nsw i32 %i.05, 1
%exitcond = icmp eq i32 %inc, 10
Expand Down Expand Up @@ -589,9 +589,9 @@ if.then:

for.body: ; preds = %for.body, %entry
%sum.03 = phi i32 [ 0, %if.then ], [ %add, %for.body ]
%call = tail call i32 bitcast (i32 (...)* @something to i32 ()*)()
%call = tail call i32 @something()
%add = add nsw i32 %call, %sum.03
store i32 %add, i32* %ptr
store i32 %add, ptr %ptr
br label %for.body

if.end:
Expand All @@ -613,7 +613,7 @@ for.body: ; preds = %for.body, %entry
%sum.03 = phi i32 [ 0, %if.then ], [ %add, %body1 ], [ 1, %body2]
%call = tail call i32 asm "mftb $0, 268", "=r,~{r14}"()
%add = add nsw i32 %call, %sum.03
store i32 %add, i32* %ptr
store i32 %add, ptr %ptr
br i1 undef, label %body1, label %body2

body1:
Expand All @@ -639,21 +639,19 @@ body: ; preds = %entry
br i1 undef, label %loop2a, label %end

loop1: ; preds = %loop2a, %loop2b
%var.phi = phi i32* [ %next.phi, %loop2b ], [ %var, %loop2a ]
%next.phi = phi i32* [ %next.load, %loop2b ], [ %next.var, %loop2a ]
%0 = icmp eq i32* %var, null
%next.load = load i32*, i32** undef
%var.phi = phi ptr [ %next.phi, %loop2b ], [ %var, %loop2a ]
%next.phi = phi ptr [ %next.load, %loop2b ], [ %next.var, %loop2a ]
%0 = icmp eq ptr %var, null
%next.load = load ptr, ptr undef
br i1 %0, label %loop2a, label %loop2b

loop2a: ; preds = %loop1, %body, %entry
%var = phi i32* [ null, %body ], [ null, %entry ], [ %next.phi, %loop1 ]
%next.var = phi i32* [ undef, %body ], [ null, %entry ], [ %next.load, %loop1 ]
%var = phi ptr [ null, %body ], [ null, %entry ], [ %next.phi, %loop1 ]
%next.var = phi ptr [ undef, %body ], [ null, %entry ], [ %next.load, %loop1 ]
br label %loop1

loop2b: ; preds = %loop1
%gep1 = bitcast i32* %var.phi to i32*
%next.ptr = bitcast i32* %gep1 to i32**
store i32* %next.phi, i32** %next.ptr
store ptr %next.phi, ptr %var.phi
br label %loop1

end:
Expand All @@ -664,8 +662,8 @@ end:
@lock = common global i32 0, align 4
@htindex = common global i32 0, align 4
@stride = common global i32 0, align 4
@ht = common global i32* null, align 8
@he = common global i8* null, align 8
@ht = common global ptr null, align 8
@he = common global ptr null, align 8

; Test for a bug that was caused when save point was equal to restore point.
; Function Attrs: nounwind
Expand All @@ -683,26 +681,26 @@ end:
; CHECK: blr
define signext i32 @transpose() {
entry:
%0 = load i32, i32* getelementptr inbounds ([0 x i32], [0 x i32]* @columns, i64 0, i64 1), align 4
%0 = load i32, ptr getelementptr inbounds ([0 x i32], ptr @columns, i64 0, i64 1), align 4
%shl.i = shl i32 %0, 7
%1 = load i32, i32* getelementptr inbounds ([0 x i32], [0 x i32]* @columns, i64 0, i64 2), align 4
%1 = load i32, ptr getelementptr inbounds ([0 x i32], ptr @columns, i64 0, i64 2), align 4
%or.i = or i32 %shl.i, %1
%shl1.i = shl i32 %or.i, 7
%2 = load i32, i32* getelementptr inbounds ([0 x i32], [0 x i32]* @columns, i64 0, i64 3), align 4
%2 = load i32, ptr getelementptr inbounds ([0 x i32], ptr @columns, i64 0, i64 3), align 4
%or2.i = or i32 %shl1.i, %2
%3 = load i32, i32* getelementptr inbounds ([0 x i32], [0 x i32]* @columns, i64 0, i64 7), align 4
%3 = load i32, ptr getelementptr inbounds ([0 x i32], ptr @columns, i64 0, i64 7), align 4
%shl3.i = shl i32 %3, 7
%4 = load i32, i32* getelementptr inbounds ([0 x i32], [0 x i32]* @columns, i64 0, i64 6), align 4
%4 = load i32, ptr getelementptr inbounds ([0 x i32], ptr @columns, i64 0, i64 6), align 4
%or4.i = or i32 %shl3.i, %4
%shl5.i = shl i32 %or4.i, 7
%5 = load i32, i32* getelementptr inbounds ([0 x i32], [0 x i32]* @columns, i64 0, i64 5), align 4
%5 = load i32, ptr getelementptr inbounds ([0 x i32], ptr @columns, i64 0, i64 5), align 4
%or6.i = or i32 %shl5.i, %5
%cmp.i = icmp ugt i32 %or2.i, %or6.i
br i1 %cmp.i, label %cond.true.i, label %cond.false.i

cond.true.i:
%shl7.i = shl i32 %or2.i, 7
%6 = load i32, i32* getelementptr inbounds ([0 x i32], [0 x i32]* @columns, i64 0, i64 4), align 4
%6 = load i32, ptr getelementptr inbounds ([0 x i32], ptr @columns, i64 0, i64 4), align 4
%or8.i = or i32 %6, %shl7.i
%conv.i = zext i32 %or8.i to i64
%shl9.i = shl nuw nsw i64 %conv.i, 21
Expand All @@ -712,7 +710,7 @@ cond.true.i:

cond.false.i:
%shl12.i = shl i32 %or6.i, 7
%7 = load i32, i32* getelementptr inbounds ([0 x i32], [0 x i32]* @columns, i64 0, i64 4), align 4
%7 = load i32, ptr getelementptr inbounds ([0 x i32], ptr @columns, i64 0, i64 4), align 4
%or13.i = or i32 %7, %shl12.i
%conv14.i = zext i32 %or13.i to i64
%shl15.i = shl nuw nsw i64 %conv14.i, 21
Expand All @@ -724,24 +722,24 @@ hash.exit:
%cond.i = phi i64 [ %or11.i, %cond.true.i ], [ %or17.i, %cond.false.i ]
%shr.29.i = lshr i64 %cond.i, 17
%conv18.i = trunc i64 %shr.29.i to i32
store i32 %conv18.i, i32* @lock, align 4
store i32 %conv18.i, ptr @lock, align 4
%rem.i = srem i64 %cond.i, 1050011
%conv19.i = trunc i64 %rem.i to i32
store i32 %conv19.i, i32* @htindex, align 4
store i32 %conv19.i, ptr @htindex, align 4
%rem20.i = urem i32 %conv18.i, 179
%add.i = or i32 %rem20.i, 131072
store i32 %add.i, i32* @stride, align 4
%8 = load i32*, i32** @ht, align 8
%arrayidx = getelementptr inbounds i32, i32* %8, i64 %rem.i
%9 = load i32, i32* %arrayidx, align 4
store i32 %add.i, ptr @stride, align 4
%8 = load ptr, ptr @ht, align 8
%arrayidx = getelementptr inbounds i32, ptr %8, i64 %rem.i
%9 = load i32, ptr %arrayidx, align 4
%cmp1 = icmp eq i32 %9, %conv18.i
br i1 %cmp1, label %if.then, label %if.end

if.then:
%idxprom.lcssa = phi i64 [ %rem.i, %hash.exit ], [ %idxprom.1, %if.end ], [ %idxprom.2, %if.end.1 ], [ %idxprom.3, %if.end.2 ], [ %idxprom.4, %if.end.3 ], [ %idxprom.5, %if.end.4 ], [ %idxprom.6, %if.end.5 ], [ %idxprom.7, %if.end.6 ]
%10 = load i8*, i8** @he, align 8
%arrayidx3 = getelementptr inbounds i8, i8* %10, i64 %idxprom.lcssa
%11 = load i8, i8* %arrayidx3, align 1
%10 = load ptr, ptr @he, align 8
%arrayidx3 = getelementptr inbounds i8, ptr %10, i64 %idxprom.lcssa
%11 = load i8, ptr %arrayidx3, align 1
%conv = sext i8 %11 to i32
br label %cleanup

Expand All @@ -751,8 +749,8 @@ if.end:
%sub = add nsw i32 %add, -1050011
%sub.add = select i1 %cmp4, i32 %sub, i32 %add
%idxprom.1 = sext i32 %sub.add to i64
%arrayidx.1 = getelementptr inbounds i32, i32* %8, i64 %idxprom.1
%12 = load i32, i32* %arrayidx.1, align 4
%arrayidx.1 = getelementptr inbounds i32, ptr %8, i64 %idxprom.1
%12 = load i32, ptr %arrayidx.1, align 4
%cmp1.1 = icmp eq i32 %12, %conv18.i
br i1 %cmp1.1, label %if.then, label %if.end.1

Expand All @@ -766,8 +764,8 @@ if.end.1:
%sub.1 = add nsw i32 %add.1, -1050011
%sub.add.1 = select i1 %cmp4.1, i32 %sub.1, i32 %add.1
%idxprom.2 = sext i32 %sub.add.1 to i64
%arrayidx.2 = getelementptr inbounds i32, i32* %8, i64 %idxprom.2
%13 = load i32, i32* %arrayidx.2, align 4
%arrayidx.2 = getelementptr inbounds i32, ptr %8, i64 %idxprom.2
%13 = load i32, ptr %arrayidx.2, align 4
%cmp1.2 = icmp eq i32 %13, %conv18.i
br i1 %cmp1.2, label %if.then, label %if.end.2

Expand All @@ -777,8 +775,8 @@ if.end.2:
%sub.2 = add nsw i32 %add.2, -1050011
%sub.add.2 = select i1 %cmp4.2, i32 %sub.2, i32 %add.2
%idxprom.3 = sext i32 %sub.add.2 to i64
%arrayidx.3 = getelementptr inbounds i32, i32* %8, i64 %idxprom.3
%14 = load i32, i32* %arrayidx.3, align 4
%arrayidx.3 = getelementptr inbounds i32, ptr %8, i64 %idxprom.3
%14 = load i32, ptr %arrayidx.3, align 4
%cmp1.3 = icmp eq i32 %14, %conv18.i
br i1 %cmp1.3, label %if.then, label %if.end.3

Expand All @@ -788,8 +786,8 @@ if.end.3:
%sub.3 = add nsw i32 %add.3, -1050011
%sub.add.3 = select i1 %cmp4.3, i32 %sub.3, i32 %add.3
%idxprom.4 = sext i32 %sub.add.3 to i64
%arrayidx.4 = getelementptr inbounds i32, i32* %8, i64 %idxprom.4
%15 = load i32, i32* %arrayidx.4, align 4
%arrayidx.4 = getelementptr inbounds i32, ptr %8, i64 %idxprom.4
%15 = load i32, ptr %arrayidx.4, align 4
%cmp1.4 = icmp eq i32 %15, %conv18.i
br i1 %cmp1.4, label %if.then, label %if.end.4

Expand All @@ -799,8 +797,8 @@ if.end.4:
%sub.4 = add nsw i32 %add.4, -1050011
%sub.add.4 = select i1 %cmp4.4, i32 %sub.4, i32 %add.4
%idxprom.5 = sext i32 %sub.add.4 to i64
%arrayidx.5 = getelementptr inbounds i32, i32* %8, i64 %idxprom.5
%16 = load i32, i32* %arrayidx.5, align 4
%arrayidx.5 = getelementptr inbounds i32, ptr %8, i64 %idxprom.5
%16 = load i32, ptr %arrayidx.5, align 4
%cmp1.5 = icmp eq i32 %16, %conv18.i
br i1 %cmp1.5, label %if.then, label %if.end.5

Expand All @@ -810,8 +808,8 @@ if.end.5:
%sub.5 = add nsw i32 %add.5, -1050011
%sub.add.5 = select i1 %cmp4.5, i32 %sub.5, i32 %add.5
%idxprom.6 = sext i32 %sub.add.5 to i64
%arrayidx.6 = getelementptr inbounds i32, i32* %8, i64 %idxprom.6
%17 = load i32, i32* %arrayidx.6, align 4
%arrayidx.6 = getelementptr inbounds i32, ptr %8, i64 %idxprom.6
%17 = load i32, ptr %arrayidx.6, align 4
%cmp1.6 = icmp eq i32 %17, %conv18.i
br i1 %cmp1.6, label %if.then, label %if.end.6

Expand All @@ -821,8 +819,8 @@ if.end.6:
%sub.6 = add nsw i32 %add.6, -1050011
%sub.add.6 = select i1 %cmp4.6, i32 %sub.6, i32 %add.6
%idxprom.7 = sext i32 %sub.add.6 to i64
%arrayidx.7 = getelementptr inbounds i32, i32* %8, i64 %idxprom.7
%18 = load i32, i32* %arrayidx.7, align 4
%arrayidx.7 = getelementptr inbounds i32, ptr %8, i64 %idxprom.7
%18 = load i32, ptr %arrayidx.7, align 4
%cmp1.7 = icmp eq i32 %18, %conv18.i
br i1 %cmp1.7, label %if.then, label %cleanup
}
6 changes: 3 additions & 3 deletions llvm/test/CodeGen/PowerPC/ppc-vaarg-agg.ll
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@
target datalayout = "E-p:32:32:32-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:64:64-f32:32:32-f64:64:64-v128:128:128-n32"
target triple = "powerpc-montavista-linux-gnuspe"

%struct.__va_list_tag.0.9.18.23.32.41.48.55.62.67.72.77.82.87.90.93.96.101.105 = type { i8, i8, i16, i8*, i8* }
%struct.__va_list_tag.0.9.18.23.32.41.48.55.62.67.72.77.82.87.90.93.96.101.105 = type { i8, i8, i16, ptr, ptr }

define fastcc void @test1(%struct.__va_list_tag.0.9.18.23.32.41.48.55.62.67.72.77.82.87.90.93.96.101.105* %args) {
define fastcc void @test1(ptr %args) {
entry:
br i1 undef, label %repeat, label %maxlen_reached

Expand All @@ -30,7 +30,7 @@ sw.bb321: ; preds = %repeat
unreachable

sw.bb323: ; preds = %repeat
%0 = va_arg %struct.__va_list_tag.0.9.18.23.32.41.48.55.62.67.72.77.82.87.90.93.96.101.105* %args, i32
%0 = va_arg ptr %args, i32
unreachable

sw.bb326: ; preds = %repeat
Expand Down
6 changes: 3 additions & 3 deletions llvm/test/CodeGen/PowerPC/ppc32-align-long-double-sf.ll
Original file line number Diff line number Diff line change
Expand Up @@ -6,15 +6,15 @@

define void @foo() #0 {
entry:
%0 = load ppc_fp128, ppc_fp128* @x, align 16
%call = tail call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i32 0, i32 0), ppc_fp128 %0)
%0 = load ppc_fp128, ptr @x, align 16
%call = tail call i32 (ptr, ...) @printf(ptr @.str, ppc_fp128 %0)
ret void
}
; Do not skip register r4 because of register alignment in soft float mode. Instead skipping
; put in r4 part of first argument for printf function (long double).
; CHECK: lwzu 4, x@l({{[0-9]+}})

declare i32 @printf(i8* nocapture readonly, ...) #0
declare i32 @printf(ptr nocapture readonly, ...) #0

attributes #0 = { "use-soft-float"="true" }

Expand Down
4 changes: 2 additions & 2 deletions llvm/test/CodeGen/PowerPC/ppc32-constant-BE-ppcf128.ll
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ target triple = "powerpc-buildroot-linux-gnu"

define i32 @main() #0 {
entry:
%call = tail call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i32 0, i32 0), ppc_fp128 0xM3FF00000000000000000000000000000)
%call = tail call i32 (ptr, ...) @printf(ptr @.str, ppc_fp128 0xM3FF00000000000000000000000000000)
ret i32 0
}

Expand All @@ -18,7 +18,7 @@ entry:
; CHECK: li 5, 0
; CHECK: li 7, 0

declare i32 @printf(i8* nocapture readonly, ...)
declare i32 @printf(ptr nocapture readonly, ...)

attributes #0 = { "use-soft-float"="true" }

4 changes: 2 additions & 2 deletions llvm/test/CodeGen/PowerPC/ppc32-i1-vaarg.ll
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
; RUN: llc -verify-machineinstrs < %s -mcpu=ppc32 | FileCheck %s
target triple = "powerpc-unknown-linux-gnu"

declare void @printf(i8*, ...)
declare void @printf(ptr, ...)

define void @main() {
call void (i8*, ...) @printf(i8* undef, i1 false)
call void (ptr, ...) @printf(ptr undef, i1 false)
ret void
}

Expand Down
4 changes: 2 additions & 2 deletions llvm/test/CodeGen/PowerPC/ppc32-i64-to-float-conv.ll
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,9 @@

define void @foo() local_unnamed_addr {
entry:
%0 = load i64, i64* @ll
%0 = load i64, ptr @ll
%conv = sitofp i64 %0 to float
store float %conv, float* getelementptr inbounds (%struct.A, %struct.A* @a, i32 0, i32 0)
store float %conv, ptr @a
ret void
}

Expand Down
4 changes: 2 additions & 2 deletions llvm/test/CodeGen/PowerPC/ppc32-lshrti3.ll
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ target triple = "powerpc--netbsd"
; Function Attrs: nounwind uwtable
define i32 @fn1() #0 {
entry:
%.promoted = load i72, i72* inttoptr (i32 1 to i72*), align 4
%.promoted = load i72, ptr inttoptr (i32 1 to ptr), align 4
br label %while.cond

while.cond: ; preds = %while.cond, %entry
Expand All @@ -28,7 +28,7 @@ while.cond: ; preds = %while.cond, %entry

while.end: ; preds = %while.cond
%bf.set.lcssa = phi i72 [ %bf.set, %while.cond ]
store i72 %bf.set.lcssa, i72* inttoptr (i32 1 to i72*), align 4
store i72 %bf.set.lcssa, ptr inttoptr (i32 1 to ptr), align 4
ret i32 undef
}

Expand Down
10 changes: 5 additions & 5 deletions llvm/test/CodeGen/PowerPC/ppc32-nest.ll
Original file line number Diff line number Diff line change
Expand Up @@ -5,22 +5,22 @@ target triple = "powerpc-unknown-linux-gnu"
; Tests that the 'nest' parameter attribute causes the relevant parameter to be
; passed in the right register (r11 for PPC).

define i8* @nest_receiver(i8* nest %arg) nounwind {
define ptr @nest_receiver(ptr nest %arg) nounwind {
; CHECK-LABEL: nest_receiver:
; CHECK: # %bb.0:
; CHECK-NEXT: mr 3, 11
; CHECK-NEXT: blr

ret i8* %arg
ret ptr %arg
}

define i8* @nest_caller(i8* %arg) nounwind {
define ptr @nest_caller(ptr %arg) nounwind {
; CHECK-LABEL: nest_caller:
; CHECK: mr 11, 3
; CHECK-NEXT: bl nest_receiver
; CHECK: blr

%result = call i8* @nest_receiver(i8* nest %arg)
ret i8* %result
%result = call ptr @nest_receiver(ptr nest %arg)
ret ptr %result
}

6 changes: 3 additions & 3 deletions llvm/test/CodeGen/PowerPC/ppc32-pic-large.ll
Original file line number Diff line number Diff line change
Expand Up @@ -16,15 +16,15 @@ declare i32 @call_foo(i32, ...)

define i32 @foo() {
entry:
%0 = load i32, i32* @bar, align 4
%0 = load i32, ptr @bar, align 4
%call = call i32 (i32, ...) @call_foo(i32 %0, i32 0, i32 1, i32 2, i32 4, i32 8, i32 16, i32 32, i32 64)
ret i32 %0
}

define i32 @load() {
entry:
%0 = load i32, i32* @bar1
%1 = load i32, i32* @bar2
%0 = load i32, ptr @bar1
%1 = load i32, ptr @bar2
%2 = add i32 %0, %1
ret i32 %2
}
Expand Down
2 changes: 1 addition & 1 deletion llvm/test/CodeGen/PowerPC/ppc32-pic.ll
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ declare i32 @call_foo(i32, ...)

define i32 @foo() {
entry:
%0 = load i32, i32* @bar, align 4
%0 = load i32, ptr @bar, align 4
%call = call i32 (i32, ...) @call_foo(i32 %0, i32 0, i32 1, i32 2, i32 4, i32 8, i32 16, i32 32, i32 64)
ret i32 0
}
Expand Down
2 changes: 1 addition & 1 deletion llvm/test/CodeGen/PowerPC/ppc32-secure-plt-tls.ll
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
@a = thread_local local_unnamed_addr global i32 6, align 4
define i32 @main() local_unnamed_addr #0 {
entry:
%0 = load i32, i32* @a, align 4
%0 = load i32, ptr @a, align 4
ret i32 %0
}

Expand Down
2 changes: 1 addition & 1 deletion llvm/test/CodeGen/PowerPC/ppc32-secure-plt-tls2.ll
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
@a = thread_local local_unnamed_addr global i32 6, align 4
define i32 @main() local_unnamed_addr #0 {
entry:
%0 = load i32, i32* @a, align 4
%0 = load i32, ptr @a, align 4
ret i32 %0
}

Expand Down
6 changes: 3 additions & 3 deletions llvm/test/CodeGen/PowerPC/ppc32-skip-regs.ll
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@ target triple = "powerpc-buildroot-linux-gnu"

define void @foo() #0 {
entry:
%0 = load ppc_fp128, ppc_fp128* @x, align 16
%call = tail call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i32 0, i32 0), ppc_fp128 %0, ppc_fp128 %0)
%0 = load ppc_fp128, ptr @x, align 16
%call = tail call i32 (ptr, ...) @printf(ptr @.str, ppc_fp128 %0, ppc_fp128 %0)
ret void
}
; Do not put second argument of function in r8 register, because there is no enough registers
Expand All @@ -21,6 +21,6 @@ entry:
; CHECK: stw 5, 12(1)
; CHECK: stw 4, 8(1)

declare i32 @printf(i8* nocapture readonly, ...)
declare i32 @printf(ptr nocapture readonly, ...)

attributes #0 = { "use-soft-float"="true" }
8 changes: 3 additions & 5 deletions llvm/test/CodeGen/PowerPC/ppc32-vacopy.ll
Original file line number Diff line number Diff line change
@@ -1,17 +1,15 @@
; RUN: llc -verify-machineinstrs -mtriple="powerpc-unknown-linux-gnu" -mcpu=ppc64 < %s | FileCheck %s
; PR15286

%va_list = type {i8, i8, i16, i8*, i8*}
declare void @llvm.va_copy(i8*, i8*)
%va_list = type {i8, i8, i16, ptr, ptr}
declare void @llvm.va_copy(ptr, ptr)

define void @test_vacopy() nounwind {
entry:
%0 = alloca %va_list
%1 = alloca %va_list
%2 = bitcast %va_list* %0 to i8*
%3 = bitcast %va_list* %1 to i8*

call void @llvm.va_copy(i8* %3, i8* %2)
call void @llvm.va_copy(ptr %1, ptr %0)

ret void
}
Expand Down
30 changes: 13 additions & 17 deletions llvm/test/CodeGen/PowerPC/ppc440-fp-basic.ll
Original file line number Diff line number Diff line change
Expand Up @@ -2,32 +2,28 @@

%0 = type { double, double }

define void @maybe_an_fma(%0* sret(%0) %agg.result, %0* byval(%0) %a, %0* byval(%0) %b, %0* byval(%0) %c) nounwind {
define void @maybe_an_fma(ptr sret(%0) %agg.result, ptr byval(%0) %a, ptr byval(%0) %b, ptr byval(%0) %c) nounwind {
entry:
%a.realp = getelementptr inbounds %0, %0* %a, i32 0, i32 0
%a.real = load double, double* %a.realp
%a.imagp = getelementptr inbounds %0, %0* %a, i32 0, i32 1
%a.imag = load double, double* %a.imagp
%b.realp = getelementptr inbounds %0, %0* %b, i32 0, i32 0
%b.real = load double, double* %b.realp
%b.imagp = getelementptr inbounds %0, %0* %b, i32 0, i32 1
%b.imag = load double, double* %b.imagp
%a.real = load double, ptr %a
%a.imagp = getelementptr inbounds %0, ptr %a, i32 0, i32 1
%a.imag = load double, ptr %a.imagp
%b.real = load double, ptr %b
%b.imagp = getelementptr inbounds %0, ptr %b, i32 0, i32 1
%b.imag = load double, ptr %b.imagp
%mul.rl = fmul double %a.real, %b.real
%mul.rr = fmul double %a.imag, %b.imag
%mul.r = fsub double %mul.rl, %mul.rr
%mul.il = fmul double %a.imag, %b.real
%mul.ir = fmul double %a.real, %b.imag
%mul.i = fadd double %mul.il, %mul.ir
%c.realp = getelementptr inbounds %0, %0* %c, i32 0, i32 0
%c.real = load double, double* %c.realp
%c.imagp = getelementptr inbounds %0, %0* %c, i32 0, i32 1
%c.imag = load double, double* %c.imagp
%c.real = load double, ptr %c
%c.imagp = getelementptr inbounds %0, ptr %c, i32 0, i32 1
%c.imag = load double, ptr %c.imagp
%add.r = fadd double %mul.r, %c.real
%add.i = fadd double %mul.i, %c.imag
%real = getelementptr inbounds %0, %0* %agg.result, i32 0, i32 0
%imag = getelementptr inbounds %0, %0* %agg.result, i32 0, i32 1
store double %add.r, double* %real
store double %add.i, double* %imag
%imag = getelementptr inbounds %0, ptr %agg.result, i32 0, i32 1
store double %add.r, ptr %agg.result
store double %add.i, ptr %imag
ret void
; CHECK: fmadd
}
30 changes: 15 additions & 15 deletions llvm/test/CodeGen/PowerPC/ppc64-P9-mod.ll
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
define void @modulo_sw(i32 signext %a, i32 signext %b) local_unnamed_addr {
entry:
%rem = srem i32 %a, %b
store i32 %rem, i32* @mod_resultsw, align 4
store i32 %rem, ptr @mod_resultsw, align 4
ret void
; CHECK-LABEL: modulo_sw
; CHECK: modsw {{[0-9]+}}, 3, 4
Expand Down Expand Up @@ -67,7 +67,7 @@ entry:
define void @modulo_ud(i64 %a, i64 %b) local_unnamed_addr {
entry:
%rem = urem i64 %a, %b
store i64 %rem, i64* @mod_resultud, align 8
store i64 %rem, ptr @mod_resultud, align 8
ret void
; CHECK-LABEL: modulo_ud
; CHECK: modud {{[0-9]+}}, 3, 4
Expand All @@ -83,9 +83,9 @@ entry:
define void @modulo_div_sw(i32 signext %a, i32 signext %b) local_unnamed_addr {
entry:
%rem = srem i32 %a, %b
store i32 %rem, i32* @mod_resultsw, align 4
store i32 %rem, ptr @mod_resultsw, align 4
%div = sdiv i32 %a, %b
store i32 %div, i32* @div_resultsw, align 4
store i32 %div, ptr @div_resultsw, align 4
ret void
; CHECK-LABEL: modulo_div_sw
; CHECK: modsw {{[0-9]+}}, 3, 4
Expand All @@ -109,9 +109,9 @@ entry:
define void @modulo_div_abc_sw(i32 signext %a, i32 signext %b, i32 signext %c) local_unnamed_addr {
entry:
%rem = srem i32 %a, %c
store i32 %rem, i32* @mod_resultsw, align 4
store i32 %rem, ptr @mod_resultsw, align 4
%div = sdiv i32 %b, %c
store i32 %div, i32* @div_resultsw, align 4
store i32 %div, ptr @div_resultsw, align 4
ret void
; CHECK-LABEL: modulo_div_abc_sw
; CHECK: modsw {{[0-9]+}}, 3, 5
Expand All @@ -127,9 +127,9 @@ entry:
define void @modulo_div_uw(i32 zeroext %a, i32 zeroext %b) local_unnamed_addr {
entry:
%rem = urem i32 %a, %b
store i32 %rem, i32* @mod_resultuw, align 4
store i32 %rem, ptr @mod_resultuw, align 4
%div = udiv i32 %a, %b
store i32 %div, i32* @div_resultuw, align 4
store i32 %div, ptr @div_resultuw, align 4
ret void
; CHECK-LABEL: modulo_div_uw
; CHECK: moduw {{[0-9]+}}, 3, 4
Expand All @@ -153,9 +153,9 @@ entry:
define void @modulo_div_swuw(i32 signext %a, i32 signext %b) local_unnamed_addr {
entry:
%rem = srem i32 %a, %b
store i32 %rem, i32* @mod_resultsw, align 4
store i32 %rem, ptr @mod_resultsw, align 4
%div = udiv i32 %a, %b
store i32 %div, i32* @div_resultsw, align 4
store i32 %div, ptr @div_resultsw, align 4
ret void
; CHECK-LABEL: modulo_div_swuw
; CHECK: modsw {{[0-9]+}}, 3, 4
Expand All @@ -171,9 +171,9 @@ entry:
define void @modulo_div_udsd(i64 %a, i64 %b) local_unnamed_addr {
entry:
%rem = urem i64 %a, %b
store i64 %rem, i64* @mod_resultud, align 8
store i64 %rem, ptr @mod_resultud, align 8
%div = sdiv i64 %a, %b
store i64 %div, i64* @div_resultsd, align 8
store i64 %div, ptr @div_resultsd, align 8
ret void
; CHECK-LABEL: modulo_div_udsd
; CHECK: modud {{[0-9]+}}, 3, 4
Expand All @@ -189,7 +189,7 @@ entry:
define void @modulo_const32_sw(i32 signext %a) local_unnamed_addr {
entry:
%rem = srem i32 %a, 32
store i32 %rem, i32* @mod_resultsw, align 4
store i32 %rem, ptr @mod_resultsw, align 4
ret void
; CHECK-LABEL: modulo_const32_sw
; CHECK-NOT: modsw
Expand Down Expand Up @@ -247,13 +247,13 @@ entry:
define void @blocks_modulo_div_sw(i32 signext %a, i32 signext %b, i32 signext %c) local_unnamed_addr {
entry:
%div = sdiv i32 %a, %b
store i32 %div, i32* @div_resultsw, align 4
store i32 %div, ptr @div_resultsw, align 4
%cmp = icmp sgt i32 %c, 0
br i1 %cmp, label %if.then, label %if.end

if.then: ; preds = %entry
%rem = srem i32 %a, %b
store i32 %rem, i32* @mod_resultsw, align 4
store i32 %rem, ptr @mod_resultsw, align 4
br label %if.end

if.end: ; preds = %if.then, %entry
Expand Down
4 changes: 2 additions & 2 deletions llvm/test/CodeGen/PowerPC/ppc64-P9-setb.ll
Original file line number Diff line number Diff line change
Expand Up @@ -1369,7 +1369,7 @@ define i64 @setbn3(float %a, float %b) {
}

; Verify this case doesn't crash
define void @setbn4(i128 %0, i32* %sel.out) {
define void @setbn4(i128 %0, ptr %sel.out) {
; CHECK-LABEL: setbn4:
; CHECK: # %bb.0: # %entry
; CHECK-NEXT: li r6, 1
Expand Down Expand Up @@ -1408,6 +1408,6 @@ entry:
%c2 = icmp ugt i128 %0, 5192296858534827628530496329220096
%ext = zext i1 %c2 to i32
%sel = select i1 %c1, i32 -1, i32 %ext
store i32 %sel, i32* %sel.out, align 4
store i32 %sel, ptr %sel.out, align 4
ret void
}
8 changes: 4 additions & 4 deletions llvm/test/CodeGen/PowerPC/ppc64-abi-extend.ll
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ declare zeroext i32 @ret_ui()

define void @pass_arg_si() nounwind {
entry:
%0 = load i32, i32* @si, align 4
%0 = load i32, ptr @si, align 4
tail call void @arg_si(i32 signext %0) nounwind
ret void
}
Expand All @@ -25,7 +25,7 @@ entry:

define void @pass_arg_ui() nounwind {
entry:
%0 = load i32, i32* @ui, align 4
%0 = load i32, ptr @ui, align 4
tail call void @arg_ui(i32 zeroext %0) nounwind
ret void
}
Expand Down Expand Up @@ -53,7 +53,7 @@ entry:

define signext i32 @pass_ret_si() nounwind readonly {
entry:
%0 = load i32, i32* @si, align 4
%0 = load i32, ptr @si, align 4
ret i32 %0
}
; CHECK: @pass_ret_si
Expand All @@ -62,7 +62,7 @@ entry:

define zeroext i32 @pass_ret_ui() nounwind readonly {
entry:
%0 = load i32, i32* @ui, align 4
%0 = load i32, ptr @ui, align 4
ret i32 %0
}
; CHECK: @pass_ret_ui
Expand Down
2 changes: 1 addition & 1 deletion llvm/test/CodeGen/PowerPC/ppc64-acc-regalloc-bugfix.ll
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ dmblvi_entry:
%0 = tail call <512 x i1> @llvm.ppc.mma.assemble.acc(<16 x i8> zeroinitializer, <16 x i8> undef, <16 x i8> undef, <16 x i8> zeroinitializer)
%1 = tail call { <16 x i8>, <16 x i8>, <16 x i8>, <16 x i8> } @llvm.ppc.mma.disassemble.acc(<512 x i1> %0)
%2 = extractvalue { <16 x i8>, <16 x i8>, <16 x i8>, <16 x i8> } %1, 2
store <16 x i8> %2, <16 x i8>* null, align 1
store <16 x i8> %2, ptr null, align 1
unreachable
}

Expand Down
58 changes: 24 additions & 34 deletions llvm/test/CodeGen/PowerPC/ppc64-acc-regalloc.ll
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
%0 = type <{ double }>
%1 = type <{ double }>

define void @acc_regalloc(i32* %arg, [0 x %0]* %arg1, [0 x %1]* %arg2) local_unnamed_addr {
define void @acc_regalloc(ptr %arg, ptr %arg1, ptr %arg2) local_unnamed_addr {
; CHECK-LABEL: acc_regalloc:
; CHECK: # %bb.0: # %bb
; CHECK-NEXT: lwz r3, 0(r3)
Expand Down Expand Up @@ -203,38 +203,32 @@ define void @acc_regalloc(i32* %arg, [0 x %0]* %arg1, [0 x %1]* %arg2) local_unn
; TRACKLIVE-NEXT: stxv vs12, 48(0)
; TRACKLIVE-NEXT: b .LBB0_1
bb:
%i = load i32, i32* %arg, align 4
%i = load i32, ptr %arg, align 4
%i3 = sext i32 %i to i64
%i4 = shl nsw i64 %i3, 3
%i5 = bitcast [0 x %0]* %arg1 to i8*
%i6 = getelementptr i8, i8* %i5, i64 undef
%i7 = getelementptr [0 x %1], [0 x %1]* %arg2, i64 0, i64 -8
%i8 = getelementptr i8, i8* %i6, i64 undef
%i6 = getelementptr i8, ptr %arg1, i64 undef
%i7 = getelementptr [0 x %1], ptr %arg2, i64 0, i64 -8
%i8 = getelementptr i8, ptr %i6, i64 undef
br label %bb9

bb9: ; preds = %bb95, %bb
%i10 = phi i64 [ 1, %bb ], [ 0, %bb95 ]
%i11 = getelementptr %1, %1* null, i64 2
%i12 = bitcast %1* %i11 to <2 x double>*
%i13 = load <2 x double>, <2 x double>* %i12, align 1
%i11 = getelementptr %1, ptr null, i64 2
%i13 = load <2 x double>, ptr %i11, align 1
%i14 = add nuw nsw i64 %i10, 2
%i15 = getelementptr inbounds %1, %1* %i7, i64 undef
%i16 = bitcast %1* %i15 to <2 x double>*
%i17 = load <2 x double>, <2 x double>* %i16, align 1
%i18 = load <2 x double>, <2 x double>* null, align 1
%i19 = getelementptr %1, %1* %i15, i64 6
%i20 = bitcast %1* %i19 to <2 x double>*
%i21 = load <2 x double>, <2 x double>* %i20, align 1
%i22 = load i64, i64* undef, align 8
%i15 = getelementptr inbounds %1, ptr %i7, i64 undef
%i17 = load <2 x double>, ptr %i15, align 1
%i18 = load <2 x double>, ptr null, align 1
%i19 = getelementptr %1, ptr %i15, i64 6
%i21 = load <2 x double>, ptr %i19, align 1
%i22 = load i64, ptr undef, align 8
%i23 = insertelement <2 x i64> poison, i64 %i22, i32 0
%i24 = bitcast <2 x i64> %i23 to <2 x double>
%i25 = shufflevector <2 x double> %i24, <2 x double> undef, <2 x i32> zeroinitializer
%i26 = mul i64 %i14, %i4
%i27 = getelementptr i8, i8* null, i64 %i26
%i28 = getelementptr inbounds i8, i8* %i27, i64 0
%i29 = getelementptr i8, i8* %i28, i64 16
%i30 = bitcast i8* %i29 to i64*
%i31 = load i64, i64* %i30, align 8
%i27 = getelementptr i8, ptr null, i64 %i26
%i29 = getelementptr i8, ptr %i27, i64 16
%i31 = load i64, ptr %i29, align 8
%i32 = insertelement <2 x i64> poison, i64 %i31, i32 0
%i33 = bitcast <2 x i64> %i32 to <2 x double>
%i34 = shufflevector <2 x double> %i33, <2 x double> undef, <2 x i32> zeroinitializer
Expand Down Expand Up @@ -311,18 +305,14 @@ bb95: ; preds = %bb82
%i101 = extractvalue { <16 x i8>, <16 x i8>, <16 x i8>, <16 x i8> } %i100, 2
%i102 = tail call { <16 x i8>, <16 x i8>, <16 x i8>, <16 x i8> } @llvm.ppc.mma.disassemble.acc(<512 x i1> %i94)
%i103 = extractvalue { <16 x i8>, <16 x i8>, <16 x i8>, <16 x i8> } %i102, 3
%i104 = getelementptr inbounds i8, i8* %i8, i64 undef
%i105 = bitcast i8* %i104 to <16 x i8>*
store <16 x i8> %i97, <16 x i8>* %i105, align 1
%i106 = getelementptr i8, i8* %i104, i64 32
%i107 = bitcast i8* %i106 to <16 x i8>*
store <16 x i8> %i101, <16 x i8>* %i107, align 1
%i108 = getelementptr i8, i8* null, i64 16
%i109 = bitcast i8* %i108 to <16 x i8>*
store <16 x i8> %i99, <16 x i8>* %i109, align 1
%i110 = getelementptr i8, i8* null, i64 48
%i111 = bitcast i8* %i110 to <16 x i8>*
store <16 x i8> %i103, <16 x i8>* %i111, align 1
%i104 = getelementptr inbounds i8, ptr %i8, i64 undef
store <16 x i8> %i97, ptr %i104, align 1
%i106 = getelementptr i8, ptr %i104, i64 32
store <16 x i8> %i101, ptr %i106, align 1
%i108 = getelementptr i8, ptr null, i64 16
store <16 x i8> %i99, ptr %i108, align 1
%i110 = getelementptr i8, ptr null, i64 48
store <16 x i8> %i103, ptr %i110, align 1
br label %bb9
}

Expand Down
6 changes: 3 additions & 3 deletions llvm/test/CodeGen/PowerPC/ppc64-align-long-double.ll
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ target triple = "powerpc64-unknown-linux-gnu"
; value. Since the target does bitcast through memory and we no longer
; remember the address we need to do the store in a fresh local
; address.
define ppc_fp128 @test(%struct.S* byval(%struct.S) %x) nounwind {
define ppc_fp128 @test(ptr byval(%struct.S) %x) nounwind {
; CHECK-LABEL: test:
; CHECK: # %bb.0: # %entry
; CHECK-NEXT: std 5, -16(1)
Expand Down Expand Up @@ -53,8 +53,8 @@ define ppc_fp128 @test(%struct.S* byval(%struct.S) %x) nounwind {
; CHECK-P9-NEXT: std 4, 56(1)
; CHECK-P9-NEXT: blr
entry:
%b = getelementptr inbounds %struct.S, %struct.S* %x, i32 0, i32 1
%0 = load ppc_fp128, ppc_fp128* %b, align 16
%b = getelementptr inbounds %struct.S, ptr %x, i32 0, i32 1
%0 = load ppc_fp128, ptr %b, align 16
ret ppc_fp128 %0
}

Loading