[PATCH] D112469: [LegalizeTypes][TargetLowering] Merge getShiftAmountTyForConstant into TargetLowering::getShiftAmountTy.

Craig Topper via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Oct 25 10:26:07 PDT 2021


craig.topper created this revision.
craig.topper added reviewers: efriedma, spatel, RKSimon.
Herald added a subscriber: hiraditya.
craig.topper requested review of this revision.
Herald added a project: LLVM.

getShiftAmountTyForConstant is a special helper that changes the
shift amount to i32 if the type chosen by
TargetLowering::getShiftAmountTy can't represent all possible values.
This is needed to satisfy an assert in SelectionDAG::getNode.

It requires additional consideration to know when this helper should be used.
I'm not sure that we are always using it when we should.

This patch merges the getShiftAmountTyForConstant handling into
TargetLowering::getShiftAmountTy so we don't need to think about it
anymore.

Technically this may slightly increase compile times since the majority
of callers of getShiftAmountTy won't need this. Hopefully, this isn't
an issue in practice.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D112469

Files:
  llvm/include/llvm/CodeGen/TargetLowering.h
  llvm/lib/CodeGen/SelectionDAG/LegalizeIntegerTypes.cpp
  llvm/lib/CodeGen/TargetLoweringBase.cpp

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D112469.382041.patch
Type: text/x-patch
Size: 6286 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20211025/660f80ba/attachment.bin>


More information about the llvm-commits mailing list