diff options
author | Alexander Ivchenko <alexander.ivchenko@intel.com> | 2018-03-14 11:23:57 +0000 |
---|---|---|
committer | Alexander Ivchenko <alexander.ivchenko@intel.com> | 2018-03-14 11:23:57 +0000 |
commit | 0bd4d8c901c95d8361580086b1eed43f88f755cd (patch) | |
tree | 96408fee769cb624286adde3db6f29af5188cced /clang/lib/CodeGen/CodeGenFunction.cpp | |
parent | 0dd81bab92f678ed16f80e4e0c2f55246b13c8b2 (diff) | |
download | bcm5719-llvm-0bd4d8c901c95d8361580086b1eed43f88f755cd.tar.gz bcm5719-llvm-0bd4d8c901c95d8361580086b1eed43f88f755cd.zip |
[GlobalISel][X86] Support G_LSHR/G_ASHR/G_SHL
Support G_LSHR/G_ASHR/G_SHL. We have 3 variance for
shift instructions : shift gpr, shift imm, shift 1.
Currently GlobalIsel TableGen generate patterns for
shift imm and shift 1, but with shiftCount i8.
In G_LSHR/G_ASHR/G_SHL like LLVM-IR both arguments
has the same type, so for now only shift i8 can use
auto generated TableGen patterns.
The support of G_SHL/G_ASHR enables tryCombineSExt
from LegalizationArtifactCombiner.h to hit, which
results in different legalization for the following tests:
LLVM :: CodeGen/X86/GlobalISel/ext-x86-64.ll
LLVM :: CodeGen/X86/GlobalISel/gep.ll
LLVM :: CodeGen/X86/GlobalISel/legalize-ext-x86-64.mir
-; X64-NEXT: movsbl %dil, %eax
+; X64-NEXT: movl $24, %ecx
+; X64-NEXT: # kill: def $cl killed $ecx
+; X64-NEXT: shll %cl, %edi
+; X64-NEXT: movl $24, %ecx
+; X64-NEXT: # kill: def $cl killed $ecx
+; X64-NEXT: sarl %cl, %edi
+; X64-NEXT: movl %edi, %eax
..which is not optimal and should be addressed later.
Rework of the patch by igorb
Reviewed By: igorb
Differential Revision: https://reviews.llvm.org/D44395
llvm-svn: 327499
Diffstat (limited to 'clang/lib/CodeGen/CodeGenFunction.cpp')
0 files changed, 0 insertions, 0 deletions