[all-commits] [llvm/llvm-project] 44a4db: [MLIR][Arith] Don't narrow shifts whose amount can...

edisongz via All-commits all-commits at lists.llvm.org
Mon Sep 7 13:58:30 PDT 2026


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 44a4dbf32a6b54de32e4d064756d7a6ba5b9e808
      https://github.com/llvm/llvm-project/commit/44a4dbf32a6b54de32e4d064756d7a6ba5b9e808
  Author: edisongz <edisongz123 at gmail.com>
  Date:   2026-09-07 (Mon, 07 Sep 2026)

  Changed paths:
    M mlir/lib/Dialect/Arith/Transforms/IntRangeOptimizations.cpp
    M mlir/test/Dialect/Arith/int-range-narrowing.mlir

  Log Message:
  -----------
  [MLIR][Arith] Don't narrow shifts whose amount can exceed the target width (#218495)

A shift by an amount >= the operand bitwidth is poison. Narrowing
changes that bitwidth, so an amount valid at the original width (e.g. 32
for i64) can become poison at the narrowed one (>= 32 for i32),
miscompiling `4 >> 32` from 0 to 4.

Only narrow shifts when the shift amount is provably below the target
width.

Fixes #218191



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