[all-commits] [llvm/llvm-project] 7e18cd: [InstCombine] Whitelist non-refining folds in Simp...

Nikita Popov via All-commits all-commits at lists.llvm.org
Mon Mar 22 14:13:21 PDT 2021


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 7e18cd887cd402e3d5465c57c218079e4df65231
      https://github.com/llvm/llvm-project/commit/7e18cd887cd402e3d5465c57c218079e4df65231
  Author: Nikita Popov <nikita.ppv at gmail.com>
  Date:   2021-03-22 (Mon, 22 Mar 2021)

  Changed paths:
    M llvm/include/llvm/Analysis/InstructionSimplify.h
    M llvm/lib/Analysis/InstructionSimplify.cpp
    M llvm/test/Transforms/InstCombine/minmax-fold.ll
    M llvm/test/Transforms/InstCombine/select.ll
    M llvm/test/Transforms/InstSimplify/pr49495.ll

  Log Message:
  -----------
  [InstCombine] Whitelist non-refining folds in SimplifyWithOpReplaced

This is an alternative to D98391/D98585, playing things more
conservatively. If AllowRefinement == false, then we don't use
InstSimplify methods at all, and instead explicitly implement a
small number of non-refining folds. Most cases are handled by
constant folding, and I only had to add three folds to cover
our unit tests / test-suite. While this may lose some optimization
power, I think it is safer to approach from this direction, given
how many issues this code has already caused.

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




More information about the All-commits mailing list