[all-commits] [llvm/llvm-project] 8bca60: [SelectionDAG][GlobalISel] Don't use UnsignedDivis...

Craig Topper via All-commits all-commits at lists.llvm.org
Wed Jan 4 10:02:17 PST 2023


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 8bca60fb0aa5f82d32e619d75e65d0dea2472722
      https://github.com/llvm/llvm-project/commit/8bca60fb0aa5f82d32e619d75e65d0dea2472722
  Author: Craig Topper <craig.topper at sifive.com>
  Date:   2023-01-04 (Wed, 04 Jan 2023)

  Changed paths:
    M llvm/lib/CodeGen/GlobalISel/CombinerHelper.cpp
    M llvm/lib/CodeGen/SelectionDAG/TargetLowering.cpp
    M llvm/lib/Support/DivisionByConstantInfo.cpp
    M llvm/unittests/Support/DivisionByConstantTest.cpp

  Log Message:
  -----------
  [SelectionDAG][GlobalISel] Don't use UnsignedDivisionByConstantInfo for divisor of 1.

The magic algorithm sets IsAdd indication for division by 1 that
the caller had to ignore.

I considered folding the ignore into UnsignedDivisionByConstantInfo,
but we only allow 1 for vectors of mixed visiors. And really what we
want to end up with is undef. Currently, we get to undef via
DemandedElts optimizations using the select instruction. We could
directly emit undef.

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




More information about the All-commits mailing list