[all-commits] [llvm/llvm-project] 97567b: [MLIR][SCF] Canonicalize while statement whose cmp...

William Moses via All-commits all-commits at lists.llvm.org
Tue Jan 11 15:34:16 PST 2022


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 97567bde5baaf87c0ac71cfc114dad56442b85d3
      https://github.com/llvm/llvm-project/commit/97567bde5baaf87c0ac71cfc114dad56442b85d3
  Author: William S. Moses <gh at wsmoses.com>
  Date:   2022-01-11 (Tue, 11 Jan 2022)

  Changed paths:
    M mlir/include/mlir/Dialect/Arithmetic/IR/Arithmetic.h
    M mlir/lib/Dialect/Arithmetic/IR/ArithmeticOps.cpp
    M mlir/lib/Dialect/SCF/SCF.cpp
    M mlir/test/Dialect/SCF/canonicalize.mlir

  Log Message:
  -----------
  [MLIR][SCF] Canonicalize while statement whose cmp condition is recomputed in the after region

Given a while loop whose condition is given by a cmp, don't recomputed the comparison (or its inverse) in the after region, instead use a constant since  the original condition must be true if we branched to the after region.

Reviewed By: mehdi_amini

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




More information about the All-commits mailing list