Convince the metal compiler that loops are never infinite
Disable the end2end infinite loop tests for now
Bug: crbug.com/371840056
Change-Id: I300d61e4929942e41ca9c451c88f304e9b58f1f4
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/210338
Reviewed-by: James Price <jrprice@google.com>
Commit-Queue: David Neto <dneto@google.com>
diff --git a/test/tint/buffer/storage/dynamic_index/write.wgsl.expected.msl b/test/tint/buffer/storage/dynamic_index/write.wgsl.expected.msl
index beaa591..37da0cf 100644
--- a/test/tint/buffer/storage/dynamic_index/write.wgsl.expected.msl
+++ b/test/tint/buffer/storage/dynamic_index/write.wgsl.expected.msl
@@ -15,8 +15,7 @@
};
#define TINT_ISOLATE_UB(VOLATILE_NAME) \
- volatile bool VOLATILE_NAME = true; \
- if (VOLATILE_NAME)
+ {volatile bool VOLATILE_NAME = false; if (VOLATILE_NAME) break;}
struct tint_packed_vec3_f32_array_element {
/* 0x0000 */ packed_float3 elements;
@@ -106,7 +105,8 @@
}
void assign_and_preserve_padding_3(device tint_array<tint_packed_vec3_f32_array_element, 2>* const dest, tint_array<float3, 2> value) {
- TINT_ISOLATE_UB(tint_volatile_true) for(uint i = 0u; (i < 2u); i = (i + 1u)) {
+ for(uint i = 0u; (i < 2u); i = (i + 1u)) {
+ TINT_ISOLATE_UB(tint_volatile_false);
(*(dest))[i].elements = packed_float3(value[i]);
}
}
diff --git a/test/tint/buffer/storage/dynamic_index/write_f16.wgsl.expected.msl b/test/tint/buffer/storage/dynamic_index/write_f16.wgsl.expected.msl
index ba02219..6ca902a 100644
--- a/test/tint/buffer/storage/dynamic_index/write_f16.wgsl.expected.msl
+++ b/test/tint/buffer/storage/dynamic_index/write_f16.wgsl.expected.msl
@@ -15,8 +15,7 @@
};
#define TINT_ISOLATE_UB(VOLATILE_NAME) \
- volatile bool VOLATILE_NAME = true; \
- if (VOLATILE_NAME)
+ {volatile bool VOLATILE_NAME = false; if (VOLATILE_NAME) break;}
struct tint_packed_vec3_f32_array_element {
/* 0x0000 */ packed_float3 elements;
@@ -161,7 +160,8 @@
}
void assign_and_preserve_padding_6(device tint_array<tint_packed_vec3_f32_array_element, 2>* const dest, tint_array<float3, 2> value) {
- TINT_ISOLATE_UB(tint_volatile_true) for(uint i = 0u; (i < 2u); i = (i + 1u)) {
+ for(uint i = 0u; (i < 2u); i = (i + 1u)) {
+ TINT_ISOLATE_UB(tint_volatile_false);
(*(dest))[i].elements = packed_float3(value[i]);
}
}
diff --git a/test/tint/buffer/storage/static_index/write.wgsl.expected.msl b/test/tint/buffer/storage/static_index/write.wgsl.expected.msl
index 69afba3..dddbdcc 100644
--- a/test/tint/buffer/storage/static_index/write.wgsl.expected.msl
+++ b/test/tint/buffer/storage/static_index/write.wgsl.expected.msl
@@ -15,8 +15,7 @@
};
#define TINT_ISOLATE_UB(VOLATILE_NAME) \
- volatile bool VOLATILE_NAME = true; \
- if (VOLATILE_NAME)
+ {volatile bool VOLATILE_NAME = false; if (VOLATILE_NAME) break;}
struct tint_packed_vec3_f32_array_element {
/* 0x0000 */ packed_float3 elements;
@@ -108,7 +107,8 @@
}
void assign_and_preserve_padding_3(device tint_array<tint_packed_vec3_f32_array_element, 2>* const dest, tint_array<float3, 2> value) {
- TINT_ISOLATE_UB(tint_volatile_true) for(uint i = 0u; (i < 2u); i = (i + 1u)) {
+ for(uint i = 0u; (i < 2u); i = (i + 1u)) {
+ TINT_ISOLATE_UB(tint_volatile_false);
(*(dest))[i].elements = packed_float3(value[i]);
}
}
diff --git a/test/tint/buffer/storage/static_index/write_f16.wgsl.expected.msl b/test/tint/buffer/storage/static_index/write_f16.wgsl.expected.msl
index ef66275..52e6d56 100644
--- a/test/tint/buffer/storage/static_index/write_f16.wgsl.expected.msl
+++ b/test/tint/buffer/storage/static_index/write_f16.wgsl.expected.msl
@@ -15,8 +15,7 @@
};
#define TINT_ISOLATE_UB(VOLATILE_NAME) \
- volatile bool VOLATILE_NAME = true; \
- if (VOLATILE_NAME)
+ {volatile bool VOLATILE_NAME = false; if (VOLATILE_NAME) break;}
struct tint_packed_vec3_f32_array_element {
/* 0x0000 */ packed_float3 elements;
@@ -165,7 +164,8 @@
}
void assign_and_preserve_padding_6(device tint_array<tint_packed_vec3_f32_array_element, 2>* const dest, tint_array<float3, 2> value) {
- TINT_ISOLATE_UB(tint_volatile_true) for(uint i = 0u; (i < 2u); i = (i + 1u)) {
+ for(uint i = 0u; (i < 2u); i = (i + 1u)) {
+ TINT_ISOLATE_UB(tint_volatile_false);
(*(dest))[i].elements = packed_float3(value[i]);
}
}
@@ -177,7 +177,8 @@
}
void assign_and_preserve_padding_8(device tint_array<Inner, 4>* const dest, tint_array<Inner, 4> value) {
- TINT_ISOLATE_UB(tint_volatile_true_1) for(uint i = 0u; (i < 4u); i = (i + 1u)) {
+ for(uint i = 0u; (i < 4u); i = (i + 1u)) {
+ TINT_ISOLATE_UB(tint_volatile_false_1);
assign_and_preserve_padding_7(&((*(dest))[i]), value[i]);
}
}