define i32 @sub0(i32 %0) {
; CHECK-ARM-LABEL: sub0:
; CHECK-ARM: @ %bb.0:
-; CHECK-ARM: sub r0, r0, #23
-; CHECK-ARM: mov pc, lr
+; CHECK-ARM-NEXT: sub r0, r0, #23
+; CHECK-ARM-NEXT: mov pc, lr
;
; CHECK-THUMB2-LABEL: sub0:
; CHECK-THUMB2: @ %bb.0:
-; CHECK-THUMB2: subs r0, #23
-; CHECK-THUMB2: bx lr
+; CHECK-THUMB2-NEXT: subs r0, #23
+; CHECK-THUMB2-NEXT: bx lr
%2 = sub i32 %0, 23
ret i32 %2
}
define i32 @sub1(i32 %0) {
; CHECK-ARM-LABEL: sub1:
; CHECK-ARM: @ %bb.0:
-; CHECK-ARM: ldr r1, .LCPI1_0
-; CHECK-ARM: add r0, r0, r1
-; CHECK-ARM: mov pc, lr
-; CHECK-ARM: .p2align 2
-; CHECK-ARM: @ %bb.1:
-; CHECK-ARM: .LCPI1_0:
-; CHECK-ARM: .long 4294836225 @ 0xfffe0001
+; CHECK-ARM-NEXT: ldr r1, .LCPI1_0
+; CHECK-ARM-NEXT: add r0, r0, r1
+; CHECK-ARM-NEXT: mov pc, lr
+; CHECK-ARM-NEXT: .p2align 2
+; CHECK-ARM-NEXT: @ %bb.1:
+; CHECK-ARM-NEXT: .LCPI1_0:
+; CHECK-ARM-NEXT: .long 4294836225 @ 0xfffe0001
;
; CHECK-THUMB2-LABEL: sub1:
; CHECK-THUMB2: @ %bb.0:
-; CHECK-THUMB2 movs r1, #1
-; CHECK-THUMB2 movt r1, #65534
-; CHECK-THUMB2 add r0, r1
-; CHECK-THUMB2 bx lr
+; CHECK-THUMB2-NEXT: movs r1, #1
+; CHECK-THUMB2-NEXT: movt r1, #65534
+; CHECK-THUMB2-NEXT: add r0, r1
+; CHECK-THUMB2-NEXT: bx lr
%2 = sub i32 %0, 131071
ret i32 %2
}
define i32 @sub2(i32 %0) {
; CHECK-ARM-LABEL: sub2:
; CHECK-ARM: @ %bb.0:
-; CHECK-ARM: sub r0, r0, #35
-; CHECK-ARM: sub r0, r0, #8960
-; CHECK-ARM: mov pc, lr
+; CHECK-ARM-NEXT: sub r0, r0, #35
+; CHECK-ARM-NEXT: sub r0, r0, #8960
+; CHECK-ARM-NEXT: mov pc, lr
;
; CHECK-THUMB2-LABEL: sub2:
; CHECK-THUMB2: @ %bb.0:
-; CHECK-THUMB2: movw r1, #8995
-; CHECK-THUMB2: subs r0, r0, r1
-; CHECK-THUMB2: bx lr
+; CHECK-THUMB2-NEXT: movw r1, #8995
+; CHECK-THUMB2-NEXT: subs r0, r0, r1
+; CHECK-THUMB2-NEXT: bx lr
%2 = sub i32 %0, 8995
ret i32 %2
}
define i32 @sub3(i32 %0) {
; CHECK-ARM-LABEL: sub3:
; CHECK-ARM: @ %bb.0:
-; CHECK-ARM: ldr r1, .LCPI3_0
-; CHECK-ARM: add r0, r0, r1
-; CHECK-ARM: mov pc, lr
-; CHECK-ARM: .p2align 2
-; CHECK-ARM: @ %bb.1:
-; CHECK-ARM: .LCPI3_0:
-; CHECK-ARM: .long 4292870571 @ 0xffe001ab
+; CHECK-ARM-NEXT: ldr r1, .LCPI3_0
+; CHECK-ARM-NEXT: add r0, r0, r1
+; CHECK-ARM-NEXT: mov pc, lr
+; CHECK-ARM-NEXT: .p2align 2
+; CHECK-ARM-NEXT: @ %bb.1:
+; CHECK-ARM-NEXT: .LCPI3_0:
+; CHECK-ARM-NEXT: .long 4292870571 @ 0xffe001ab
;
; CHECK-THUMB2-LABEL: sub3:
; CHECK-THUMB2: @ %bb.0:
-; CHECK-THUMB2: movw r1, #427
-; CHECK-THUMB2: movt r1, #65504
-; CHECK-THUMB2: add r0, r1
-; CHECK-THUMB2: bx lr
+; CHECK-THUMB2-NEXT: movw r1, #427
+; CHECK-THUMB2-NEXT: movt r1, #65504
+; CHECK-THUMB2-NEXT: add r0, r1
+; CHECK-THUMB2-NEXT: bx lr
%2 = sub i32 %0, 2096725
ret i32 %2
}
define i32 @sub4(i32 %0) {
; CHECK-ARM-LABEL: sub4:
; CHECK-ARM: @ %bb.0:
-; CHECK-ARM: ldr r1, .LCPI4_0
-; CHECK-ARM: dd r0, r0, r1
-; CHECK-ARM: mov pc, lr
-; CHECK-ARM: .p2align 2
-; CHECK-ARM: @ %bb.1:
-; CHECK-ARM: .LCPI4_0:
-; CHECK-ARM: .long 4286505147 @ 0xff7ee0bb
+; CHECK-ARM-NEXT: ldr r1, .LCPI4_0
+; CHECK-ARM-NEXT: add r0, r0, r1
+; CHECK-ARM-NEXT: mov pc, lr
+; CHECK-ARM-NEXT: .p2align 2
+; CHECK-ARM-NEXT: @ %bb.1:
+; CHECK-ARM-NEXT: .LCPI4_0:
+; CHECK-ARM-NEXT: .long 4286505147 @ 0xff7ee0bb
;
; CHECK-THUMB2-LABEL: sub4:
; CHECK-THUMB2: @ %bb.0:
-; CHECK-THUMB2 movw r1, #57531
-; CHECK-THUMB2 movt r1, #65406
-; CHECK-THUMB2: add r0, r1
-; CHECK-THUMB2: bx lr
+; CHECK-THUMB2-NEXT: movw r1, #57531
+; CHECK-THUMB2-NEXT: movt r1, #65406
+; CHECK-THUMB2-NEXT: add r0, r1
+; CHECK-THUMB2-NEXT: bx lr
%2 = sub i32 %0, 8462149
ret i32 %2
}
define i32 @add0(i32 %0) {
; CHECK-ARM-LABEL: add0:
; CHECK-ARM: @ %bb.0:
-; CHECK-ARM: add r0, r0, #23
-; CHECK-ARM: mov pc, lr
+; CHECK-ARM-NEXT: add r0, r0, #23
+; CHECK-ARM-NEXT: mov pc, lr
;
; CHECK-THUMB2-LABEL: add0:
; CHECK-THUMB2: @ %bb.0:
-; CHECK-THUMB2: adds r0, #23
-; CHECK-THUMB2: bx lr
+; CHECK-THUMB2-NEXT: adds r0, #23
+; CHECK-THUMB2-NEXT: bx lr
%2 = add i32 %0, 23
ret i32 %2
}
define i32 @add1(i32 %0) {
; CHECK-ARM-LABEL: add1:
; CHECK-ARM: @ %bb.0:
-; CHECK-ARM ldr r1, .LCPI4_0
-; CHECK-ARM add r0, r0, r1
-; CHECK-ARM mov pc, lr
-; CHECK-ARM .p2align 2
-; CHECK-ARM @ %bb.1:
-; CHECK-ARM .LCPI4_0:
-; CHECK-ARM .long 131071 @ 0x1ffff
+; CHECK-ARM-NEXT: ldr r1, .LCPI6_0
+; CHECK-ARM-NEXT: add r0, r0, r1
+; CHECK-ARM-NEXT: mov pc, lr
+; CHECK-ARM-NEXT: .p2align 2
+; CHECK-ARM-NEXT: @ %bb.1:
+; CHECK-ARM-NEXT: .LCPI6_0:
+; CHECK-ARM-NEXT: .long 131071 @ 0x1ffff
;
; CHECK-THUMB2-LABEL: add1:
; CHECK-THUMB2: @ %bb.0:
-; CHECK-THUMB2: movw r1, #65535
-; CHECK-THUMB2: movt r1, #1
-; CHECK-THUMB2: add r0, r1
-; CHECK-THUMB2: bx lr
+; CHECK-THUMB2-NEXT: movw r1, #65535
+; CHECK-THUMB2-NEXT: movt r1, #1
+; CHECK-THUMB2-NEXT: add r0, r1
+; CHECK-THUMB2-NEXT: bx lr
%2 = add i32 %0, 131071
ret i32 %2
}
define i32 @add2(i32 %0) {
; CHECK-ARM-LABEL: add2:
; CHECK-ARM: @ %bb.0:
-; CHECK-ARM: add r0, r0, #8960
-; CHECK-ARM: add r0, r0, #2293760
-; CHECK-ARM: mov pc, lr
+; CHECK-ARM-NEXT: add r0, r0, #8960
+; CHECK-ARM-NEXT: add r0, r0, #2293760
+; CHECK-ARM-NEXT: mov pc, lr
;
; CHECK-THUMB2-LABEL: add2:
; CHECK-THUMB2: @ %bb.0:
-; CHECK-THUMB2: add.w r0, r0, #2293760
-; CHECK-THUMB2: add.w r0, r0, #8960
-; CHECK-THUMB2: bx lr
+; CHECK-THUMB2-NEXT: add.w r0, r0, #2293760
+; CHECK-THUMB2-NEXT: add.w r0, r0, #8960
+; CHECK-THUMB2-NEXT: bx lr
%2 = add i32 %0, 2302720
ret i32 %2
}
define i32 @add3(i32 %0) {
; CHECK-ARM-LABEL: add3:
; CHECK-ARM: @ %bb.0:
-; CHECK-ARM: ldr r1, .LCPI8_0
-; CHECK-ARM: add r0, r0, r1
-; CHECK-ARM: mov pc, lr
-; CHECK-ARM: .p2align 2
-; CHECK-ARM: @ %bb.1:
-; CHECK-ARM: .LCPI8_0:
-; CHECK-ARM: .long 2096725 @ 0x1ffe55
+; CHECK-ARM-NEXT: ldr r1, .LCPI8_0
+; CHECK-ARM-NEXT: add r0, r0, r1
+; CHECK-ARM-NEXT: mov pc, lr
+; CHECK-ARM-NEXT: .p2align 2
+; CHECK-ARM-NEXT: @ %bb.1:
+; CHECK-ARM-NEXT: .LCPI8_0:
+; CHECK-ARM-NEXT: .long 2096725 @ 0x1ffe55
;
; CHECK-THUMB2-LABEL: add3:
; CHECK-THUMB2: @ %bb.0:
-; CHECK-THUMB2: movw r1, #65109
-; CHECK-THUMB2: movt r1, #31
-; CHECK-THUMB2: add r0, r1
-; CHECK-THUMB2: bx lr
+; CHECK-THUMB2-NEXT: movw r1, #65109
+; CHECK-THUMB2-NEXT: movt r1, #31
+; CHECK-THUMB2-NEXT: add r0, r1
+; CHECK-THUMB2-NEXT: bx lr
%2 = add i32 %0, 2096725
ret i32 %2
}
define i32 @add4(i32 %0) {
; CHECK-ARM-LABEL: add4:
; CHECK-ARM: @ %bb.0:
-; CHECK-ARM: ldr r1, .LCPI9_0
-; CHECK-ARM: add r0, r0, r1
-; CHECK-ARM: mov pc, lr
-; CHECK-ARM: .p2align 2
-; CHECK-ARM: @ %bb.1:
-; CHECK-ARM: .LCPI9_0:
-; CHECK-ARM: .long 8462149 @ 0x811f45
+; CHECK-ARM-NEXT: ldr r1, .LCPI9_0
+; CHECK-ARM-NEXT: add r0, r0, r1
+; CHECK-ARM-NEXT: mov pc, lr
+; CHECK-ARM-NEXT: .p2align 2
+; CHECK-ARM-NEXT: @ %bb.1:
+; CHECK-ARM-NEXT: .LCPI9_0:
+; CHECK-ARM-NEXT: .long 8462149 @ 0x811f45
;
; CHECK-THUMB2-LABEL: add4:
; CHECK-THUMB2: @ %bb.0:
-; CHECK-THUMB2: movw r1, #8005
-; CHECK-THUMB2: movt r1, #129
-; CHECK-THUMB2: add r0, r1
-; CHECK-THUMB2: bx lr
+; CHECK-THUMB2-NEXT: movw r1, #8005
+; CHECK-THUMB2-NEXT: movt r1, #129
+; CHECK-THUMB2-NEXT: add r0, r1
+; CHECK-THUMB2-NEXT: bx lr
%2 = add i32 %0, 8462149
ret i32 %2
}
define i32 @orr0(i32 %0) {
; CHECK-ARM-LABEL: orr0:
; CHECK-ARM: @ %bb.0:
-; CHECK-ARM: orr r0, r0, #8960
-; CHECK-ARM: orr r0, r0, #2293760
-; CHECK-ARM: mov pc, lr
+; CHECK-ARM-NEXT: orr r0, r0, #8960
+; CHECK-ARM-NEXT: orr r0, r0, #2293760
+; CHECK-ARM-NEXT: mov pc, lr
;
; CHECK-THUMB2-LABEL: orr0:
; CHECK-THUMB2: @ %bb.0:
-; CHECK-THUMB2: orr r0, r0, #2293760
-; CHECK-THUMB2: orr r0, r0, #8960
-; CHECK-THUMB2: bx lr
+; CHECK-THUMB2-NEXT: orr r0, r0, #2293760
+; CHECK-THUMB2-NEXT: orr r0, r0, #8960
+; CHECK-THUMB2-NEXT: bx lr
%2 = or i32 %0, 2302720
ret i32 %2
}
define i32 @orr1(i32 %0) {
; CHECK-ARM-LABEL: orr1:
; CHECK-ARM: @ %bb.0:
-; CHECK-ARM: orr r0, r0, #23
-; CHECK-ARM: mov pc, lr
+; CHECK-ARM-NEXT: orr r0, r0, #23
+; CHECK-ARM-NEXT: mov pc, lr
;
; CHECK-THUMB2-LABEL: orr1:
; CHECK-THUMB2: @ %bb.0:
-; CHECK-THUMB2: orr r0, r0, #23
-; CHECK-THUMB2: bx lr
+; CHECK-THUMB2-NEXT: orr r0, r0, #23
+; CHECK-THUMB2-NEXT: bx lr
%2 = or i32 %0, 23
ret i32 %2
}
define i32 @orr2(i32 %0) {
; CHECK-ARM-LABEL: orr2:
; CHECK-ARM: @ %bb.0:
-; CHECK-ARM: ldr r1, .LCPI12_0
-; CHECK-ARM: orr r0, r0, r1
-; CHECK-ARM: mov pc, lr
-; CHECK-ARM: .p2align 2
-; CHECK-ARM: @ %bb.1:
-; CHECK-ARM: .LCPI12_0:
-; CHECK-ARM: .long 131071 @ 0x1ffff
+; CHECK-ARM-NEXT: ldr r1, .LCPI12_0
+; CHECK-ARM-NEXT: orr r0, r0, r1
+; CHECK-ARM-NEXT: mov pc, lr
+; CHECK-ARM-NEXT: .p2align 2
+; CHECK-ARM-NEXT: @ %bb.1:
+; CHECK-ARM-NEXT: .LCPI12_0:
+; CHECK-ARM-NEXT: .long 131071 @ 0x1ffff
;
; CHECK-THUMB2-LABEL: orr2:
; CHECK-THUMB2: @ %bb.0:
-; CHECK-THUMB2 movs r1, #1
-; CHECK-THUMB2 movt r1, #65534
-; CHECK-THUMB2 orr r0, r1
-; CHECK-THUMB2 bx lr
+; CHECK-THUMB2-NEXT: movw r1, #65535
+; CHECK-THUMB2-NEXT: movt r1, #1
+; CHECK-THUMB2-NEXT: orrs r0, r1
+; CHECK-THUMB2-NEXT: bx lr
%2 = or i32 %0, 131071
ret i32 %2
}
define i32 @eor0(i32 %0) {
; CHECK-ARM-LABEL: eor0:
; CHECK-ARM: @ %bb.0:
-; CHECK-ARM: eor r0, r0, #8960
-; CHECK-ARM: eor r0, r0, #2293760
-; CHECK-ARM: mov pc, lr
+; CHECK-ARM-NEXT: eor r0, r0, #8960
+; CHECK-ARM-NEXT: eor r0, r0, #2293760
+; CHECK-ARM-NEXT: mov pc, lr
;
; CHECK-THUMB2-LABEL: eor0:
; CHECK-THUMB2: @ %bb.0:
-; CHECK-THUMB2: eor r0, r0, #2293760
-; CHECK-THUMB2: eor r0, r0, #8960
-; CHECK-THUMB2: bx lr
+; CHECK-THUMB2-NEXT: eor r0, r0, #2293760
+; CHECK-THUMB2-NEXT: eor r0, r0, #8960
+; CHECK-THUMB2-NEXT: bx lr
%2 = xor i32 %0, 2302720
ret i32 %2
}
define i32 @eor1(i32 %0) {
; CHECK-ARM-LABEL: eor1:
; CHECK-ARM: @ %bb.0:
-; CHECK-ARM: eor r0, r0, #23
-; CHECK-ARM: mov pc, lr
+; CHECK-ARM-NEXT: eor r0, r0, #23
+; CHECK-ARM-NEXT: mov pc, lr
;
; CHECK-THUMB2-LABEL: eor1:
; CHECK-THUMB2: @ %bb.0:
-; CHECK-THUMB2: eor r0, r0, #23
-; CHECK-THUMB2: bx lr
+; CHECK-THUMB2-NEXT: eor r0, r0, #23
+; CHECK-THUMB2-NEXT: bx lr
%2 = xor i32 %0, 23
ret i32 %2
}
define i32 @eor2(i32 %0) {
; CHECK-ARM-LABEL: eor2:
; CHECK-ARM: @ %bb.0:
-; CHECK-ARM: ldr r1, .LCPI15_0
-; CHECK-ARM: eor r0, r0, r1
-; CHECK-ARM: mov pc, lr
-; CHECK-ARM: .p2align 2
-; CHECK-ARM: @ %bb.1:
-; CHECK-ARM: .LCPI15_0:
-; CHECK-ARM: .long 131071 @ 0x1ffff
+; CHECK-ARM-NEXT: ldr r1, .LCPI15_0
+; CHECK-ARM-NEXT: eor r0, r0, r1
+; CHECK-ARM-NEXT: mov pc, lr
+; CHECK-ARM-NEXT: .p2align 2
+; CHECK-ARM-NEXT: @ %bb.1:
+; CHECK-ARM-NEXT: .LCPI15_0:
+; CHECK-ARM-NEXT: .long 131071 @ 0x1ffff
;
; CHECK-THUMB2-LABEL: eor2:
; CHECK-THUMB2: @ %bb.0:
-; CHECK-THUMB2 movs r1, #1
-; CHECK-THUMB2 movt r1, #65534
-; CHECK-THUMB2 eor r0, r1
-; CHECK-THUMB2 bx lr
+; CHECK-THUMB2-NEXT: movw r1, #65535
+; CHECK-THUMB2-NEXT: movt r1, #1
+; CHECK-THUMB2-NEXT: eors r0, r1
+; CHECK-THUMB2-NEXT: bx lr
%2 = xor i32 %0, 131071
ret i32 %2
}
+; NOTE: Assertions have been autogenerated by utils/update_test_checks.py
; RUN: opt -S -mtriple=nvptx64-nvidia-cuda -infer-address-spaces %s | FileCheck %s
%struct.S = type { [5 x i32] }
@g1 = linkonce_odr addrspace(3) global %struct.S zeroinitializer, comdat, align 4
-; CHECK-LABEL: @foo(
-; CHECK: %x0 = tail call i32 @llvm.nvvm.read.ptx.sreg.tid.x() #2
-; CHECK: %idxprom.i = zext i32 %x0 to i64
-; CHECK: %arrayidx.i = getelementptr %struct.S, %struct.S* addrspacecast (%struct.S addrspace(3)* @g1 to %struct.S*), i64 0, i32 0, i64 %idxprom.i
-; CHECK: tail call void @f1(i32* %arrayidx.i, i32 undef) #0
-; CHECK: %x1 = load i32, i32 addrspace(3)* getelementptr inbounds (%struct.S, %struct.S addrspace(3)* @g1, i64 0, i32 0, i64 0), align 4
-; CHECK: %L.sroa.0.0.insert.ext.i = zext i32 %x1 to i64
-; CHECK: tail call void @f2(i64* null, i64 %L.sroa.0.0.insert.ext.i) #0
-; CHECK: ret void
define void @foo() local_unnamed_addr #0 {
+; CHECK-LABEL: @foo(
+; CHECK-NEXT: entry:
+; CHECK-NEXT: [[X0:%.*]] = tail call i32 @llvm.nvvm.read.ptx.sreg.tid.x() #[[ATTR2:[0-9]+]]
+; CHECK-NEXT: [[IDXPROM_I:%.*]] = zext i32 [[X0]] to i64
+; CHECK-NEXT: [[ARRAYIDX_I:%.*]] = getelementptr [[STRUCT_S:%.*]], %struct.S* addrspacecast ([[STRUCT_S]] addrspace(3)* @g1 to %struct.S*), i64 0, i32 0, i64 [[IDXPROM_I]]
+; CHECK-NEXT: tail call void @f1(i32* [[ARRAYIDX_I]], i32 undef) #[[ATTR0:[0-9]+]]
+; CHECK-NEXT: [[X1:%.*]] = load i32, i32 addrspace(3)* getelementptr inbounds ([[STRUCT_S]], [[STRUCT_S]] addrspace(3)* @g1, i64 0, i32 0, i64 0), align 4
+; CHECK-NEXT: [[L_SROA_0_0_INSERT_EXT_I:%.*]] = zext i32 [[X1]] to i64
+; CHECK-NEXT: tail call void @f2(i64* null, i64 [[L_SROA_0_0_INSERT_EXT_I]]) #[[ATTR0]]
+; CHECK-NEXT: ret void
+;
entry:
%x0 = tail call i32 @llvm.nvvm.read.ptx.sreg.tid.x() #2
%idxprom.i = zext i32 %x0 to i64
; https://bugs.llvm.org/show_bug.cgi?id=51099
@g2 = internal addrspace(3) global [128 x i8] undef, align 1
-; CHECK-LABEL: @complex_ce(
-; CHECK: %0 = load float, float addrspace(3)* bitcast
-; CHECK-SAME: i8 addrspace(3)* getelementptr (i8,
-; CHECK-SAME: i8 addrspace(3)* getelementptr inbounds ([128 x i8], [128 x i8] addrspace(3)* @g2, i64 0, i64 0),
-; CHECK-SAME: i64 sub (
-; CHECK-SAME i64 ptrtoint (
-; CHECK-SAME i8 addrspace(3)* getelementptr inbounds ([128 x i8], [128 x i8] addrspace(3)* @g2, i64 0, i64 123) to i64),
-; CHECK-SAME: i64 ptrtoint (
-; CHECK-SAME: i8 addrspace(3)* getelementptr inbounds ([128 x i8], [128 x i8] addrspace(3)* @g2, i64 2, i64 0) to i64)))
-; CHECK-SAME: to float addrspace(3)*)
-; Function Attrs: norecurse nounwind
define float @complex_ce(i8* nocapture readnone %a, i8* nocapture readnone %b, i8* nocapture readnone %c) local_unnamed_addr #0 {
+; CHECK-LABEL: @complex_ce(
+; CHECK-NEXT: entry:
+; CHECK-NEXT: [[TMP0:%.*]] = load float, float addrspace(3)* bitcast (i8 addrspace(3)* getelementptr (i8, i8 addrspace(3)* getelementptr inbounds ([128 x i8], [128 x i8] addrspace(3)* @g2, i64 0, i64 0), i64 sub (i64 ptrtoint (i8 addrspace(3)* getelementptr inbounds ([128 x i8], [128 x i8] addrspace(3)* @g2, i64 0, i64 123) to i64), i64 ptrtoint (i8 addrspace(3)* getelementptr inbounds ([128 x i8], [128 x i8] addrspace(3)* @g2, i64 2, i64 0) to i64))) to float addrspace(3)*), align 4
+; CHECK-NEXT: ret float [[TMP0]]
+;
entry:
%0 = load float, float* bitcast (
i8* getelementptr (