[all-commits] [llvm/llvm-project] c2c881: [mlir][tosa] Fix integer-to-boolean cast folder (#...
Longsheng Mou via All-commits
all-commits at lists.llvm.org
Thu Jul 24 07:48:54 PDT 2025
Branch: refs/heads/main
Home: https://github.com/llvm/llvm-project
Commit: c2c881fcc85e0c2d7a050b0199d4dadf8f556b9e
https://github.com/llvm/llvm-project/commit/c2c881fcc85e0c2d7a050b0199d4dadf8f556b9e
Author: Longsheng Mou <longshengmou at gmail.com>
Date: 2025-07-24 (Thu, 24 Jul 2025)
Changed paths:
M mlir/lib/Dialect/Tosa/IR/TosaCanonicalizations.cpp
M mlir/test/Dialect/Tosa/canonicalize.mlir
Log Message:
-----------
[mlir][tosa] Fix integer-to-boolean cast folder (#150370)
According to the TOSA spec, casting to boolean should produce true if
the input is non-zero, and false otherwise — i.e., `out = (in != 0) ?
true : false`. Previous behavior incorrectly relied on truncation, which
could yield incorrect results for non-zero values whose least
significant bit is zero. Fixes #150302.
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