[all-commits] [llvm/llvm-project] d30717: [ConstantRange] Use APInt::or/APInt::and for singl...

Florian Hahn via All-commits all-commits at lists.llvm.org
Wed Apr 1 01:50:33 PDT 2020


  Branch: refs/heads/master
  Home:   https://github.com/llvm/llvm-project
  Commit: d307174e1d9e66a9e5a1e936ac3736343c3fe381
      https://github.com/llvm/llvm-project/commit/d307174e1d9e66a9e5a1e936ac3736343c3fe381
  Author: Florian Hahn <flo at fhahn.com>
  Date:   2020-04-01 (Wed, 01 Apr 2020)

  Changed paths:
    M llvm/lib/IR/ConstantRange.cpp
    M llvm/test/Transforms/Attributor/range.ll
    M llvm/test/Transforms/CorrelatedValuePropagation/range.ll

  Log Message:
  -----------
  [ConstantRange] Use APInt::or/APInt::and for single elements.

Currently ConstantRange::binaryAnd/binaryOr results are too pessimistic
for single element constant ranges.

If both operands are single element ranges, we can use APInt's AND and
OR implementations directly.

Note that some other binary operations on constant ranges can cover the
single element cases naturally, but for OR and AND this unfortunately is
not the case.

Reviewers: nikic, spatel, lebedev.ri

Reviewed By: spatel

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




More information about the All-commits mailing list