[all-commits] [llvm/llvm-project] f7d1ba: [KnownBits] Return zero instead of unknown for alw...

Nikita Popov via All-commits all-commits at lists.llvm.org
Tue May 23 05:41:40 PDT 2023


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: f7d1baa414e6e4fca04092cb2f71e9b037c762f0
      https://github.com/llvm/llvm-project/commit/f7d1baa414e6e4fca04092cb2f71e9b037c762f0
  Author: Nikita Popov <npopov at redhat.com>
  Date:   2023-05-23 (Tue, 23 May 2023)

  Changed paths:
    M llvm/lib/Analysis/ValueTracking.cpp
    M llvm/lib/Support/KnownBits.cpp
    M llvm/test/Analysis/ScalarEvolution/ashr.ll
    M llvm/test/CodeGen/AArch64/GlobalISel/form-bitfield-extract-from-sextinreg.mir
    M llvm/test/CodeGen/LoongArch/rotl-rotr.ll
    M llvm/test/CodeGen/RISCV/rotl-rotr.ll
    M llvm/test/Transforms/InstCombine/not-add.ll
    M llvm/test/Transforms/InstCombine/oss_fuzz_32759.ll
    M llvm/test/Transforms/InstCombine/shift.ll
    M llvm/unittests/Analysis/ValueTrackingTest.cpp
    M llvm/unittests/CodeGen/GlobalISel/KnownBitsTest.cpp
    M llvm/unittests/CodeGen/GlobalISel/KnownBitsVectorTest.cpp

  Log Message:
  -----------
  [KnownBits] Return zero instead of unknown for always poison shifts

For always poison shifts, any KnownBits return value is valid.
Currently we return unknown, but returning zero is generally more
profitable. We had some code in ValueTracking that tried to do this,
but was actually dead code.

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




More information about the All-commits mailing list