[all-commits] [llvm/llvm-project] c41b4b: [InstCombine] Make flag drop during select equiv f...

Nikita Popov via All-commits all-commits at lists.llvm.org
Tue Sep 19 05:55:55 PDT 2023


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: c41b4b6397675c0d75b316aac3bae380f1ac493c
      https://github.com/llvm/llvm-project/commit/c41b4b6397675c0d75b316aac3bae380f1ac493c
  Author: Nikita Popov <npopov at redhat.com>
  Date:   2023-09-19 (Tue, 19 Sep 2023)

  Changed paths:
    M llvm/include/llvm/Analysis/InstructionSimplify.h
    M llvm/lib/Analysis/InstructionSimplify.cpp
    M llvm/lib/Transforms/InstCombine/InstCombineSelect.cpp
    M llvm/test/Transforms/InstCombine/bit_ceil.ll
    M llvm/test/Transforms/InstCombine/ctpop.ll
    M llvm/test/Transforms/InstCombine/ispow2.ll
    M llvm/test/Transforms/LoopVectorize/reduction-inloop.ll

  Log Message:
  -----------
  [InstCombine] Make flag drop during select equiv fold more generic

Instead of unsetting flags on the instruction, attempting the
fold, and the resetting the flags if it failed, add support to
simplifyWithOpReplaced() to ignore poison-generating flags/metadata
and collect all instructions where they may need to be dropped.

This allows us to perform the fold a) with poison-generating
metadata, which was previously not handled and b) poison-generating
flags/metadata that are not on the root instruction.

Proof for the ctpop case: https://alive2.llvm.org/ce/z/3H3HFs

Fixes https://github.com/llvm/llvm-project/issues/62450.




More information about the All-commits mailing list