mirror of
https://github.com/encounter/dawn-cmake.git
synced 2025-12-09 21:47:47 +00:00
transform/InlinePtrLets: Fix ICE for lets in for-loops
For loop initializers and continuing statements do not have a BlockStatement as their parent. Handle removal of these statements with a new Transform::RemoveStatement() helper Fixed: tint:990 Change-Id: I24e7b18dcf71d3ef0a4d3ee68b9f68518e0eb5e8 Reviewed-on: https://dawn-review.googlesource.com/c/tint/+/58063 Kokoro: Kokoro <noreply+kokoro@google.com> Reviewed-by: James Price <jrprice@google.com>
This commit is contained in:
4
test/bug/tint/990.wgsl
Normal file
4
test/bug/tint/990.wgsl
Normal file
@@ -0,0 +1,4 @@
|
||||
fn f() {
|
||||
var i : i32;
|
||||
for (let p = &i;;) {}
|
||||
}
|
||||
12
test/bug/tint/990.wgsl.expected.hlsl
Normal file
12
test/bug/tint/990.wgsl.expected.hlsl
Normal file
@@ -0,0 +1,12 @@
|
||||
[numthreads(1, 1, 1)]
|
||||
void unused_entry_point() {
|
||||
return;
|
||||
}
|
||||
|
||||
void f() {
|
||||
int i = 0;
|
||||
{
|
||||
for(; ; ) {
|
||||
}
|
||||
}
|
||||
}
|
||||
9
test/bug/tint/990.wgsl.expected.msl
Normal file
9
test/bug/tint/990.wgsl.expected.msl
Normal file
@@ -0,0 +1,9 @@
|
||||
#include <metal_stdlib>
|
||||
|
||||
using namespace metal;
|
||||
void f() {
|
||||
int i = 0;
|
||||
for(; ; ) {
|
||||
}
|
||||
}
|
||||
|
||||
35
test/bug/tint/990.wgsl.expected.spvasm
Normal file
35
test/bug/tint/990.wgsl.expected.spvasm
Normal file
@@ -0,0 +1,35 @@
|
||||
; SPIR-V
|
||||
; Version: 1.3
|
||||
; Generator: Google Tint Compiler; 0
|
||||
; Bound: 15
|
||||
; Schema: 0
|
||||
OpCapability Shader
|
||||
OpMemoryModel Logical GLSL450
|
||||
OpEntryPoint GLCompute %unused_entry_point "unused_entry_point"
|
||||
OpExecutionMode %unused_entry_point LocalSize 1 1 1
|
||||
OpName %unused_entry_point "unused_entry_point"
|
||||
OpName %f "f"
|
||||
OpName %i "i"
|
||||
%void = OpTypeVoid
|
||||
%1 = OpTypeFunction %void
|
||||
%int = OpTypeInt 32 1
|
||||
%_ptr_Function_int = OpTypePointer Function %int
|
||||
%10 = OpConstantNull %int
|
||||
%unused_entry_point = OpFunction %void None %1
|
||||
%4 = OpLabel
|
||||
OpReturn
|
||||
OpFunctionEnd
|
||||
%f = OpFunction %void None %1
|
||||
%6 = OpLabel
|
||||
%i = OpVariable %_ptr_Function_int Function %10
|
||||
OpBranch %11
|
||||
%11 = OpLabel
|
||||
OpLoopMerge %12 %13 None
|
||||
OpBranch %14
|
||||
%14 = OpLabel
|
||||
OpBranch %13
|
||||
%13 = OpLabel
|
||||
OpBranch %11
|
||||
%12 = OpLabel
|
||||
OpReturn
|
||||
OpFunctionEnd
|
||||
5
test/bug/tint/990.wgsl.expected.wgsl
Normal file
5
test/bug/tint/990.wgsl.expected.wgsl
Normal file
@@ -0,0 +1,5 @@
|
||||
fn f() {
|
||||
var i : i32;
|
||||
for(let p = &(i); ; ;) {
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user