brintos

brintos / llvm-project-archived public Read only

0
0
Text · 996 B · 9a4bde0 Raw
34 lines · plain
1; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py2; RUN: llc -mtriple=x86_64-- < %s | FileCheck %s3; These sequences don't need neg instructions; they can be done with4; a single shift and sub each.5 6define i64 @foo(i64 %x, i64 %y, i64 %n) nounwind {7; CHECK-LABEL: foo:8; CHECK:       # %bb.0:9; CHECK-NEXT:    movq %rdx, %rcx10; CHECK-NEXT:    movq %rdi, %rax11; CHECK-NEXT:    # kill: def $cl killed $cl killed $rcx12; CHECK-NEXT:    shlq %cl, %rsi13; CHECK-NEXT:    subq %rsi, %rax14; CHECK-NEXT:    retq15  %a = sub i64 0, %y16  %b = shl i64 %a, %n17  %c = add i64 %b, %x18  ret i64 %c19}20define i64 @boo(i64 %x, i64 %y, i64 %n) nounwind {21; CHECK-LABEL: boo:22; CHECK:       # %bb.0:23; CHECK-NEXT:    movq %rdx, %rcx24; CHECK-NEXT:    movq %rdi, %rax25; CHECK-NEXT:    # kill: def $cl killed $cl killed $rcx26; CHECK-NEXT:    shlq %cl, %rsi27; CHECK-NEXT:    subq %rsi, %rax28; CHECK-NEXT:    retq29  %a = sub i64 0, %y30  %b = shl i64 %a, %n31  %c = add i64 %x, %b32  ret i64 %c33}34