[PATCH][FastISel] Let the target decide first if it wants to materialize a constant.

Juergen Ributzka juergen at apple.com
Thu Aug 7 14:51:15 PDT 2014


Hi @ll,

I want to change the order in which FastISel tries to materialize a constant.

Originally it would try to use a simple target-independent approach, which can lead to the generation of inefficient code.

On X86 this would result in the use of movabsq to materialize any 64bit integer constant - even for simple and small values such as 0 and 1. Also
some very funny floating-point materialization could be observed too.

On AArch64 it would materialize the constant 0 in a register even the architecture has an actual "zero" register.

On ARM it would generate unnecessary mov instructions or not use mvn, etc

I want to simply change the order and always asks the target first if it likes to materialize the constant. The patches a pretty simple and straight forward, but since it changes the way how FastISel works with respect to constants I wanted everyone affected by it to have at least a quick look first.

Thanks

Cheers,
Juergen

-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0001-FastISel-AArch64-Cleanup-constant-materialization-co.patch
Type: application/octet-stream
Size: 5554 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20140807/3ac8608c/attachment.obj>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0002-FastISel-ARM-Fix-a-bug-in-the-integer-materializatio.patch
Type: application/octet-stream
Size: 1468 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20140807/3ac8608c/attachment-0001.obj>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0003-FastISel-ARM-Use-MOVT-MOVW-if-the-subtarget-requests.patch
Type: application/octet-stream
Size: 2135 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20140807/3ac8608c/attachment-0002.obj>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0004-FastISel-X86-Refactor-constant-materialization.-NFCI.patch
Type: application/octet-stream
Size: 6726 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20140807/3ac8608c/attachment-0003.obj>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0005-FastISel-Let-the-target-decide-first-if-it-wants-to-.patch
Type: application/octet-stream
Size: 13409 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20140807/3ac8608c/attachment-0004.obj>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0006-FastISel-AArch64-Make-use-of-the-zero-register-when-.patch
Type: application/octet-stream
Size: 6112 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20140807/3ac8608c/attachment-0005.obj>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0007-FastISel-X86-Emit-more-efficient-instructions-for-in.patch
Type: application/octet-stream
Size: 26227 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20140807/3ac8608c/attachment-0006.obj>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0008-FastISel-X86-Use-XOR-to-materialize-the-0-value.patch
Type: application/octet-stream
Size: 5285 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20140807/3ac8608c/attachment-0007.obj>


More information about the llvm-commits mailing list