[all-commits] [llvm/llvm-project] 7c0969: [TOSA] Add pass to sanitize gather/scatter indices...

RoboTux via All-commits all-commits at lists.llvm.org
Thu Sep 10 10:56:18 PDT 2026


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 7c0969c0842a1b19bcffd8bf3b67a76badb2c431
      https://github.com/llvm/llvm-project/commit/7c0969c0842a1b19bcffd8bf3b67a76badb2c431
  Author: Thomas Preud'homme <thomas.preudhomme at arm.com>
  Date:   2026-09-10 (Thu, 10 Sep 2026)

  Changed paths:
    M mlir/include/mlir/Dialect/Tosa/Transforms/Passes.td
    M mlir/lib/Dialect/Tosa/Transforms/CMakeLists.txt
    A mlir/lib/Dialect/Tosa/Transforms/TosaGatherScatterHardening.cpp
    A mlir/test/Dialect/Tosa/tosa-gather-scatter-hardening-invalid.mlir
    A mlir/test/Dialect/Tosa/tosa-gather-scatter-hardening.mlir

  Log Message:
  -----------
  [TOSA] Add pass to sanitize gather/scatter indices (#221200)

Add new TosaGatherScatterHardeningPass TOSA pass to clamp indices before
they are fed to a tosa.gather or tosa.scatter unless a suitable clamp
sequence already exists. This enables avoiding out-of-bounds accesses on
untrusted indices in tosa.gather and tosa.scatter lowering.

The pass fails if the dimension indexed by the indices tensor of any of
the tosa.gather or tosa.scatter is dynamic. The pass supports EXT-INT64
by using the same element type in the clamp min/max sequence as the
indices tensor. In case the indexed dimension is bigger than can be
represented in the element type bitwidth the maximum value in that
bitwidth is used.

Assisted-by: codex
Signed-off-by: Thomas Preud'homme <thomas.preudhomme at arm.com>



To unsubscribe from these emails, change your notification settings at https://github.com/llvm/llvm-project/settings/notifications


More information about the All-commits mailing list