Skip to content

Commit

Permalink
Update LLVM submodule (#32)
Browse files Browse the repository at this point in the history
  • Loading branch information
wpmed92 authored Sep 18, 2024
1 parent ec23fe7 commit 38534f6
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 11 deletions.
4 changes: 2 additions & 2 deletions lib/CodeGen/MLIRCodeGen.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -594,7 +594,7 @@ void MLIRCodeGen::visit(WhileStatement *whileStmt) {
auto loc = builder.getUnknownLoc();

auto loopOp = builder.create<spirv::LoopOp>(loc, spirv::LoopControl::None);
loopOp.addEntryAndMergeBlock();
loopOp.addEntryAndMergeBlock(builder);
auto header = new Block();

// Insert the header.
Expand Down Expand Up @@ -977,7 +977,7 @@ void MLIRCodeGen::visit(IfStatement *ifStmt) {
ifStmt->getCondition()->accept(this);
condition = load(popExpressionStack());
selectionOp = builder.create<spirv::SelectionOp>(loc, spirv::SelectionControl::None);
selectionOp.addMergeBlock();
selectionOp.addMergeBlock(builder);

// Merge
mergeBlock = selectionOp.getMergeBlock();
Expand Down
2 changes: 1 addition & 1 deletion llvm-project
16 changes: 8 additions & 8 deletions test/CodeGen/swizzle.glsl
Original file line number Diff line number Diff line change
Expand Up @@ -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>
Expand All @@ -36,14 +36,14 @@ 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));

// CHECK: %cst0_i32 = spirv.Constant 0 : i32
// CHECK-NEXT: %35 = spirv.AccessChain %34[%cst0_i32] : !spirv.ptr<!spirv.struct<(vector<3xf32>, 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;
}

0 comments on commit 38534f6

Please sign in to comment.