[MLIR][SPIRV] Rename `spv.undef` to `spv.Undef`.

To unify the naming scheme across all ops in the SPIR-V dialect, we are
moving from spv.camelCase to spv.CamelCase everywhere. For ops that
don't have a SPIR-V spec counterpart, we use spv.mlir.snake_case.

Reviewed By: antiagainst

Differential Revision: https://reviews.llvm.org/D98016
This commit is contained in:
KareemErgawy-TomTom 2021-03-05 15:45:09 -05:00 committed by Lei Zhang
parent f175ba4a54
commit d48ceb45e3
6 changed files with 29 additions and 29 deletions

View File

@ -18,7 +18,7 @@ include "mlir/Dialect/SPIRV/IR/SPIRVBase.td"
// -----
def SPV_UndefOp : SPV_Op<"undef", []> {
def SPV_UndefOp : SPV_Op<"Undef", []> {
let summary = "Make an intermediate object whose value is undefined.";
let description = [{
@ -31,14 +31,14 @@ def SPV_UndefOp : SPV_Op<"undef", []> {
<!-- End of AutoGen section -->
```
undef-op ::= `spv.undef` `:` spirv-type
undef-op ::= `spv.Undef` `:` spirv-type
```
#### Example:
```mlir
%0 = spv.undef : f32
%1 = spv.undef : !spv.struct<!spv.array<4 x vector<4xi32>>>
%0 = spv.Undef : f32
%1 = spv.Undef : !spv.struct<!spv.array<4 x vector<4xi32>>>
```
}];

View File

@ -622,7 +622,7 @@ def SPV_SpecConstantCompositeOp : SPV_Op<"SpecConstantComposite", [
- A symbol referring of another spec constant.
- The SSA ID of a non-specialization constant (i.e. defined through
`spv.SpecConstant`).
- The SSA ID of a `spv.undef`.
- The SSA ID of a `spv.Undef`.
```
spv-spec-constant-composite-op ::= `spv.SpecConstantComposite` symbol-ref-id ` (`

View File

@ -113,13 +113,13 @@ spv.module Logical OpenCL {
// CHECK-LABEL: @undef_scalar
spv.func @undef_scalar() "None" {
// CHECK: llvm.mlir.undef : f32
%0 = spv.undef : f32
%0 = spv.Undef : f32
spv.Return
}
// CHECK-LABEL: @undef_vector
spv.func @undef_vector() "None" {
// CHECK: llvm.mlir.undef : vector<2xi32>
%0 = spv.undef : vector<2xi32>
%0 = spv.Undef : vector<2xi32>
spv.Return
}

View File

@ -1,14 +1,14 @@
// RUN: mlir-opt -split-input-file -verify-diagnostics %s | FileCheck %s
//===----------------------------------------------------------------------===//
// spv.undef
// spv.Undef
//===----------------------------------------------------------------------===//
func @undef() -> () {
// CHECK: %{{.*}} = spv.undef : f32
%0 = spv.undef : f32
// CHECK: %{{.*}} = spv.undef : vector<4xf32>
%1 = spv.undef : vector<4xf32>
// CHECK: %{{.*}} = spv.Undef : f32
%0 = spv.Undef : f32
// CHECK: %{{.*}} = spv.Undef : vector<4xf32>
%1 = spv.Undef : vector<4xf32>
spv.Return
}
@ -16,7 +16,7 @@ func @undef() -> () {
func @undef() -> () {
// expected-error @+2{{expected non-function type}}
%0 = spv.undef :
%0 = spv.Undef :
spv.Return
}
@ -24,6 +24,6 @@ func @undef() -> () {
func @undef() -> () {
// expected-error @+2{{expected ':'}}
%0 = spv.undef
%0 = spv.Undef
spv.Return
}

View File

@ -2,26 +2,26 @@
spv.module Logical GLSL450 {
spv.func @rewrite(%value0 : f32, %value1 : f32, %value2 : f32, %value3 : i32, %value4: !spv.array<3xf32>) -> vector<3xf32> "None" {
%0 = spv.undef : vector<3xf32>
%0 = spv.Undef : vector<3xf32>
// CHECK: spv.CompositeConstruct {{%.*}}, {{%.*}}, {{%.*}} : vector<3xf32>
%1 = spv.CompositeInsert %value0, %0[0 : i32] : f32 into vector<3xf32>
%2 = spv.CompositeInsert %value1, %1[1 : i32] : f32 into vector<3xf32>
%3 = spv.CompositeInsert %value2, %2[2 : i32] : f32 into vector<3xf32>
%4 = spv.undef : !spv.array<4xf32>
%4 = spv.Undef : !spv.array<4xf32>
// CHECK: spv.CompositeConstruct {{%.*}}, {{%.*}}, {{%.*}}, {{%.*}} : !spv.array<4 x f32>
%5 = spv.CompositeInsert %value0, %4[0 : i32] : f32 into !spv.array<4xf32>
%6 = spv.CompositeInsert %value1, %5[1 : i32] : f32 into !spv.array<4xf32>
%7 = spv.CompositeInsert %value2, %6[2 : i32] : f32 into !spv.array<4xf32>
%8 = spv.CompositeInsert %value0, %7[3 : i32] : f32 into !spv.array<4xf32>
%9 = spv.undef : !spv.struct<(f32, i32, f32)>
%9 = spv.Undef : !spv.struct<(f32, i32, f32)>
// CHECK: spv.CompositeConstruct {{%.*}}, {{%.*}}, {{%.*}} : !spv.struct<(f32, i32, f32)>
%10 = spv.CompositeInsert %value0, %9[0 : i32] : f32 into !spv.struct<(f32, i32, f32)>
%11 = spv.CompositeInsert %value3, %10[1 : i32] : i32 into !spv.struct<(f32, i32, f32)>
%12 = spv.CompositeInsert %value1, %11[2 : i32] : f32 into !spv.struct<(f32, i32, f32)>
%13 = spv.undef : !spv.struct<(f32, !spv.array<3xf32>)>
%13 = spv.Undef : !spv.struct<(f32, !spv.array<3xf32>)>
// CHECK: spv.CompositeConstruct {{%.*}}, {{%.*}} : !spv.struct<(f32, !spv.array<3 x f32>)>
%14 = spv.CompositeInsert %value0, %13[0 : i32] : f32 into !spv.struct<(f32, !spv.array<3xf32>)>
%15 = spv.CompositeInsert %value4, %14[1 : i32] : !spv.array<3xf32> into !spv.struct<(f32, !spv.array<3xf32>)>

View File

@ -2,19 +2,19 @@
spv.module Logical GLSL450 requires #spv.vce<v1.0, [Shader], []> {
spv.func @foo() -> () "None" {
// CHECK: {{%.*}} = spv.undef : f32
// CHECK-NEXT: {{%.*}} = spv.undef : f32
%0 = spv.undef : f32
%1 = spv.undef : f32
// CHECK: {{%.*}} = spv.Undef : f32
// CHECK-NEXT: {{%.*}} = spv.Undef : f32
%0 = spv.Undef : f32
%1 = spv.Undef : f32
%2 = spv.FAdd %0, %1 : f32
// CHECK: {{%.*}} = spv.undef : vector<4xi32>
%3 = spv.undef : vector<4xi32>
// CHECK: {{%.*}} = spv.Undef : vector<4xi32>
%3 = spv.Undef : vector<4xi32>
%4 = spv.CompositeExtract %3[1 : i32] : vector<4xi32>
// CHECK: {{%.*}} = spv.undef : !spv.array<4 x !spv.array<4 x i32>>
%5 = spv.undef : !spv.array<4x!spv.array<4xi32>>
// CHECK: {{%.*}} = spv.Undef : !spv.array<4 x !spv.array<4 x i32>>
%5 = spv.Undef : !spv.array<4x!spv.array<4xi32>>
%6 = spv.CompositeExtract %5[1 : i32, 2 : i32] : !spv.array<4x!spv.array<4xi32>>
// CHECK: {{%.*}} = spv.undef : !spv.ptr<!spv.struct<(f32)>, StorageBuffer>
%7 = spv.undef : !spv.ptr<!spv.struct<(f32)>, StorageBuffer>
// CHECK: {{%.*}} = spv.Undef : !spv.ptr<!spv.struct<(f32)>, StorageBuffer>
%7 = spv.Undef : !spv.ptr<!spv.struct<(f32)>, StorageBuffer>
%8 = spv.Constant 0 : i32
%9 = spv.AccessChain %7[%8] : !spv.ptr<!spv.struct<(f32)>, StorageBuffer>, i32
spv.Return
@ -27,7 +27,7 @@ spv.module Logical GLSL450 requires #spv.vce<v1.0, [Shader], []> {
// CHECK: spv.func {{@.*}}
spv.func @ignore_unused_undef() -> () "None" {
// CHECK-NEXT: spv.Return
%0 = spv.undef : f32
%0 = spv.Undef : f32
spv.Return
}
}