diff options
author | Sanjay Patel <spatel@rotateright.com> | 2018-12-08 16:07:38 +0000 |
---|---|---|
committer | Sanjay Patel <spatel@rotateright.com> | 2018-12-08 16:07:38 +0000 |
commit | e767bf446840e65c5e84fbc89454c3d7d04b771d (patch) | |
tree | 2b0ddb4879092263ace9ed78143a42e239ac9928 /llvm/test/CodeGen/X86/clear-lowbits.ll | |
parent | 04461ee821d7713c870e4749f3a235c642ef60f8 (diff) | |
download | bcm5719-llvm-e767bf446840e65c5e84fbc89454c3d7d04b771d.tar.gz bcm5719-llvm-e767bf446840e65c5e84fbc89454c3d7d04b771d.zip |
[DAGCombiner] re-enable truncation of binops
This is effectively re-committing the changes from:
rL347917 (D54640)
rL348195 (D55126)
...which were effectively reverted here:
rL348604
...because the code had a bug that could induce infinite looping
or eventual out-of-memory compilation.
The bug was that this code did not guard against transforming
opaque constants. More details are in the post-commit mailing
list thread for r347917. A reduced test for that is included
in the x86 bool-math.ll file. (I wasn't able to reduce a PPC
backend test for this, but it was almost the same pattern.)
Original commit message for r347917:
The motivating case for this is shown in:
https://bugs.llvm.org/show_bug.cgi?id=32023
and the corresponding rot16.ll regression tests.
Because x86 scalar shift amounts are i8 values, we can end up with trunc-binop-trunc
sequences that don't get folded in IR.
As the TODO comments suggest, there will be regressions if we extend this (for x86,
we mostly seem to be missing LEA opportunities, but there are likely vector folds
missing too). I think those should be considered existing bugs because this is the
same transform that we do as an IR canonicalization in instcombine. We just need
more tests to make those visible independent of this patch.
llvm-svn: 348706
Diffstat (limited to 'llvm/test/CodeGen/X86/clear-lowbits.ll')
-rw-r--r-- | llvm/test/CodeGen/X86/clear-lowbits.ll | 114 |
1 files changed, 54 insertions, 60 deletions
diff --git a/llvm/test/CodeGen/X86/clear-lowbits.ll b/llvm/test/CodeGen/X86/clear-lowbits.ll index f29717e630f..be251eb99f2 100644 --- a/llvm/test/CodeGen/X86/clear-lowbits.ll +++ b/llvm/test/CodeGen/X86/clear-lowbits.ll @@ -866,10 +866,9 @@ define i16 @clear_lowbits16_ic0(i16 %val, i16 %numlowbits) nounwind { ; X86-NOBMI2-LABEL: clear_lowbits16_ic0: ; X86-NOBMI2: # %bb.0: ; X86-NOBMI2-NEXT: movzwl {{[0-9]+}}(%esp), %eax -; X86-NOBMI2-NEXT: movw $16, %cx -; X86-NOBMI2-NEXT: subw {{[0-9]+}}(%esp), %cx +; X86-NOBMI2-NEXT: movb $16, %cl +; X86-NOBMI2-NEXT: subb {{[0-9]+}}(%esp), %cl ; X86-NOBMI2-NEXT: shrl %cl, %eax -; X86-NOBMI2-NEXT: # kill: def $cl killed $cl killed $cx ; X86-NOBMI2-NEXT: shll %cl, %eax ; X86-NOBMI2-NEXT: # kill: def $ax killed $ax killed $eax ; X86-NOBMI2-NEXT: retl @@ -877,8 +876,8 @@ define i16 @clear_lowbits16_ic0(i16 %val, i16 %numlowbits) nounwind { ; X86-BMI2-LABEL: clear_lowbits16_ic0: ; X86-BMI2: # %bb.0: ; X86-BMI2-NEXT: movzwl {{[0-9]+}}(%esp), %eax -; X86-BMI2-NEXT: movw $16, %cx -; X86-BMI2-NEXT: subw {{[0-9]+}}(%esp), %cx +; X86-BMI2-NEXT: movb $16, %cl +; X86-BMI2-NEXT: subb {{[0-9]+}}(%esp), %cl ; X86-BMI2-NEXT: shrxl %ecx, %eax, %eax ; X86-BMI2-NEXT: shlxl %ecx, %eax, %eax ; X86-BMI2-NEXT: # kill: def $ax killed $ax killed $eax @@ -887,10 +886,9 @@ define i16 @clear_lowbits16_ic0(i16 %val, i16 %numlowbits) nounwind { ; X64-NOBMI2-LABEL: clear_lowbits16_ic0: ; X64-NOBMI2: # %bb.0: ; X64-NOBMI2-NEXT: movzwl %di, %eax -; X64-NOBMI2-NEXT: movl $16, %ecx -; X64-NOBMI2-NEXT: subl %esi, %ecx +; X64-NOBMI2-NEXT: movb $16, %cl +; X64-NOBMI2-NEXT: subb %sil, %cl ; X64-NOBMI2-NEXT: shrl %cl, %eax -; X64-NOBMI2-NEXT: # kill: def $cl killed $cl killed $ecx ; X64-NOBMI2-NEXT: shll %cl, %eax ; X64-NOBMI2-NEXT: # kill: def $ax killed $ax killed $eax ; X64-NOBMI2-NEXT: retq @@ -898,8 +896,8 @@ define i16 @clear_lowbits16_ic0(i16 %val, i16 %numlowbits) nounwind { ; X64-BMI2-LABEL: clear_lowbits16_ic0: ; X64-BMI2: # %bb.0: ; X64-BMI2-NEXT: movzwl %di, %eax -; X64-BMI2-NEXT: movl $16, %ecx -; X64-BMI2-NEXT: subl %esi, %ecx +; X64-BMI2-NEXT: movb $16, %cl +; X64-BMI2-NEXT: subb %sil, %cl ; X64-BMI2-NEXT: shrxl %ecx, %eax, %eax ; X64-BMI2-NEXT: shlxl %ecx, %eax, %eax ; X64-BMI2-NEXT: # kill: def $ax killed $ax killed $eax @@ -962,10 +960,9 @@ define i16 @clear_lowbits16_ic2_load(i16* %w, i16 %numlowbits) nounwind { ; X86-NOBMI2: # %bb.0: ; X86-NOBMI2-NEXT: movl {{[0-9]+}}(%esp), %eax ; X86-NOBMI2-NEXT: movzwl (%eax), %eax -; X86-NOBMI2-NEXT: movw $16, %cx -; X86-NOBMI2-NEXT: subw {{[0-9]+}}(%esp), %cx +; X86-NOBMI2-NEXT: movb $16, %cl +; X86-NOBMI2-NEXT: subb {{[0-9]+}}(%esp), %cl ; X86-NOBMI2-NEXT: shrl %cl, %eax -; X86-NOBMI2-NEXT: # kill: def $cl killed $cl killed $cx ; X86-NOBMI2-NEXT: shll %cl, %eax ; X86-NOBMI2-NEXT: # kill: def $ax killed $ax killed $eax ; X86-NOBMI2-NEXT: retl @@ -974,8 +971,8 @@ define i16 @clear_lowbits16_ic2_load(i16* %w, i16 %numlowbits) nounwind { ; X86-BMI2: # %bb.0: ; X86-BMI2-NEXT: movl {{[0-9]+}}(%esp), %eax ; X86-BMI2-NEXT: movzwl (%eax), %eax -; X86-BMI2-NEXT: movw $16, %cx -; X86-BMI2-NEXT: subw {{[0-9]+}}(%esp), %cx +; X86-BMI2-NEXT: movb $16, %cl +; X86-BMI2-NEXT: subb {{[0-9]+}}(%esp), %cl ; X86-BMI2-NEXT: shrxl %ecx, %eax, %eax ; X86-BMI2-NEXT: shlxl %ecx, %eax, %eax ; X86-BMI2-NEXT: # kill: def $ax killed $ax killed $eax @@ -984,10 +981,9 @@ define i16 @clear_lowbits16_ic2_load(i16* %w, i16 %numlowbits) nounwind { ; X64-NOBMI2-LABEL: clear_lowbits16_ic2_load: ; X64-NOBMI2: # %bb.0: ; X64-NOBMI2-NEXT: movzwl (%rdi), %eax -; X64-NOBMI2-NEXT: movl $16, %ecx -; X64-NOBMI2-NEXT: subl %esi, %ecx +; X64-NOBMI2-NEXT: movb $16, %cl +; X64-NOBMI2-NEXT: subb %sil, %cl ; X64-NOBMI2-NEXT: shrl %cl, %eax -; X64-NOBMI2-NEXT: # kill: def $cl killed $cl killed $ecx ; X64-NOBMI2-NEXT: shll %cl, %eax ; X64-NOBMI2-NEXT: # kill: def $ax killed $ax killed $eax ; X64-NOBMI2-NEXT: retq @@ -995,8 +991,8 @@ define i16 @clear_lowbits16_ic2_load(i16* %w, i16 %numlowbits) nounwind { ; X64-BMI2-LABEL: clear_lowbits16_ic2_load: ; X64-BMI2: # %bb.0: ; X64-BMI2-NEXT: movzwl (%rdi), %eax -; X64-BMI2-NEXT: movl $16, %ecx -; X64-BMI2-NEXT: subl %esi, %ecx +; X64-BMI2-NEXT: movb $16, %cl +; X64-BMI2-NEXT: subb %sil, %cl ; X64-BMI2-NEXT: shrxl %ecx, %eax, %eax ; X64-BMI2-NEXT: shlxl %ecx, %eax, %eax ; X64-BMI2-NEXT: # kill: def $ax killed $ax killed $eax @@ -1062,10 +1058,9 @@ define i16 @clear_lowbits16_ic4_commutative(i16 %val, i16 %numlowbits) nounwind ; X86-NOBMI2-LABEL: clear_lowbits16_ic4_commutative: ; X86-NOBMI2: # %bb.0: ; X86-NOBMI2-NEXT: movzwl {{[0-9]+}}(%esp), %eax -; X86-NOBMI2-NEXT: movw $16, %cx -; X86-NOBMI2-NEXT: subw {{[0-9]+}}(%esp), %cx +; X86-NOBMI2-NEXT: movb $16, %cl +; X86-NOBMI2-NEXT: subb {{[0-9]+}}(%esp), %cl ; X86-NOBMI2-NEXT: shrl %cl, %eax -; X86-NOBMI2-NEXT: # kill: def $cl killed $cl killed $cx ; X86-NOBMI2-NEXT: shll %cl, %eax ; X86-NOBMI2-NEXT: # kill: def $ax killed $ax killed $eax ; X86-NOBMI2-NEXT: retl @@ -1073,8 +1068,8 @@ define i16 @clear_lowbits16_ic4_commutative(i16 %val, i16 %numlowbits) nounwind ; X86-BMI2-LABEL: clear_lowbits16_ic4_commutative: ; X86-BMI2: # %bb.0: ; X86-BMI2-NEXT: movzwl {{[0-9]+}}(%esp), %eax -; X86-BMI2-NEXT: movw $16, %cx -; X86-BMI2-NEXT: subw {{[0-9]+}}(%esp), %cx +; X86-BMI2-NEXT: movb $16, %cl +; X86-BMI2-NEXT: subb {{[0-9]+}}(%esp), %cl ; X86-BMI2-NEXT: shrxl %ecx, %eax, %eax ; X86-BMI2-NEXT: shlxl %ecx, %eax, %eax ; X86-BMI2-NEXT: # kill: def $ax killed $ax killed $eax @@ -1083,10 +1078,9 @@ define i16 @clear_lowbits16_ic4_commutative(i16 %val, i16 %numlowbits) nounwind ; X64-NOBMI2-LABEL: clear_lowbits16_ic4_commutative: ; X64-NOBMI2: # %bb.0: ; X64-NOBMI2-NEXT: movzwl %di, %eax -; X64-NOBMI2-NEXT: movl $16, %ecx -; X64-NOBMI2-NEXT: subl %esi, %ecx +; X64-NOBMI2-NEXT: movb $16, %cl +; X64-NOBMI2-NEXT: subb %sil, %cl ; X64-NOBMI2-NEXT: shrl %cl, %eax -; X64-NOBMI2-NEXT: # kill: def $cl killed $cl killed $ecx ; X64-NOBMI2-NEXT: shll %cl, %eax ; X64-NOBMI2-NEXT: # kill: def $ax killed $ax killed $eax ; X64-NOBMI2-NEXT: retq @@ -1094,8 +1088,8 @@ define i16 @clear_lowbits16_ic4_commutative(i16 %val, i16 %numlowbits) nounwind ; X64-BMI2-LABEL: clear_lowbits16_ic4_commutative: ; X64-BMI2: # %bb.0: ; X64-BMI2-NEXT: movzwl %di, %eax -; X64-BMI2-NEXT: movl $16, %ecx -; X64-BMI2-NEXT: subl %esi, %ecx +; X64-BMI2-NEXT: movb $16, %cl +; X64-BMI2-NEXT: subb %sil, %cl ; X64-BMI2-NEXT: shrxl %ecx, %eax, %eax ; X64-BMI2-NEXT: shlxl %ecx, %eax, %eax ; X64-BMI2-NEXT: # kill: def $ax killed $ax killed $eax @@ -1113,7 +1107,7 @@ define i32 @clear_lowbits32_ic0(i32 %val, i32 %numlowbits) nounwind { ; X86-NOBMI2: # %bb.0: ; X86-NOBMI2-NEXT: movl {{[0-9]+}}(%esp), %eax ; X86-NOBMI2-NEXT: xorl %ecx, %ecx -; X86-NOBMI2-NEXT: subl {{[0-9]+}}(%esp), %ecx +; X86-NOBMI2-NEXT: subb {{[0-9]+}}(%esp), %cl ; X86-NOBMI2-NEXT: shrl %cl, %eax ; X86-NOBMI2-NEXT: # kill: def $cl killed $cl killed $ecx ; X86-NOBMI2-NEXT: shll %cl, %eax @@ -1122,7 +1116,7 @@ define i32 @clear_lowbits32_ic0(i32 %val, i32 %numlowbits) nounwind { ; X86-BMI2-LABEL: clear_lowbits32_ic0: ; X86-BMI2: # %bb.0: ; X86-BMI2-NEXT: xorl %eax, %eax -; X86-BMI2-NEXT: subl {{[0-9]+}}(%esp), %eax +; X86-BMI2-NEXT: subb {{[0-9]+}}(%esp), %al ; X86-BMI2-NEXT: shrxl %eax, {{[0-9]+}}(%esp), %ecx ; X86-BMI2-NEXT: shlxl %eax, %ecx, %eax ; X86-BMI2-NEXT: retl @@ -1131,7 +1125,7 @@ define i32 @clear_lowbits32_ic0(i32 %val, i32 %numlowbits) nounwind { ; X64-NOBMI2: # %bb.0: ; X64-NOBMI2-NEXT: movl %esi, %ecx ; X64-NOBMI2-NEXT: movl %edi, %eax -; X64-NOBMI2-NEXT: negl %ecx +; X64-NOBMI2-NEXT: negb %cl ; X64-NOBMI2-NEXT: shrl %cl, %eax ; X64-NOBMI2-NEXT: # kill: def $cl killed $cl killed $ecx ; X64-NOBMI2-NEXT: shll %cl, %eax @@ -1139,7 +1133,7 @@ define i32 @clear_lowbits32_ic0(i32 %val, i32 %numlowbits) nounwind { ; ; X64-BMI2-LABEL: clear_lowbits32_ic0: ; X64-BMI2: # %bb.0: -; X64-BMI2-NEXT: negl %esi +; X64-BMI2-NEXT: negb %sil ; X64-BMI2-NEXT: shrxl %esi, %edi, %eax ; X64-BMI2-NEXT: shlxl %esi, %eax, %eax ; X64-BMI2-NEXT: retq @@ -1197,7 +1191,7 @@ define i32 @clear_lowbits32_ic2_load(i32* %w, i32 %numlowbits) nounwind { ; X86-NOBMI2-NEXT: movl {{[0-9]+}}(%esp), %eax ; X86-NOBMI2-NEXT: movl (%eax), %eax ; X86-NOBMI2-NEXT: xorl %ecx, %ecx -; X86-NOBMI2-NEXT: subl {{[0-9]+}}(%esp), %ecx +; X86-NOBMI2-NEXT: subb {{[0-9]+}}(%esp), %cl ; X86-NOBMI2-NEXT: shrl %cl, %eax ; X86-NOBMI2-NEXT: # kill: def $cl killed $cl killed $ecx ; X86-NOBMI2-NEXT: shll %cl, %eax @@ -1207,7 +1201,7 @@ define i32 @clear_lowbits32_ic2_load(i32* %w, i32 %numlowbits) nounwind { ; X86-BMI2: # %bb.0: ; X86-BMI2-NEXT: movl {{[0-9]+}}(%esp), %eax ; X86-BMI2-NEXT: xorl %ecx, %ecx -; X86-BMI2-NEXT: subl {{[0-9]+}}(%esp), %ecx +; X86-BMI2-NEXT: subb {{[0-9]+}}(%esp), %cl ; X86-BMI2-NEXT: shrxl %ecx, (%eax), %eax ; X86-BMI2-NEXT: shlxl %ecx, %eax, %eax ; X86-BMI2-NEXT: retl @@ -1216,7 +1210,7 @@ define i32 @clear_lowbits32_ic2_load(i32* %w, i32 %numlowbits) nounwind { ; X64-NOBMI2: # %bb.0: ; X64-NOBMI2-NEXT: movl %esi, %ecx ; X64-NOBMI2-NEXT: movl (%rdi), %eax -; X64-NOBMI2-NEXT: negl %ecx +; X64-NOBMI2-NEXT: negb %cl ; X64-NOBMI2-NEXT: shrl %cl, %eax ; X64-NOBMI2-NEXT: # kill: def $cl killed $cl killed $ecx ; X64-NOBMI2-NEXT: shll %cl, %eax @@ -1224,7 +1218,7 @@ define i32 @clear_lowbits32_ic2_load(i32* %w, i32 %numlowbits) nounwind { ; ; X64-BMI2-LABEL: clear_lowbits32_ic2_load: ; X64-BMI2: # %bb.0: -; X64-BMI2-NEXT: negl %esi +; X64-BMI2-NEXT: negb %sil ; X64-BMI2-NEXT: shrxl %esi, (%rdi), %eax ; X64-BMI2-NEXT: shlxl %esi, %eax, %eax ; X64-BMI2-NEXT: retq @@ -1285,7 +1279,7 @@ define i32 @clear_lowbits32_ic4_commutative(i32 %val, i32 %numlowbits) nounwind ; X86-NOBMI2: # %bb.0: ; X86-NOBMI2-NEXT: movl {{[0-9]+}}(%esp), %eax ; X86-NOBMI2-NEXT: xorl %ecx, %ecx -; X86-NOBMI2-NEXT: subl {{[0-9]+}}(%esp), %ecx +; X86-NOBMI2-NEXT: subb {{[0-9]+}}(%esp), %cl ; X86-NOBMI2-NEXT: shrl %cl, %eax ; X86-NOBMI2-NEXT: # kill: def $cl killed $cl killed $ecx ; X86-NOBMI2-NEXT: shll %cl, %eax @@ -1294,7 +1288,7 @@ define i32 @clear_lowbits32_ic4_commutative(i32 %val, i32 %numlowbits) nounwind ; X86-BMI2-LABEL: clear_lowbits32_ic4_commutative: ; X86-BMI2: # %bb.0: ; X86-BMI2-NEXT: xorl %eax, %eax -; X86-BMI2-NEXT: subl {{[0-9]+}}(%esp), %eax +; X86-BMI2-NEXT: subb {{[0-9]+}}(%esp), %al ; X86-BMI2-NEXT: shrxl %eax, {{[0-9]+}}(%esp), %ecx ; X86-BMI2-NEXT: shlxl %eax, %ecx, %eax ; X86-BMI2-NEXT: retl @@ -1303,7 +1297,7 @@ define i32 @clear_lowbits32_ic4_commutative(i32 %val, i32 %numlowbits) nounwind ; X64-NOBMI2: # %bb.0: ; X64-NOBMI2-NEXT: movl %esi, %ecx ; X64-NOBMI2-NEXT: movl %edi, %eax -; X64-NOBMI2-NEXT: negl %ecx +; X64-NOBMI2-NEXT: negb %cl ; X64-NOBMI2-NEXT: shrl %cl, %eax ; X64-NOBMI2-NEXT: # kill: def $cl killed $cl killed $ecx ; X64-NOBMI2-NEXT: shll %cl, %eax @@ -1311,7 +1305,7 @@ define i32 @clear_lowbits32_ic4_commutative(i32 %val, i32 %numlowbits) nounwind ; ; X64-BMI2-LABEL: clear_lowbits32_ic4_commutative: ; X64-BMI2: # %bb.0: -; X64-BMI2-NEXT: negl %esi +; X64-BMI2-NEXT: negb %sil ; X64-BMI2-NEXT: shrxl %esi, %edi, %eax ; X64-BMI2-NEXT: shlxl %esi, %eax, %eax ; X64-BMI2-NEXT: retq @@ -1326,8 +1320,8 @@ define i32 @clear_lowbits32_ic4_commutative(i32 %val, i32 %numlowbits) nounwind define i64 @clear_lowbits64_ic0(i64 %val, i64 %numlowbits) nounwind { ; X86-NOBMI2-LABEL: clear_lowbits64_ic0: ; X86-NOBMI2: # %bb.0: -; X86-NOBMI2-NEXT: movl $64, %ecx -; X86-NOBMI2-NEXT: subl {{[0-9]+}}(%esp), %ecx +; X86-NOBMI2-NEXT: movb $64, %cl +; X86-NOBMI2-NEXT: subb {{[0-9]+}}(%esp), %cl ; X86-NOBMI2-NEXT: movl $-1, %edx ; X86-NOBMI2-NEXT: movl $-1, %eax ; X86-NOBMI2-NEXT: shll %cl, %eax @@ -1344,8 +1338,8 @@ define i64 @clear_lowbits64_ic0(i64 %val, i64 %numlowbits) nounwind { ; ; X86-BMI2-LABEL: clear_lowbits64_ic0: ; X86-BMI2: # %bb.0: -; X86-BMI2-NEXT: movl $64, %ecx -; X86-BMI2-NEXT: subl {{[0-9]+}}(%esp), %ecx +; X86-BMI2-NEXT: movb $64, %cl +; X86-BMI2-NEXT: subb {{[0-9]+}}(%esp), %cl ; X86-BMI2-NEXT: movl $-1, %edx ; X86-BMI2-NEXT: shlxl %ecx, %edx, %eax ; X86-BMI2-NEXT: shldl %cl, %edx, %edx @@ -1363,7 +1357,7 @@ define i64 @clear_lowbits64_ic0(i64 %val, i64 %numlowbits) nounwind { ; X64-NOBMI2: # %bb.0: ; X64-NOBMI2-NEXT: movq %rsi, %rcx ; X64-NOBMI2-NEXT: movq %rdi, %rax -; X64-NOBMI2-NEXT: negl %ecx +; X64-NOBMI2-NEXT: negb %cl ; X64-NOBMI2-NEXT: shrq %cl, %rax ; X64-NOBMI2-NEXT: # kill: def $cl killed $cl killed $rcx ; X64-NOBMI2-NEXT: shlq %cl, %rax @@ -1371,7 +1365,7 @@ define i64 @clear_lowbits64_ic0(i64 %val, i64 %numlowbits) nounwind { ; ; X64-BMI2-LABEL: clear_lowbits64_ic0: ; X64-BMI2: # %bb.0: -; X64-BMI2-NEXT: negl %esi +; X64-BMI2-NEXT: negb %sil ; X64-BMI2-NEXT: shrxq %rsi, %rdi, %rax ; X64-BMI2-NEXT: shlxq %rsi, %rax, %rax ; X64-BMI2-NEXT: retq @@ -1446,8 +1440,8 @@ define i64 @clear_lowbits64_ic2_load(i64* %w, i64 %numlowbits) nounwind { ; X86-NOBMI2: # %bb.0: ; X86-NOBMI2-NEXT: pushl %esi ; X86-NOBMI2-NEXT: movl {{[0-9]+}}(%esp), %esi -; X86-NOBMI2-NEXT: movl $64, %ecx -; X86-NOBMI2-NEXT: subl {{[0-9]+}}(%esp), %ecx +; X86-NOBMI2-NEXT: movb $64, %cl +; X86-NOBMI2-NEXT: subb {{[0-9]+}}(%esp), %cl ; X86-NOBMI2-NEXT: movl $-1, %edx ; X86-NOBMI2-NEXT: movl $-1, %eax ; X86-NOBMI2-NEXT: shll %cl, %eax @@ -1467,8 +1461,8 @@ define i64 @clear_lowbits64_ic2_load(i64* %w, i64 %numlowbits) nounwind { ; X86-BMI2: # %bb.0: ; X86-BMI2-NEXT: pushl %esi ; X86-BMI2-NEXT: movl {{[0-9]+}}(%esp), %esi -; X86-BMI2-NEXT: movl $64, %ecx -; X86-BMI2-NEXT: subl {{[0-9]+}}(%esp), %ecx +; X86-BMI2-NEXT: movb $64, %cl +; X86-BMI2-NEXT: subb {{[0-9]+}}(%esp), %cl ; X86-BMI2-NEXT: movl $-1, %edx ; X86-BMI2-NEXT: shlxl %ecx, %edx, %eax ; X86-BMI2-NEXT: shldl %cl, %edx, %edx @@ -1487,7 +1481,7 @@ define i64 @clear_lowbits64_ic2_load(i64* %w, i64 %numlowbits) nounwind { ; X64-NOBMI2: # %bb.0: ; X64-NOBMI2-NEXT: movq %rsi, %rcx ; X64-NOBMI2-NEXT: movq (%rdi), %rax -; X64-NOBMI2-NEXT: negl %ecx +; X64-NOBMI2-NEXT: negb %cl ; X64-NOBMI2-NEXT: shrq %cl, %rax ; X64-NOBMI2-NEXT: # kill: def $cl killed $cl killed $rcx ; X64-NOBMI2-NEXT: shlq %cl, %rax @@ -1495,7 +1489,7 @@ define i64 @clear_lowbits64_ic2_load(i64* %w, i64 %numlowbits) nounwind { ; ; X64-BMI2-LABEL: clear_lowbits64_ic2_load: ; X64-BMI2: # %bb.0: -; X64-BMI2-NEXT: negl %esi +; X64-BMI2-NEXT: negb %sil ; X64-BMI2-NEXT: shrxq %rsi, (%rdi), %rax ; X64-BMI2-NEXT: shlxq %rsi, %rax, %rax ; X64-BMI2-NEXT: retq @@ -1576,8 +1570,8 @@ define i64 @clear_lowbits64_ic3_load_indexzext(i64* %w, i8 %numlowbits) nounwind define i64 @clear_lowbits64_ic4_commutative(i64 %val, i64 %numlowbits) nounwind { ; X86-NOBMI2-LABEL: clear_lowbits64_ic4_commutative: ; X86-NOBMI2: # %bb.0: -; X86-NOBMI2-NEXT: movl $64, %ecx -; X86-NOBMI2-NEXT: subl {{[0-9]+}}(%esp), %ecx +; X86-NOBMI2-NEXT: movb $64, %cl +; X86-NOBMI2-NEXT: subb {{[0-9]+}}(%esp), %cl ; X86-NOBMI2-NEXT: movl $-1, %edx ; X86-NOBMI2-NEXT: movl $-1, %eax ; X86-NOBMI2-NEXT: shll %cl, %eax @@ -1594,8 +1588,8 @@ define i64 @clear_lowbits64_ic4_commutative(i64 %val, i64 %numlowbits) nounwind ; ; X86-BMI2-LABEL: clear_lowbits64_ic4_commutative: ; X86-BMI2: # %bb.0: -; X86-BMI2-NEXT: movl $64, %ecx -; X86-BMI2-NEXT: subl {{[0-9]+}}(%esp), %ecx +; X86-BMI2-NEXT: movb $64, %cl +; X86-BMI2-NEXT: subb {{[0-9]+}}(%esp), %cl ; X86-BMI2-NEXT: movl $-1, %edx ; X86-BMI2-NEXT: shlxl %ecx, %edx, %eax ; X86-BMI2-NEXT: shldl %cl, %edx, %edx @@ -1613,7 +1607,7 @@ define i64 @clear_lowbits64_ic4_commutative(i64 %val, i64 %numlowbits) nounwind ; X64-NOBMI2: # %bb.0: ; X64-NOBMI2-NEXT: movq %rsi, %rcx ; X64-NOBMI2-NEXT: movq %rdi, %rax -; X64-NOBMI2-NEXT: negl %ecx +; X64-NOBMI2-NEXT: negb %cl ; X64-NOBMI2-NEXT: shrq %cl, %rax ; X64-NOBMI2-NEXT: # kill: def $cl killed $cl killed $rcx ; X64-NOBMI2-NEXT: shlq %cl, %rax @@ -1621,7 +1615,7 @@ define i64 @clear_lowbits64_ic4_commutative(i64 %val, i64 %numlowbits) nounwind ; ; X64-BMI2-LABEL: clear_lowbits64_ic4_commutative: ; X64-BMI2: # %bb.0: -; X64-BMI2-NEXT: negl %esi +; X64-BMI2-NEXT: negb %sil ; X64-BMI2-NEXT: shrxq %rsi, %rdi, %rax ; X64-BMI2-NEXT: shlxq %rsi, %rax, %rax ; X64-BMI2-NEXT: retq |