[PATCH] D30529: [GlobalISel] Enable specifying how to legalize non-power-of-2 size types. [NFC-ish]

Kristof Beyls via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri Mar 17 06:50:37 PDT 2017


kristof.beyls updated this revision to Diff 92139.
kristof.beyls retitled this revision from "[GlobalISel] Enable specifying how to legalize non-power-of-2 size types." to "[GlobalISel] Enable specifying how to legalize non-power-of-2 size types. [NFC-ish]".
kristof.beyls added a comment.

- Made the API change to LegalizerInfo::setAction much smaller: the setAction API is largely unchanged now. The only difference is that it no longer allows legalizationActions that change the size to be specified this way.
- Instead, specifying how to legalize when the size of the type legalized needs to change is specified using a SizeChangeStrategy. In follow-up work, I think that these size-changing strategies will turn out to be largely target-independent, and therefore can be shared between all targets, and not need to be respecified for each target separately.
- Split setAction into setScalarAction and setPointerAction to avoid having to specify an LLT just to indicate whether the type is a scalar or a pointer(with address space).
- To keep this patch as NFC as possible, for AArch64, I had to come up with some complicated SizeChangeStrategies. While not pretty, it demonstrates that it is possible to create very custom SizeChangeStrategies. These ugly SizeChangeStrategies are also only expect to be there for a short while, until we make functional-change-changes to allow all non-power-of-two-sized types
- Moved some of the implementation code from LegalizerInfo.h to LegalizerInfo.cpp
- A lot of smaller cleanups.


https://reviews.llvm.org/D30529

Files:
  include/llvm/CodeGen/GlobalISel/LegalizerInfo.h
  include/llvm/CodeGen/LowLevelType.h
  include/llvm/Support/LowLevelTypeImpl.h
  lib/CodeGen/GlobalISel/LegalizerHelper.cpp
  lib/CodeGen/GlobalISel/LegalizerInfo.cpp
  lib/Support/LowLevelType.cpp
  lib/Target/AArch64/AArch64LegalizerInfo.cpp
  unittests/CodeGen/GlobalISel/LegalizerInfoTest.cpp
  unittests/CodeGen/LowLevelTypeTest.cpp

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D30529.92139.patch
Type: text/x-patch
Size: 68246 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20170317/239bef43/attachment.bin>


More information about the llvm-commits mailing list