You've already forked linux-packaging-mono
Imported Upstream version 5.18.0.167
Former-commit-id: 289509151e0fee68a1b591a20c9f109c3c789d3a
This commit is contained in:
parent
e19d552987
commit
b084638f15
@ -1,35 +0,0 @@
|
||||
; RUN: opt -S -codegenprepare < %s | FileCheck %s
|
||||
|
||||
target datalayout = "e-i64:64-v16:16-v32:32-n16:32:64"
|
||||
target triple = "nvptx64-nvidia-cuda"
|
||||
|
||||
; When we bypass slow div with a constant numerator which fits into the bypass
|
||||
; width, we still emit the bypass code, but we don't 'or' the numerator with
|
||||
; the denominator.
|
||||
; CHECK-LABEL: @small_constant_numer
|
||||
define i64 @small_constant_numer(i64 %a) {
|
||||
; CHECK: [[AND:%[0-9]+]] = and i64 %a, -4294967296
|
||||
; CHECK: icmp eq i64 [[AND]], 0
|
||||
|
||||
; CHECK: [[TRUNC:%[0-9]+]] = trunc i64 %a to i32
|
||||
; CHECK: udiv i32 -1, [[TRUNC]]
|
||||
%d = sdiv i64 4294967295, %a ; 0xffff'ffff
|
||||
ret i64 %d
|
||||
}
|
||||
|
||||
; When we try to bypass slow div with a constant numerator which *doesn't* fit
|
||||
; into the bypass width, leave it as a plain 64-bit div with no bypass.
|
||||
; CHECK-LABEL: @large_constant_numer
|
||||
define i64 @large_constant_numer(i64 %a) {
|
||||
; CHECK-NOT: udiv i32
|
||||
%d = sdiv i64 4294967296, %a ; 0x1'0000'0000
|
||||
ret i64 %d
|
||||
}
|
||||
|
||||
; For good measure, try a value larger than 2^32.
|
||||
; CHECK-LABEL: @larger_constant_numer
|
||||
define i64 @larger_constant_numer(i64 %a) {
|
||||
; CHECK-NOT: udiv i32
|
||||
%d = sdiv i64 5000000000, %a
|
||||
ret i64 %d
|
||||
}
|
@ -1,16 +0,0 @@
|
||||
; RUN: opt -S -codegenprepare < %s | FileCheck %s
|
||||
|
||||
target datalayout = "e-i64:64-v16:16-v32:32-n16:32:64"
|
||||
target triple = "nvptx64-nvidia-cuda"
|
||||
|
||||
; Check that the smaller-width division that the BypassSlowDivision pass
|
||||
; creates is not marked as "exact" (that is, it doesn't claim that the
|
||||
; numerator is a multiple of the denominator).
|
||||
;
|
||||
; CHECK-LABEL: @test
|
||||
define void @test(i64 %a, i64 %b, i64* %retptr) {
|
||||
; CHECK: udiv i32
|
||||
%d = sdiv i64 %a, %b
|
||||
store i64 %d, i64* %retptr
|
||||
ret void
|
||||
}
|
@ -1,216 +0,0 @@
|
||||
; NOTE: Assertions have been autogenerated by utils/update_test_checks.py
|
||||
; RUN: opt -S -codegenprepare < %s | FileCheck %s
|
||||
|
||||
target datalayout = "e-i64:64-v16:16-v32:32-n16:32:64"
|
||||
target triple = "nvptx64-nvidia-cuda"
|
||||
|
||||
; No bypassing should be done in apparently unsuitable cases.
|
||||
define void @Test_no_bypassing(i32 %a, i64 %b, i64* %retptr) {
|
||||
; CHECK-LABEL: @Test_no_bypassing(
|
||||
; CHECK-NEXT: [[A_1:%.*]] = zext i32 [[A:%.*]] to i64
|
||||
; CHECK-NEXT: [[A_2:%.*]] = sub i64 -1, [[A_1]]
|
||||
; CHECK-NEXT: [[RES:%.*]] = srem i64 [[A_2]], [[B:%.*]]
|
||||
; CHECK-NEXT: store i64 [[RES]], i64* [[RETPTR:%.*]]
|
||||
; CHECK-NEXT: ret void
|
||||
;
|
||||
%a.1 = zext i32 %a to i64
|
||||
; %a.2 is always negative so the division cannot be bypassed.
|
||||
%a.2 = sub i64 -1, %a.1
|
||||
%res = srem i64 %a.2, %b
|
||||
store i64 %res, i64* %retptr
|
||||
ret void
|
||||
}
|
||||
|
||||
; No OR instruction is needed if one of the operands (divisor) is known
|
||||
; to fit into 32 bits.
|
||||
define void @Test_check_one_operand(i64 %a, i32 %b, i64* %retptr) {
|
||||
; CHECK-LABEL: @Test_check_one_operand(
|
||||
; CHECK-NEXT: [[B_1:%.*]] = zext i32 [[B:%.*]] to i64
|
||||
; CHECK-NEXT: [[TMP1:%.*]] = and i64 [[A:%.*]], -4294967296
|
||||
; CHECK-NEXT: [[TMP2:%.*]] = icmp eq i64 [[TMP1]], 0
|
||||
; CHECK-NEXT: br i1 [[TMP2]], label [[TMP3:%.*]], label [[TMP8:%.*]]
|
||||
; CHECK: [[TMP4:%.*]] = trunc i64 [[B_1]] to i32
|
||||
; CHECK-NEXT: [[TMP5:%.*]] = trunc i64 [[A]] to i32
|
||||
; CHECK-NEXT: [[TMP6:%.*]] = udiv i32 [[TMP5]], [[TMP4]]
|
||||
; CHECK-NEXT: [[TMP7:%.*]] = zext i32 [[TMP6]] to i64
|
||||
; CHECK-NEXT: br label [[TMP10:%.*]]
|
||||
; CHECK: [[TMP9:%.*]] = sdiv i64 [[A]], [[B_1]]
|
||||
; CHECK-NEXT: br label [[TMP10]]
|
||||
; CHECK: [[TMP11:%.*]] = phi i64 [ [[TMP7]], [[TMP3]] ], [ [[TMP9]], [[TMP8]] ]
|
||||
; CHECK-NEXT: store i64 [[TMP11]], i64* [[RETPTR:%.*]]
|
||||
; CHECK-NEXT: ret void
|
||||
;
|
||||
%b.1 = zext i32 %b to i64
|
||||
%res = sdiv i64 %a, %b.1
|
||||
store i64 %res, i64* %retptr
|
||||
ret void
|
||||
}
|
||||
|
||||
; If both operands are known to fit into 32 bits, then replace the division
|
||||
; in-place without CFG modification.
|
||||
define void @Test_check_none(i64 %a, i32 %b, i64* %retptr) {
|
||||
; CHECK-LABEL: @Test_check_none(
|
||||
; CHECK-NEXT: [[A_1:%.*]] = and i64 [[A:%.*]], 4294967295
|
||||
; CHECK-NEXT: [[B_1:%.*]] = zext i32 [[B:%.*]] to i64
|
||||
; CHECK-NEXT: [[TMP1:%.*]] = trunc i64 [[A_1]] to i32
|
||||
; CHECK-NEXT: [[TMP2:%.*]] = trunc i64 [[B_1]] to i32
|
||||
; CHECK-NEXT: [[TMP3:%.*]] = udiv i32 [[TMP1]], [[TMP2]]
|
||||
; CHECK-NEXT: [[TMP4:%.*]] = zext i32 [[TMP3]] to i64
|
||||
; CHECK-NEXT: store i64 [[TMP4]], i64* [[RETPTR:%.*]]
|
||||
; CHECK-NEXT: ret void
|
||||
;
|
||||
%a.1 = and i64 %a, 4294967295
|
||||
%b.1 = zext i32 %b to i64
|
||||
%res = udiv i64 %a.1, %b.1
|
||||
store i64 %res, i64* %retptr
|
||||
ret void
|
||||
}
|
||||
|
||||
; In case of unsigned long division with a short dividend,
|
||||
; the long division is not needed any more.
|
||||
define void @Test_special_case(i32 %a, i64 %b, i64* %retptr) {
|
||||
; CHECK-LABEL: @Test_special_case(
|
||||
; CHECK-NEXT: [[A_1:%.*]] = zext i32 [[A:%.*]] to i64
|
||||
; CHECK-NEXT: [[TMP1:%.*]] = icmp uge i64 [[A_1]], [[B:%.*]]
|
||||
; CHECK-NEXT: br i1 [[TMP1]], label [[TMP2:%.*]], label [[TMP9:%.*]]
|
||||
; CHECK: [[TMP3:%.*]] = trunc i64 [[B]] to i32
|
||||
; CHECK-NEXT: [[TMP4:%.*]] = trunc i64 [[A_1]] to i32
|
||||
; CHECK-NEXT: [[TMP5:%.*]] = udiv i32 [[TMP4]], [[TMP3]]
|
||||
; CHECK-NEXT: [[TMP6:%.*]] = urem i32 [[TMP4]], [[TMP3]]
|
||||
; CHECK-NEXT: [[TMP7:%.*]] = zext i32 [[TMP5]] to i64
|
||||
; CHECK-NEXT: [[TMP8:%.*]] = zext i32 [[TMP6]] to i64
|
||||
; CHECK-NEXT: br label [[TMP9]]
|
||||
; CHECK: [[TMP10:%.*]] = phi i64 [ [[TMP7]], [[TMP2]] ], [ 0, [[TMP0:%.*]] ]
|
||||
; CHECK-NEXT: [[TMP11:%.*]] = phi i64 [ [[TMP8]], [[TMP2]] ], [ [[A_1]], [[TMP0]] ]
|
||||
; CHECK-NEXT: [[RES:%.*]] = add i64 [[TMP10]], [[TMP11]]
|
||||
; CHECK-NEXT: store i64 [[RES]], i64* [[RETPTR:%.*]]
|
||||
; CHECK-NEXT: ret void
|
||||
;
|
||||
%a.1 = zext i32 %a to i64
|
||||
%div = udiv i64 %a.1, %b
|
||||
%rem = urem i64 %a.1, %b
|
||||
%res = add i64 %div, %rem
|
||||
store i64 %res, i64* %retptr
|
||||
ret void
|
||||
}
|
||||
|
||||
|
||||
; Do not bypass a division if one of the operands looks like a hash value.
|
||||
define void @Test_dont_bypass_xor(i64 %a, i64 %b, i64 %l, i64* %retptr) {
|
||||
; CHECK-LABEL: @Test_dont_bypass_xor(
|
||||
; CHECK-NEXT: [[C:%.*]] = xor i64 [[A:%.*]], [[B:%.*]]
|
||||
; CHECK-NEXT: [[RES:%.*]] = udiv i64 [[C]], [[L:%.*]]
|
||||
; CHECK-NEXT: store i64 [[RES]], i64* [[RETPTR:%.*]]
|
||||
; CHECK-NEXT: ret void
|
||||
;
|
||||
%c = xor i64 %a, %b
|
||||
%res = udiv i64 %c, %l
|
||||
store i64 %res, i64* %retptr
|
||||
ret void
|
||||
}
|
||||
|
||||
define void @Test_dont_bypass_phi_xor(i64 %a, i64 %b, i64 %l, i64* %retptr) {
|
||||
; CHECK-LABEL: @Test_dont_bypass_phi_xor(
|
||||
; CHECK-NEXT: entry:
|
||||
; CHECK-NEXT: [[CMP:%.*]] = icmp eq i64 [[B:%.*]], 0
|
||||
; CHECK-NEXT: br i1 [[CMP]], label [[MERGE:%.*]], label [[XORPATH:%.*]]
|
||||
; CHECK: xorpath:
|
||||
; CHECK-NEXT: [[C:%.*]] = xor i64 [[A:%.*]], [[B]]
|
||||
; CHECK-NEXT: br label [[MERGE]]
|
||||
; CHECK: merge:
|
||||
; CHECK-NEXT: [[E:%.*]] = phi i64 [ undef, [[ENTRY:%.*]] ], [ [[C]], [[XORPATH]] ]
|
||||
; CHECK-NEXT: [[RES:%.*]] = sdiv i64 [[E]], [[L:%.*]]
|
||||
; CHECK-NEXT: store i64 [[RES]], i64* [[RETPTR:%.*]]
|
||||
; CHECK-NEXT: ret void
|
||||
;
|
||||
entry:
|
||||
%cmp = icmp eq i64 %b, 0
|
||||
br i1 %cmp, label %merge, label %xorpath
|
||||
|
||||
xorpath:
|
||||
%c = xor i64 %a, %b
|
||||
br label %merge
|
||||
|
||||
merge:
|
||||
%e = phi i64 [ undef, %entry ], [ %c, %xorpath ]
|
||||
%res = sdiv i64 %e, %l
|
||||
store i64 %res, i64* %retptr
|
||||
ret void
|
||||
}
|
||||
|
||||
define void @Test_dont_bypass_mul_long_const(i64 %a, i64 %l, i64* %retptr) {
|
||||
; CHECK-LABEL: @Test_dont_bypass_mul_long_const(
|
||||
; CHECK-NEXT: [[C:%.*]] = mul i64 [[A:%.*]], 5229553307
|
||||
; CHECK-NEXT: [[RES:%.*]] = urem i64 [[C]], [[L:%.*]]
|
||||
; CHECK-NEXT: store i64 [[RES]], i64* [[RETPTR:%.*]]
|
||||
; CHECK-NEXT: ret void
|
||||
;
|
||||
%c = mul i64 %a, 5229553307 ; the constant doesn't fit 32 bits
|
||||
%res = urem i64 %c, %l
|
||||
store i64 %res, i64* %retptr
|
||||
ret void
|
||||
}
|
||||
|
||||
define void @Test_bypass_phi_mul_const(i64 %a, i64 %b, i64* %retptr) {
|
||||
; CHECK-LABEL: @Test_bypass_phi_mul_const(
|
||||
; CHECK-NEXT: entry:
|
||||
; CHECK-NEXT: [[A_MUL:%.*]] = mul nsw i64 [[A:%.*]], 34806414968801
|
||||
; CHECK-NEXT: [[P:%.*]] = icmp sgt i64 [[A]], [[B:%.*]]
|
||||
; CHECK-NEXT: br i1 [[P]], label [[BRANCH:%.*]], label [[MERGE:%.*]]
|
||||
; CHECK: branch:
|
||||
; CHECK-NEXT: br label [[MERGE]]
|
||||
; CHECK: merge:
|
||||
; CHECK-NEXT: [[LHS:%.*]] = phi i64 [ 42, [[BRANCH]] ], [ [[A_MUL]], [[ENTRY:%.*]] ]
|
||||
; CHECK-NEXT: [[TMP0:%.*]] = or i64 [[LHS]], [[B]]
|
||||
; CHECK-NEXT: [[TMP1:%.*]] = and i64 [[TMP0]], -4294967296
|
||||
; CHECK-NEXT: [[TMP2:%.*]] = icmp eq i64 [[TMP1]], 0
|
||||
; CHECK-NEXT: br i1 [[TMP2]], label [[TMP3:%.*]], label [[TMP8:%.*]]
|
||||
; CHECK: [[TMP4:%.*]] = trunc i64 [[B]] to i32
|
||||
; CHECK-NEXT: [[TMP5:%.*]] = trunc i64 [[LHS]] to i32
|
||||
; CHECK-NEXT: [[TMP6:%.*]] = udiv i32 [[TMP5]], [[TMP4]]
|
||||
; CHECK-NEXT: [[TMP7:%.*]] = zext i32 [[TMP6]] to i64
|
||||
; CHECK-NEXT: br label [[TMP10:%.*]]
|
||||
; CHECK: [[TMP9:%.*]] = sdiv i64 [[LHS]], [[B]]
|
||||
; CHECK-NEXT: br label [[TMP10]]
|
||||
; CHECK: [[TMP11:%.*]] = phi i64 [ [[TMP7]], [[TMP3]] ], [ [[TMP9]], [[TMP8]] ]
|
||||
; CHECK-NEXT: store i64 [[TMP11]], i64* [[RETPTR:%.*]]
|
||||
; CHECK-NEXT: ret void
|
||||
;
|
||||
entry:
|
||||
%a.mul = mul nsw i64 %a, 34806414968801
|
||||
%p = icmp sgt i64 %a, %b
|
||||
br i1 %p, label %branch, label %merge
|
||||
|
||||
branch:
|
||||
br label %merge
|
||||
|
||||
merge:
|
||||
%lhs = phi i64 [ 42, %branch ], [ %a.mul, %entry ]
|
||||
%res = sdiv i64 %lhs, %b
|
||||
store i64 %res, i64* %retptr
|
||||
ret void
|
||||
}
|
||||
|
||||
define void @Test_bypass_mul_short_const(i64 %a, i64 %l, i64* %retptr) {
|
||||
; CHECK-LABEL: @Test_bypass_mul_short_const(
|
||||
; CHECK-NEXT: [[C:%.*]] = mul i64 [[A:%.*]], -42
|
||||
; CHECK-NEXT: [[TMP1:%.*]] = or i64 [[C]], [[L:%.*]]
|
||||
; CHECK-NEXT: [[TMP2:%.*]] = and i64 [[TMP1]], -4294967296
|
||||
; CHECK-NEXT: [[TMP3:%.*]] = icmp eq i64 [[TMP2]], 0
|
||||
; CHECK-NEXT: br i1 [[TMP3]], label [[TMP4:%.*]], label [[TMP9:%.*]]
|
||||
; CHECK: [[TMP5:%.*]] = trunc i64 [[L]] to i32
|
||||
; CHECK-NEXT: [[TMP6:%.*]] = trunc i64 [[C]] to i32
|
||||
; CHECK-NEXT: [[TMP7:%.*]] = urem i32 [[TMP6]], [[TMP5]]
|
||||
; CHECK-NEXT: [[TMP8:%.*]] = zext i32 [[TMP7]] to i64
|
||||
; CHECK-NEXT: br label [[TMP11:%.*]]
|
||||
; CHECK: [[TMP10:%.*]] = urem i64 [[C]], [[L]]
|
||||
; CHECK-NEXT: br label [[TMP11]]
|
||||
; CHECK: [[TMP12:%.*]] = phi i64 [ [[TMP8]], [[TMP4]] ], [ [[TMP10]], [[TMP9]] ]
|
||||
; CHECK-NEXT: store i64 [[TMP12]], i64* [[RETPTR:%.*]]
|
||||
; CHECK-NEXT: ret void
|
||||
;
|
||||
%c = mul i64 %a, -42
|
||||
%res = urem i64 %c, %l
|
||||
store i64 %res, i64* %retptr
|
||||
ret void
|
||||
}
|
@ -1,106 +0,0 @@
|
||||
; RUN: opt -S -codegenprepare < %s | FileCheck %s
|
||||
|
||||
target datalayout = "e-i64:64-v16:16-v32:32-n16:32:64"
|
||||
target triple = "nvptx64-nvidia-cuda"
|
||||
|
||||
; We only use the div instruction -- the rem should be DCE'ed.
|
||||
; CHECK-LABEL: @div_only
|
||||
define void @div_only(i64 %a, i64 %b, i64* %retptr) {
|
||||
; CHECK: udiv i32
|
||||
; CHECK-NOT: urem
|
||||
; CHECK: sdiv i64
|
||||
; CHECK-NOT: rem
|
||||
%d = sdiv i64 %a, %b
|
||||
store i64 %d, i64* %retptr
|
||||
ret void
|
||||
}
|
||||
|
||||
; We only use the rem instruction -- the div should be DCE'ed.
|
||||
; CHECK-LABEL: @rem_only
|
||||
define void @rem_only(i64 %a, i64 %b, i64* %retptr) {
|
||||
; CHECK-NOT: div
|
||||
; CHECK: urem i32
|
||||
; CHECK-NOT: div
|
||||
; CHECK: rem i64
|
||||
; CHECK-NOT: div
|
||||
%d = srem i64 %a, %b
|
||||
store i64 %d, i64* %retptr
|
||||
ret void
|
||||
}
|
||||
|
||||
; CHECK-LABEL: @udiv_by_constant(
|
||||
define i64 @udiv_by_constant(i32 %a) {
|
||||
; CHECK-NEXT: [[A_ZEXT:%.*]] = zext i32 [[A:%.*]] to i64
|
||||
; CHECK-NEXT: [[TMP1:%.*]] = trunc i64 [[A_ZEXT]] to i32
|
||||
; CHECK-NEXT: [[TMP2:%.*]] = udiv i32 [[TMP1]], 50
|
||||
; CHECK-NEXT: [[TMP3:%.*]] = zext i32 [[TMP2]] to i64
|
||||
; CHECK-NEXT: ret i64 [[TMP3]]
|
||||
|
||||
%a.zext = zext i32 %a to i64
|
||||
%wide.div = udiv i64 %a.zext, 50
|
||||
ret i64 %wide.div
|
||||
}
|
||||
|
||||
; CHECK-LABEL: @urem_by_constant(
|
||||
define i64 @urem_by_constant(i32 %a) {
|
||||
; CHECK-NEXT: [[A_ZEXT:%.*]] = zext i32 [[A:%.*]] to i64
|
||||
; CHECK-NEXT: [[TMP1:%.*]] = trunc i64 [[A_ZEXT]] to i32
|
||||
; CHECK-NEXT: [[TMP2:%.*]] = urem i32 [[TMP1]], 50
|
||||
; CHECK-NEXT: [[TMP3:%.*]] = zext i32 [[TMP2]] to i64
|
||||
; CHECK-NEXT: ret i64 [[TMP3]]
|
||||
|
||||
%a.zext = zext i32 %a to i64
|
||||
%wide.div = urem i64 %a.zext, 50
|
||||
ret i64 %wide.div
|
||||
}
|
||||
|
||||
; Negative test: instead of emitting a runtime check on %a, we prefer to let the
|
||||
; DAGCombiner transform this division by constant into a multiplication (with a
|
||||
; "magic constant").
|
||||
;
|
||||
; CHECK-LABEL: @udiv_by_constant_negative_0(
|
||||
define i64 @udiv_by_constant_negative_0(i64 %a) {
|
||||
; CHECK-NEXT: [[WIDE_DIV:%.*]] = udiv i64 [[A:%.*]], 50
|
||||
; CHECK-NEXT: ret i64 [[WIDE_DIV]]
|
||||
|
||||
%wide.div = udiv i64 %a, 50
|
||||
ret i64 %wide.div
|
||||
}
|
||||
|
||||
; Negative test: while we know the dividend is short, the divisor isn't. This
|
||||
; test is here for completeness, but instcombine will optimize this to return 0.
|
||||
;
|
||||
; CHECK-LABEL: @udiv_by_constant_negative_1(
|
||||
define i64 @udiv_by_constant_negative_1(i32 %a) {
|
||||
; CHECK-NEXT: [[A_ZEXT:%.*]] = zext i32 [[A:%.*]] to i64
|
||||
; CHECK-NEXT: [[WIDE_DIV:%.*]] = udiv i64 [[A_ZEXT]], 8589934592
|
||||
; CHECK-NEXT: ret i64 [[WIDE_DIV]]
|
||||
|
||||
%a.zext = zext i32 %a to i64
|
||||
%wide.div = udiv i64 %a.zext, 8589934592 ;; == 1 << 33
|
||||
ret i64 %wide.div
|
||||
}
|
||||
|
||||
; URem version of udiv_by_constant_negative_0
|
||||
;
|
||||
; CHECK-LABEL: @urem_by_constant_negative_0(
|
||||
define i64 @urem_by_constant_negative_0(i64 %a) {
|
||||
; CHECK-NEXT: [[WIDE_DIV:%.*]] = urem i64 [[A:%.*]], 50
|
||||
; CHECK-NEXT: ret i64 [[WIDE_DIV]]
|
||||
|
||||
%wide.div = urem i64 %a, 50
|
||||
ret i64 %wide.div
|
||||
}
|
||||
|
||||
; URem version of udiv_by_constant_negative_1
|
||||
;
|
||||
; CHECK-LABEL: @urem_by_constant_negative_1(
|
||||
define i64 @urem_by_constant_negative_1(i32 %a) {
|
||||
; CHECK-NEXT: [[A_ZEXT:%.*]] = zext i32 [[A:%.*]] to i64
|
||||
; CHECK-NEXT: [[WIDE_DIV:%.*]] = urem i64 [[A_ZEXT]], 8589934592
|
||||
; CHECK-NEXT: ret i64 [[WIDE_DIV]]
|
||||
|
||||
%a.zext = zext i32 %a to i64
|
||||
%wide.div = urem i64 %a.zext, 8589934592 ;; == 1 << 33
|
||||
ret i64 %wide.div
|
||||
}
|
@ -1,21 +0,0 @@
|
||||
; RUN: opt -S -codegenprepare < %s | FileCheck %s
|
||||
|
||||
target datalayout = "e-i64:64-v16:16-v32:32-n16:32:64"
|
||||
target triple = "nvptx64-nvidia-cuda"
|
||||
|
||||
; CHECK-LABEL: @test
|
||||
define i64 @test(i1 %pred, i64* %ptr) {
|
||||
; CHECK: addrspacecast
|
||||
%ptr_as1 = addrspacecast i64* %ptr to i64 addrspace(1)*
|
||||
br i1 %pred, label %l1, label %l2
|
||||
l1:
|
||||
; CHECK-LABEL: l1:
|
||||
; CHECK-NOT: addrspacecast
|
||||
%v1 = load i64, i64* %ptr
|
||||
ret i64 %v1
|
||||
l2:
|
||||
; CHECK-LABEL: l2:
|
||||
; CHECK-NOT: addrspacecast
|
||||
%v2 = load i64, i64 addrspace(1)* %ptr_as1
|
||||
ret i64 %v2
|
||||
}
|
@ -1,2 +0,0 @@
|
||||
if not 'NVPTX' in config.root.targets:
|
||||
config.unsupported = True
|
Reference in New Issue
Block a user