[PATCH] D140940: [SelectionDAG][GlobalISel] Don't use UnsignedDivisionByConstantInfo for divisor of 1.

Craig Topper via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Jan 3 18:43:19 PST 2023


craig.topper created this revision.
craig.topper added reviewers: lebedev.ri, RKSimon, spatel, efriedma.
Herald added subscribers: StephenFan, ecnelises, hiraditya.
Herald added a project: All.
craig.topper requested review of this revision.
Herald added a project: LLVM.

The magic algorithm returns IsAdd indication for division by constant
that we were ignoring.

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.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D140940

Files:
  llvm/lib/CodeGen/GlobalISel/CombinerHelper.cpp
  llvm/lib/CodeGen/SelectionDAG/TargetLowering.cpp
  llvm/lib/Support/DivisionByConstantInfo.cpp
  llvm/unittests/Support/DivisionByConstantTest.cpp

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D140940.486140.patch
Type: text/x-patch
Size: 6688 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20230104/2e7b8ef0/attachment.bin>


More information about the llvm-commits mailing list