[llvm-commits] [PATCH] Add support for non-power-of-2 sized registers

Patrik Hägglund H patrik.h.hagglund at ericsson.com
Fri Jul 6 06:43:29 PDT 2012


Hi,

We have an LLVM target that has 24-bit and 40-bit
registers (intended for fixed-point operations, but many other
operations are supported for 40 bit registers as well).

This is a series of patches which adds i24 and i40 as simple
ValueTypes, and fix problems exposed (interspersed with
cleanups), mainly due to power-of-2 sized registers are assumed.

We probably never will be able to commit our backend to the LLVM
tree, and therefore, some of this code will not be
used (in-tree), unless another target is added which also has
non-power-of-2 sized registers. Therefore, the intent of this
mail is to ask: Which of these changes that can be committed, and
which of them can "never" be committed?

The problems found are located in

* TargetLowering::computeRegisterProperties(): patch 1-4
* TargetLowering::getOperationAction()/
  SelectionDAGLegalize::LegalizeOp(): patch 5
* FindOptimalMemOpLowering() in SelectionDAG.cpp: patch 6-8

Finally, patch 9 adds i24 and i40 as simple ValueTypes.

Patch 5 needs more work and probably help from you!

When the prefix Cleanup is used below, it means that there is no
functionality change intended.

[PATCH 1/9] Cleanup: Simplify loop end logic in computeRegisterProperties.

[PATCH 2/9] Cleanup: Loops over 'MVT::SimpleValueType' now use that type.

[PATCH 3/9] Cleanup: Restructure to prepare for non-power-of-2 logic.

[PATCH 4/9] Adding support for non-power-of-2 sized integer ValueTypes to
computeRegisterProperties.

[PATCH 5/9] Change the default results from getOperationAction, to avoid
dependencies on the set of simple ValueTypes.

[PATCH 6/9] Cleanup: Clean up loop logic. Use MVT instead of EVT.

[PATCH 7/9] Account for non-power-of-2 sized ValueTypes in
FindOptimalMemOpLowering.

[PATCH 8/9] Simplify handling of the remainder in FindOptimalMemOpLowering.

[PATCH 9/9] Add i24 and i40 as simple ValueTypes.

Next week, I will leave for a long vacation, and thus, my response may be slow
for a while. However, I wanted to get early feedback on these changes.

(FYI, our target also use 16-bit bytes, which hopefully will generate
another round of patches in the future. :-))

Regards,
Patrik Hägglund

-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0009-Add-i24-and-i40-as-simple-ValueTypes.patch
Type: application/octet-stream
Size: 18052 bytes
Desc: 0009-Add-i24-and-i40-as-simple-ValueTypes.patch
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20120706/aab39e24/attachment.obj>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0001-Cleanup-Simplify-loop-end-logic-in-computeRegisterPr.patch
Type: application/octet-stream
Size: 1637 bytes
Desc: 0001-Cleanup-Simplify-loop-end-logic-in-computeRegisterPr.patch
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20120706/aab39e24/attachment-0001.obj>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0002-Cleanup-Loops-over-MVT-SimpleValueType-now-use-that-.patch
Type: application/octet-stream
Size: 7141 bytes
Desc: 0002-Cleanup-Loops-over-MVT-SimpleValueType-now-use-that-.patch
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20120706/aab39e24/attachment-0002.obj>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0003-Cleanup-Restructure-to-prepare-for-non-power-of-2-lo.patch
Type: application/octet-stream
Size: 3281 bytes
Desc: 0003-Cleanup-Restructure-to-prepare-for-non-power-of-2-lo.patch
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20120706/aab39e24/attachment-0003.obj>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0004-Adding-support-for-non-power-of-2-sized-interger-Val.patch
Type: application/octet-stream
Size: 4003 bytes
Desc: 0004-Adding-support-for-non-power-of-2-sized-interger-Val.patch
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20120706/aab39e24/attachment-0004.obj>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0005-Change-the-default-results-from-getOperationAction-t.patch
Type: application/octet-stream
Size: 3117 bytes
Desc: 0005-Change-the-default-results-from-getOperationAction-t.patch
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20120706/aab39e24/attachment-0005.obj>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0006-Cleanup-Use-MVT-instead-of-EVT.-Clean-up-loop-logic.patch
Type: application/octet-stream
Size: 2595 bytes
Desc: 0006-Cleanup-Use-MVT-instead-of-EVT.-Clean-up-loop-logic.patch
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20120706/aab39e24/attachment-0006.obj>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0007-Account-for-non-power-of-2-sized-ValueTypes-in.patch
Type: application/octet-stream
Size: 1636 bytes
Desc: 0007-Account-for-non-power-of-2-sized-ValueTypes-in.patch
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20120706/aab39e24/attachment-0007.obj>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0008-Simplify-handling-of-the-remainder-in-FindOptimalMem.patch
Type: application/octet-stream
Size: 4397 bytes
Desc: 0008-Simplify-handling-of-the-remainder-in-FindOptimalMem.patch
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20120706/aab39e24/attachment-0008.obj>


More information about the llvm-commits mailing list