brintos

brintos / llvm-project-archived public Read only

0
0
Text · 1.2 KiB · fae40dc Raw
36 lines · plain
1// RUN: mlir-opt -int-range-optimizations %s | FileCheck %s2gpu.module @module{3    gpu.func @kernel_1() kernel {4        %tidx = nvvm.read.ptx.sreg.tid.x range <i32, 0, 32> : i325        %tidy = nvvm.read.ptx.sreg.tid.y range <i32, 0, 128> : i326        %tidz = nvvm.read.ptx.sreg.tid.z range <i32, 0, 4> : i327        %c64 = arith.constant 64 : i328        9        %1 = arith.cmpi sgt, %tidx, %c64 : i3210        scf.if %1 {11            gpu.printf "threadidx"12        }13        %2 = arith.cmpi sgt, %tidy, %c64 : i3214        scf.if %2 {15            gpu.printf "threadidy"16        }17        %3 = arith.cmpi sgt, %tidz, %c64 : i3218        scf.if %3 {19            gpu.printf "threadidz"20        }21        gpu.return22    }23}24 25// CHECK-LABEL: gpu.func @kernel_126// CHECK: %[[false:.+]] = arith.constant false27// CHECK: %[[c64_i32:.+]] = arith.constant 64 : i3228// CHECK: %[[S0:.+]] = nvvm.read.ptx.sreg.tid.y range <i32, 0, 128> : i3229// CHECK: scf.if %[[false]] {30// CHECK: gpu.printf "threadidx"31// CHECK: %[[S1:.+]] = arith.cmpi sgt, %[[S0]], %[[c64_i32]] : i3232// CHECK: scf.if %[[S1]] {33// CHECK: gpu.printf "threadidy"34// CHECK: scf.if %[[false]] {35// CHECK: gpu.printf "threadidz"36