diff --git a/mlir/include/mlir/Dialect/SPIRV/IR/SPIRVMiscOps.td b/mlir/include/mlir/Dialect/SPIRV/IR/SPIRVMiscOps.td --- a/mlir/include/mlir/Dialect/SPIRV/IR/SPIRVMiscOps.td +++ b/mlir/include/mlir/Dialect/SPIRV/IR/SPIRVMiscOps.td @@ -18,7 +18,7 @@ // ----- -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 @@ ``` - undef-op ::= `spv.undef` `:` spirv-type + undef-op ::= `spv.Undef` `:` spirv-type ``` #### Example: ```mlir - %0 = spv.undef : f32 - %1 = spv.undef : !spv.struct>> + %0 = spv.Undef : f32 + %1 = spv.Undef : !spv.struct>> ``` }]; diff --git a/mlir/include/mlir/Dialect/SPIRV/IR/SPIRVStructureOps.td b/mlir/include/mlir/Dialect/SPIRV/IR/SPIRVStructureOps.td --- a/mlir/include/mlir/Dialect/SPIRV/IR/SPIRVStructureOps.td +++ b/mlir/include/mlir/Dialect/SPIRV/IR/SPIRVStructureOps.td @@ -622,7 +622,7 @@ - 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 ` (` diff --git a/mlir/test/Conversion/SPIRVToLLVM/misc-ops-to-llvm.mlir b/mlir/test/Conversion/SPIRVToLLVM/misc-ops-to-llvm.mlir --- a/mlir/test/Conversion/SPIRVToLLVM/misc-ops-to-llvm.mlir +++ b/mlir/test/Conversion/SPIRVToLLVM/misc-ops-to-llvm.mlir @@ -113,13 +113,13 @@ // 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 } diff --git a/mlir/test/Dialect/SPIRV/IR/misc-ops.mlir b/mlir/test/Dialect/SPIRV/IR/misc-ops.mlir --- a/mlir/test/Dialect/SPIRV/IR/misc-ops.mlir +++ b/mlir/test/Dialect/SPIRV/IR/misc-ops.mlir @@ -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() -> () { // expected-error @+2{{expected non-function type}} - %0 = spv.undef : + %0 = spv.Undef : spv.Return } @@ -24,6 +24,6 @@ func @undef() -> () { // expected-error @+2{{expected ':'}} - %0 = spv.undef + %0 = spv.Undef spv.Return } diff --git a/mlir/test/Dialect/SPIRV/Transforms/rewrite-inserts.mlir b/mlir/test/Dialect/SPIRV/Transforms/rewrite-inserts.mlir --- a/mlir/test/Dialect/SPIRV/Transforms/rewrite-inserts.mlir +++ b/mlir/test/Dialect/SPIRV/Transforms/rewrite-inserts.mlir @@ -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>)> diff --git a/mlir/test/Target/SPIRV/undef.mlir b/mlir/test/Target/SPIRV/undef.mlir --- a/mlir/test/Target/SPIRV/undef.mlir +++ b/mlir/test/Target/SPIRV/undef.mlir @@ -2,19 +2,19 @@ spv.module Logical GLSL450 requires #spv.vce { 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, StorageBuffer> - %7 = spv.undef : !spv.ptr, StorageBuffer> + // CHECK: {{%.*}} = spv.Undef : !spv.ptr, StorageBuffer> + %7 = spv.Undef : !spv.ptr, StorageBuffer> %8 = spv.Constant 0 : i32 %9 = spv.AccessChain %7[%8] : !spv.ptr, StorageBuffer>, i32 spv.Return @@ -27,7 +27,7 @@ // CHECK: spv.func {{@.*}} spv.func @ignore_unused_undef() -> () "None" { // CHECK-NEXT: spv.Return - %0 = spv.undef : f32 + %0 = spv.Undef : f32 spv.Return } }