diff options
| author | Anton Korobeynikov <anton@korobeynikov.info> | 2019-01-09 13:03:01 +0000 |
|---|---|---|
| committer | Anton Korobeynikov <anton@korobeynikov.info> | 2019-01-09 13:03:01 +0000 |
| commit | c18e90369d313932cb50446baf38c2f85ed72e40 (patch) | |
| tree | 507ef4de50fea81006a893dd24e28575ab9f41c7 /llvm/test/CodeGen/MSP430 | |
| parent | 2b0094b0514348feaf67c9e56bd24c307b93e9ca (diff) | |
| download | bcm5719-llvm-c18e90369d313932cb50446baf38c2f85ed72e40.tar.gz bcm5719-llvm-c18e90369d313932cb50446baf38c2f85ed72e40.zip | |
[MSP430] Optimize 'shl x, 8[+ N] -> swpb(zext(x)) [<< N]' for i16
Perform additional simplification to reduce shift amount.
Patch by Kristina Bessonova!
Differential Revision: https://reviews.llvm.org/D56016
llvm-svn: 350712
Diffstat (limited to 'llvm/test/CodeGen/MSP430')
| -rw-r--r-- | llvm/test/CodeGen/MSP430/shifts.ll | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/llvm/test/CodeGen/MSP430/shifts.ll b/llvm/test/CodeGen/MSP430/shifts.ll index 073251943d0..5a1fc9c324b 100644 --- a/llvm/test/CodeGen/MSP430/shifts.ll +++ b/llvm/test/CodeGen/MSP430/shifts.ll @@ -74,3 +74,14 @@ entry: %shr = lshr i16 %a, 10 ret i16 %shr } + +define i16 @lshl10_i16(i16 %a) #0 { +entry: +; CHECK-LABEL: lshl10_i16: +; CHECK: mov.b r12, r12 +; CHECK-NEXT: swpb r12 +; CHECK-NEXT: add r12, r12 +; CHECK-NEXT: add r12, r12 + %shl = shl i16 %a, 10 + ret i16 %shl +} |

