Home | History | Annotate | Download | only in X86
      1 ; RUN: llc -march=x86 < %s | FileCheck %s
      2 
      3 ; No attributes, should not use idiv
      4 define i32 @test1(i32 inreg %x) {
      5 entry:
      6   %div = sdiv i32 %x, 16
      7   ret i32 %div
      8 ; CHECK-LABEL: test1:
      9 ; CHECK-NOT: idivl
     10 ; CHECK: ret
     11 }
     12 
     13 ; Has minsize (-Oz) attribute, should generate idiv
     14 define i32 @test2(i32 inreg %x) minsize {
     15 entry:
     16   %div = sdiv i32 %x, 16
     17   ret i32 %div
     18 ; CHECK-LABEL: test2:
     19 ; CHECK: idivl
     20 ; CHECK: ret
     21 }
     22 
     23 ; Has optsize (-Os) attribute, should not generate idiv
     24 define i32 @test3(i32 inreg %x) optsize {
     25 entry:
     26   %div = sdiv i32 %x, 16
     27   ret i32 %div
     28 ; CHECK-LABEL: test3:
     29 ; CHECK-NOT: idivl
     30 ; CHECK: ret
     31 }
     32 
     33 
     34