[all-commits] [llvm/llvm-project] b72ac6: [MLIR] Let matchers work on int ranges (#102494)
Tobias Gysi via All-commits
all-commits at lists.llvm.org
Wed Aug 14 05:44:45 PDT 2024
Branch: refs/heads/main
Home: https://github.com/llvm/llvm-project
Commit: b72ac6f97a5335e79659711d49db8f2694c02a0e
https://github.com/llvm/llvm-project/commit/b72ac6f97a5335e79659711d49db8f2694c02a0e
Author: Tobias Gysi <tobias.gysi at nextsilicon.com>
Date: 2024-08-14 (Wed, 14 Aug 2024)
Changed paths:
M mlir/include/mlir/IR/Matchers.h
M mlir/lib/Dialect/Arith/IR/ArithOps.cpp
M mlir/test/Transforms/loop-invariant-code-motion.mlir
Log Message:
-----------
[MLIR] Let matchers work on int ranges (#102494)
This commit adds three matchers that unlike the m_NonZero matcher
not only match constants, but also operations that implement the
InferIntRangeInterface. These matchers can then match a non-zero value
or a value that is not minus one based on the inferred range. Additionally,
the commit uses the new matchers in the getSpeculatability functions of
Arith's signed and unsigned integer divisions. At the moment, the
matchers only look at the defining operation to avoid expensive IR walks.
This range based matchers can be useful when hoisting divisions out of
a loop, which requires knowing the divisor is non-zero and not minus one
for signed divisions. Just checking for a constant divisor may not be
sufficient, if the divisor is, for example, the result of an operation that
returns the number of threads of a team of threads.
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