[all-commits] [llvm/llvm-project] bbf073: [mlir][arith] Fold `select` with poison

Markus Böck via All-commits all-commits at lists.llvm.org
Mon Aug 28 23:33:00 PDT 2023

  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: bbf0733030ae16a1ef19c2a031f805a971e941d2
  Author: Markus Böck <markus.bock+llvm at nextsilicon.com>
  Date:   2023-08-29 (Tue, 29 Aug 2023)

  Changed paths:
    M mlir/lib/Dialect/Arith/IR/ArithOps.cpp
    M mlir/lib/Dialect/Arith/IR/CMakeLists.txt
    M mlir/test/Dialect/Arith/canonicalize.mlir

  Log Message:
  [mlir][arith] Fold `select` with poison

If either of the operands of `select` is fully poisoned we can simply return the other.
This PR implements this optimization inside the `fold` method.

Note that this patch is the first to add a dependency on the UB dialect within Arith. Given this was inevitable (and part of the motivation) it should be fine I believe.

Differential Revision: https://reviews.llvm.org/D158986

More information about the All-commits mailing list