mirror of
https://github.com/encounter/dawn-cmake.git
synced 2025-12-16 08:27:05 +00:00
transform: DMA: Don't load ignore() arguments
ignore() might be passed a structure holding a runtime array. Fixed: tint:1046 Change-Id: I2beab91d8faabe69409308cf3e24b6403a84dd56 Reviewed-on: https://dawn-review.googlesource.com/c/tint/+/60213 Kokoro: Kokoro <noreply+kokoro@google.com> Reviewed-by: David Neto <dneto@google.com> Auto-Submit: Ben Clayton <bclayton@google.com>
This commit is contained in:
@@ -915,11 +915,18 @@ void DecomposeMemoryAccess::Run(CloneContext& ctx, const DataMap&, DataMap&) {
|
||||
if (auto* call_expr = node->As<ast::CallExpression>()) {
|
||||
auto* call = sem.Get(call_expr);
|
||||
if (auto* intrinsic = call->Target()->As<sem::Intrinsic>()) {
|
||||
if (intrinsic->Type() == sem::IntrinsicType::kIgnore) {
|
||||
// ignore(X)
|
||||
// Don't convert X into a load, this isn't actually used.
|
||||
state.TakeAccess(call_expr->params()[0]);
|
||||
continue;
|
||||
}
|
||||
if (intrinsic->Type() == sem::IntrinsicType::kArrayLength) {
|
||||
// arrayLength(X)
|
||||
// Don't convert X into a load, this intrinsic actually requires the
|
||||
// real pointer.
|
||||
state.TakeAccess(call_expr->params()[0]);
|
||||
continue;
|
||||
}
|
||||
if (intrinsic->IsAtomic()) {
|
||||
if (auto access = state.TakeAccess(call_expr->params()[0])) {
|
||||
|
||||
Reference in New Issue
Block a user