diff --git a/lib/CodeGen/MLIRCodeGen.cpp b/lib/CodeGen/MLIRCodeGen.cpp index 16e98c7..3ddf309 100644 --- a/lib/CodeGen/MLIRCodeGen.cpp +++ b/lib/CodeGen/MLIRCodeGen.cpp @@ -594,7 +594,7 @@ void MLIRCodeGen::visit(WhileStatement *whileStmt) { auto loc = builder.getUnknownLoc(); auto loopOp = builder.create(loc, spirv::LoopControl::None); - loopOp.addEntryAndMergeBlock(); + loopOp.addEntryAndMergeBlock(builder); auto header = new Block(); // Insert the header. @@ -977,7 +977,7 @@ void MLIRCodeGen::visit(IfStatement *ifStmt) { ifStmt->getCondition()->accept(this); condition = load(popExpressionStack()); selectionOp = builder.create(loc, spirv::SelectionControl::None); - selectionOp.addMergeBlock(); + selectionOp.addMergeBlock(builder); // Merge mergeBlock = selectionOp.getMergeBlock(); diff --git a/llvm-project b/llvm-project index b34ca08..76347ee 160000 --- a/llvm-project +++ b/llvm-project @@ -1 +1 @@ -Subproject commit b34ca0851a5209a10c0ca285c000a18073677891 +Subproject commit 76347ee9584bfcdaceb4ee48d39441c29aeb2124 diff --git a/test/CodeGen/swizzle.glsl b/test/CodeGen/swizzle.glsl index 742b58a..6460ade 100644 --- a/test/CodeGen/swizzle.glsl +++ b/test/CodeGen/swizzle.glsl @@ -10,18 +10,18 @@ void main() { vec4 _vec4 = vec4(3.4, 4.8, 5.6, 6.7); - // CHECK: %7 = spirv.VectorShuffle [0 : i32, 1 : i32] %6 : vector<2xf32>, %6 : vector<2xf32> -> vector<2xf32> + // CHECK: %7 = spirv.VectorShuffle [0 : i32, 1 : i32] %6, %6 : vector<2xf32>, vector<2xf32> -> vector<2xf32> vec2 _swizz_vec2 = _vec2.xy; - // CHECK: %10 = spirv.VectorShuffle [0 : i32, 1 : i32, 2 : i32] %9 : vector<3xf32>, %9 : vector<3xf32> -> vector<3xf32> + // CHECK: %10 = spirv.VectorShuffle [0 : i32, 1 : i32, 2 : i32] %9, %9 : vector<3xf32>, vector<3xf32> -> vector<3xf32> vec3 _swizz_vec3 = _vec3.xyz; - // CHECK: %13 = spirv.VectorShuffle [0 : i32, 1 : i32, 2 : i32, 3 : i32] %12 : vector<4xf32>, %12 : vector<4xf32> -> vector<4xf32> + // CHECK: %13 = spirv.VectorShuffle [0 : i32, 1 : i32, 2 : i32, 3 : i32] %12, %12 : vector<4xf32>, vector<4xf32> -> vector<4xf32> vec4 _swizz_vec4 = _vec4.xyzw; - // CHECK: %16 = spirv.VectorShuffle [0 : i32, 1 : i32, 2 : i32, 3 : i32] %15 : vector<4xf32>, %15 : vector<4xf32> -> vector<4xf32> - // CHECK-NEXT: %17 = spirv.VectorShuffle [0 : i32, 1 : i32, 2 : i32] %16 : vector<4xf32>, %16 : vector<4xf32> -> vector<3xf32> - // CHECK-NEXT: %18 = spirv.VectorShuffle [0 : i32, 1 : i32] %17 : vector<3xf32>, %17 : vector<3xf32> -> vector<2xf32> + // CHECK: %16 = spirv.VectorShuffle [0 : i32, 1 : i32, 2 : i32, 3 : i32] %15, %15 : vector<4xf32>, vector<4xf32> -> vector<4xf32> + // CHECK-NEXT: %17 = spirv.VectorShuffle [0 : i32, 1 : i32, 2 : i32] %16, %16 : vector<4xf32>, vector<4xf32> -> vector<3xf32> + // CHECK-NEXT: %18 = spirv.VectorShuffle [0 : i32, 1 : i32] %17, %17 : vector<3xf32>, vector<3xf32> -> vector<2xf32> vec2 _swizz_chain = _vec4.xyzw.xyz.xy; // CHECK: %21 = spirv.CompositeExtract %20[0 : i32] : vector<3xf32> @@ -36,7 +36,7 @@ void main() { // CHECK: %28 = spirv.CompositeExtract %27[3 : i32] : vector<4xf32> single_elem = _vec4.a; - // CHECK: %30 = spirv.VectorShuffle [2 : i32, 1 : i32, 0 : i32] %29 : vector<4xf32>, %29 : vector<4xf32> -> vector<3xf32> + // CHECK: %30 = spirv.VectorShuffle [2 : i32, 1 : i32, 0 : i32] %29, %29 : vector<4xf32>, vector<4xf32> -> vector<3xf32> _swizz_vec3 = _vec4.bgr; StructSwizzle structSwizz = StructSwizzle(vec3(1.0, 0.0, 0.0), vec3(0.5, 0.0, 1.0)); @@ -44,6 +44,6 @@ void main() { // CHECK: %cst0_i32 = spirv.Constant 0 : i32 // CHECK-NEXT: %35 = spirv.AccessChain %34[%cst0_i32] : !spirv.ptr, vector<3xf32>)>, Function>, i32 // CHECK-NEXT: %36 = spirv.Load "Function" %35 : vector<3xf32> - // CHECK-NEXT: %37 = spirv.VectorShuffle [1 : i32, 0 : i32] %36 : vector<3xf32>, %36 : vector<3xf32> -> vector<2xf32> + // CHECK-NEXT: %37 = spirv.VectorShuffle [1 : i32, 0 : i32] %36, %36 : vector<3xf32>, vector<3xf32> -> vector<2xf32> _swizz_chain = structSwizz.color.yx; } \ No newline at end of file