[all-commits] [llvm/llvm-project] 7e4cf5: [InstCombine] Add general constant support to eq/n...

Simon Pilgrim via All-commits all-commits at lists.llvm.org
Tue Mar 15 07:18:01 PDT 2022


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 7e4cf582cffdc287a0d6ee354e90a4fbdc5a696d
      https://github.com/llvm/llvm-project/commit/7e4cf582cffdc287a0d6ee354e90a4fbdc5a696d
  Author: Simon Pilgrim <llvm-dev at redking.me.uk>
  Date:   2022-03-15 (Tue, 15 Mar 2022)

  Changed paths:
    M llvm/lib/Transforms/InstCombine/InstCombineCompares.cpp
    M llvm/test/Transforms/InstCombine/icmp.ll
    M llvm/test/Transforms/PhaseOrdering/loop-rotation-vs-common-code-hoisting.ll

  Log Message:
  -----------
  [InstCombine] Add general constant support to eq/ne icmp(add(X,C1),add(Y,C2)) -> icmp(add(X,C1-C2),Y) fold

A further extension for Issue #32161

For eq/ne comparisons - the sign mismatch and bounds constraints are redundant, so if the that fold fails, fallback and just fold the constants directly.

https://alive2.llvm.org/ce/z/cdodNQ

The loop rotation test change looks mostly benign - the backend doesn't seem to suffer? https://gcc.godbolt.org/z/dErMY78To

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




More information about the All-commits mailing list