[all-commits] [llvm/llvm-project] fd0758: [ConstantRange] Fix single bit abs range (PR59887)

Nikita Popov via All-commits all-commits at lists.llvm.org
Mon Jan 9 07:34:31 PST 2023


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: fd07583ca439494891662d5db58895f63e904cc5
      https://github.com/llvm/llvm-project/commit/fd07583ca439494891662d5db58895f63e904cc5
  Author: Nikita Popov <npopov at redhat.com>
  Date:   2023-01-09 (Mon, 09 Jan 2023)

  Changed paths:
    M llvm/lib/IR/ConstantRange.cpp
    M llvm/test/Transforms/CorrelatedValuePropagation/abs.ll
    M llvm/unittests/IR/ConstantRangeTest.cpp

  Log Message:
  -----------
  [ConstantRange] Fix single bit abs range (PR59887)

For a full range input, we would produce an empty range instead
of a full range. The change to the SMin.isNonNegative() branch is
an optimality fix, because we should account for the potentially
discarded SMin value in the IntMinIsPoison case.

Change TestUnaryOpExhaustive to test both 4 and 1 bits, to both
cover this specific case in unit tests, and make sure all other
unary operations deal with 1-bit inputs correctly.

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




More information about the All-commits mailing list