| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,92 @@ | ||
| ; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py | ||
| ; RUN: llc -mtriple=lanai -stop-after=finalize-isel -debug-only=isel -o /dev/null %s 2>&1 | FileCheck %s | ||
|
|
||
| define i64 @i64_test(i64 %i) nounwind readnone { | ||
| ; CHECK-LABEL: i64_test: | ||
| ; CHECK: SelectionDAG has 22 nodes: | ||
| ; CHECK-NEXT: t0: ch = EntryToken | ||
| ; CHECK-NEXT: t5: i32,ch = LDW_RI<Mem:(load (s32) from %fixed-stack.0)> TargetFrameIndex:i32<-2>, TargetConstant:i32<0>, TargetConstant:i32<0>, t0 | ||
| ; CHECK-NEXT: t7: i32 = ADD_I_LO TargetFrameIndex:i32<0>, TargetConstant:i32<0> | ||
| ; CHECK-NEXT: t29: i32 = OR_I_LO t7, TargetConstant:i32<4> | ||
| ; CHECK-NEXT: t22: i32,ch = LDW_RI<Mem:(dereferenceable load (s32) from %ir.loc + 4, basealign 8)> t29, TargetConstant:i32<0>, TargetConstant:i32<0>, t0 | ||
| ; CHECK-NEXT: t24: i32 = ADD_R t5, t22, TargetConstant:i32<0> | ||
| ; CHECK-NEXT: t3: i32,ch = LDW_RI<Mem:(load (s32) from %fixed-stack.1, align 8)> TargetFrameIndex:i32<-1>, TargetConstant:i32<0>, TargetConstant:i32<0>, t0 | ||
| ; CHECK-NEXT: t19: i32,ch = LDW_RI<Mem:(dereferenceable load (s32) from %ir.loc, align 8)> TargetFrameIndex:i32<0>, TargetConstant:i32<0>, TargetConstant:i32<0>, t0 | ||
| ; CHECK-NEXT: t25: i32 = ADD_R t3, t19, TargetConstant:i32<0> | ||
| ; CHECK-NEXT: t30: i32,glue = SFSUB_F_RR t24, t5 | ||
| ; CHECK-NEXT: t31: i32 = SCC TargetConstant:i32<4>, t30:1 | ||
| ; CHECK-NEXT: t28: i32 = ADD_R t25, t31, TargetConstant:i32<0> | ||
| ; CHECK-NEXT: t15: ch,glue = CopyToReg t0, Register:i32 $rv, t28 | ||
| ; CHECK-NEXT: t17: ch,glue = CopyToReg t15, Register:i32 $r9, t24, t15:1 | ||
| ; CHECK-NEXT: t18: ch = RET Register:i32 $rv, Register:i32 $r9, t17, t17:1 | ||
| ; CHECK-EMPTY: | ||
| %loc = alloca i64 | ||
| %j = load i64, i64 * %loc | ||
| %r = add i64 %i, %j | ||
| ret i64 %r | ||
| } | ||
|
|
||
| define i64 @i32_test(i32 %i) nounwind readnone { | ||
| ; CHECK-LABEL: i32_test: | ||
| ; CHECK: SelectionDAG has 14 nodes: | ||
| ; CHECK-NEXT: t0: ch = EntryToken | ||
| ; CHECK-NEXT: t21: i32,ch = CopyFromReg t0, Register:i32 $r0 | ||
| ; CHECK-NEXT: t13: ch,glue = CopyToReg t0, Register:i32 $rv, t21 | ||
| ; CHECK-NEXT: t3: i32,ch = LDW_RI<Mem:(load (s32) from %fixed-stack.0, align 8)> TargetFrameIndex:i32<-1>, TargetConstant:i32<0>, TargetConstant:i32<0>, t0 | ||
| ; CHECK-NEXT: t6: i32,ch = LDW_RI<Mem:(dereferenceable load (s32) from %ir.loc)> TargetFrameIndex:i32<0>, TargetConstant:i32<0>, TargetConstant:i32<0>, t0 | ||
| ; CHECK-NEXT: t7: i32 = ADD_R t3, t6, TargetConstant:i32<0> | ||
| ; CHECK-NEXT: t15: ch,glue = CopyToReg t13, Register:i32 $r9, t7, t13:1 | ||
| ; CHECK-NEXT: t16: ch = RET Register:i32 $rv, Register:i32 $r9, t15, t15:1 | ||
| ; CHECK-EMPTY: | ||
| %loc = alloca i32 | ||
| %j = load i32, i32 * %loc | ||
| %r = add i32 %i, %j | ||
| %ext = zext i32 %r to i64 | ||
| ret i64 %ext | ||
| } | ||
|
|
||
| define i64 @i16_test(i16 %i) nounwind readnone { | ||
| ; CHECK-LABEL: i16_test: | ||
| ; CHECK: SelectionDAG has 19 nodes: | ||
| ; CHECK-NEXT: t0: ch = EntryToken | ||
| ; CHECK-NEXT: t33: i32,ch = CopyFromReg t0, Register:i32 $r0 | ||
| ; CHECK-NEXT: t14: ch,glue = CopyToReg t0, Register:i32 $rv, t33 | ||
| ; CHECK-NEXT: t1: i32 = ADD_I_LO TargetFrameIndex:i32<-1>, TargetConstant:i32<0> | ||
| ; CHECK-NEXT: t21: i32 = OR_I_LO t1, TargetConstant:i32<2> | ||
| ; CHECK-NEXT: t23: i32,ch = LDHz_RI<Mem:(load (s16) from %fixed-stack.0 + 2)> t21, TargetConstant:i32<0>, TargetConstant:i32<0>, t0 | ||
| ; CHECK-NEXT: t22: i32,ch = LDHz_RI<Mem:(dereferenceable load (s16) from %ir.loc)> TargetFrameIndex:i32<0>, TargetConstant:i32<0>, TargetConstant:i32<0>, t0 | ||
| ; CHECK-NEXT: t24: i32 = ADD_R t23, t22, TargetConstant:i32<0> | ||
| ; CHECK-NEXT: t27: i32 = AND_I_HI t24, TargetConstant:i32<0> | ||
| ; CHECK-NEXT: t16: ch,glue = CopyToReg t14, Register:i32 $r9, t27, t14:1 | ||
| ; CHECK-NEXT: t28: i32 = TargetConstant<65535> | ||
| ; CHECK-NEXT: t17: ch = RET Register:i32 $rv, Register:i32 $r9, t16, t16:1 | ||
| ; CHECK-EMPTY: | ||
| %loc = alloca i16 | ||
| %j = load i16, i16 * %loc | ||
| %r = add i16 %i, %j | ||
| %ext = zext i16 %r to i64 | ||
| ret i64 %ext | ||
| } | ||
|
|
||
| define i64 @i8_test(i8 %i) nounwind readnone { | ||
| ; CHECK-LABEL: i8_test: | ||
| ; CHECK: SelectionDAG has 20 nodes: | ||
| ; CHECK-NEXT: t0: ch = EntryToken | ||
| ; CHECK-NEXT: t33: i32,ch = CopyFromReg t0, Register:i32 $r0 | ||
| ; CHECK-NEXT: t14: ch,glue = CopyToReg t0, Register:i32 $rv, t33 | ||
| ; CHECK-NEXT: t1: i32 = ADD_I_LO TargetFrameIndex:i32<-1>, TargetConstant:i32<0> | ||
| ; CHECK-NEXT: t21: i32 = OR_I_LO t1, TargetConstant:i32<3> | ||
| ; CHECK-NEXT: t23: i32,ch = LDBz_RI<Mem:(load (s8) from %fixed-stack.0 + 3)> t21, TargetConstant:i32<0>, TargetConstant:i32<0>, t0 | ||
| ; CHECK-NEXT: t22: i32,ch = LDBz_RI<Mem:(dereferenceable load (s8) from %ir.loc)> TargetFrameIndex:i32<0>, TargetConstant:i32<0>, TargetConstant:i32<0>, t0 | ||
| ; CHECK-NEXT: t24: i32 = ADD_R t23, t22, TargetConstant:i32<0> | ||
| ; CHECK-NEXT: t26: i32 = SLI TargetConstant:i32<255> | ||
| ; CHECK-NEXT: t27: i32 = AND_R t24, t26, TargetConstant:i32<0> | ||
| ; CHECK-NEXT: t16: ch,glue = CopyToReg t14, Register:i32 $r9, t27, t14:1 | ||
| ; CHECK-NEXT: t17: ch = RET Register:i32 $rv, Register:i32 $r9, t16, t16:1 | ||
| ; CHECK-EMPTY: | ||
| %loc = alloca i8 | ||
| %j = load i8, i8 * %loc | ||
| %r = add i8 %i, %j | ||
| %ext = zext i8 %r to i64 | ||
| ret i64 %ext | ||
| } |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,33 @@ | ||
| ; RUN: llc -mtriple=x86_64 < %s | FileCheck %s --check-prefix=PIC | ||
| ; RUN: llc -mtriple=x86_64-windows < %s | FileCheck %s --check-prefix=WIN | ||
|
|
||
| define i64 @i64_test(i64 %i) nounwind readnone { | ||
| %loc = alloca i64 | ||
| %j = load i64, i64 * %loc | ||
| %r = add i64 %i, %j | ||
| ret i64 %r | ||
| } | ||
|
|
||
| define i64 @i32_test(i32 %i) nounwind readnone { | ||
| %loc = alloca i32 | ||
| %j = load i32, i32 * %loc | ||
| %r = add i32 %i, %j | ||
| %ext = zext i32 %r to i64 | ||
| ret i64 %ext | ||
| } | ||
|
|
||
| define i64 @i16_test(i16 %i) nounwind readnone { | ||
| %loc = alloca i16 | ||
| %j = load i16, i16 * %loc | ||
| %r = add i16 %i, %j | ||
| %ext = zext i16 %r to i64 | ||
| ret i64 %ext | ||
| } | ||
|
|
||
| define i64 @i8_test(i8 %i) nounwind readnone { | ||
| %loc = alloca i8 | ||
| %j = load i8, i8 * %loc | ||
| %r = add i8 %i, %j | ||
| %ext = zext i8 %r to i64 | ||
| ret i64 %ext | ||
| } |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,86 @@ | ||
| ; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py | ||
| ; RUN: llc -mtriple=x86_64 < %s | FileCheck %s --check-prefix=PIC | ||
| ; RUN: llc -mtriple=x86_64-windows < %s | FileCheck %s --check-prefix=WIN | ||
|
|
||
| define i64 @i64_test(i64 %i) nounwind readnone { | ||
| ; PIC-LABEL: i64_test: | ||
| ; PIC: # %bb.0: | ||
| ; PIC-NEXT: movq %rdi, %rax | ||
| ; PIC-NEXT: addq -{{[0-9]+}}(%rsp), %rax | ||
| ; PIC-NEXT: retq | ||
| ; | ||
| ; WIN-LABEL: i64_test: | ||
| ; WIN: # %bb.0: | ||
| ; WIN-NEXT: pushq %rax | ||
| ; WIN-NEXT: movq %rcx, %rax | ||
| ; WIN-NEXT: addq (%rsp), %rax | ||
| ; WIN-NEXT: popq %rcx | ||
| ; WIN-NEXT: retq | ||
| %loc = alloca i64 | ||
| %j = load i64, i64 * %loc | ||
| %r = add i64 %i, %j | ||
| ret i64 %r | ||
| } | ||
|
|
||
| define i64 @i32_test(i32 %i) nounwind readnone { | ||
| ; PIC-LABEL: i32_test: | ||
| ; PIC: # %bb.0: | ||
| ; PIC-NEXT: movl %edi, %eax | ||
| ; PIC-NEXT: addl -{{[0-9]+}}(%rsp), %eax | ||
| ; PIC-NEXT: retq | ||
| ; | ||
| ; WIN-LABEL: i32_test: | ||
| ; WIN: # %bb.0: | ||
| ; WIN-NEXT: pushq %rax | ||
| ; WIN-NEXT: movl %ecx, %eax | ||
| ; WIN-NEXT: addl {{[0-9]+}}(%rsp), %eax | ||
| ; WIN-NEXT: popq %rcx | ||
| ; WIN-NEXT: retq | ||
| %loc = alloca i32 | ||
| %j = load i32, i32 * %loc | ||
| %r = add i32 %i, %j | ||
| %ext = zext i32 %r to i64 | ||
| ret i64 %ext | ||
| } | ||
|
|
||
| define i64 @i16_test(i16 %i) nounwind readnone { | ||
| ; PIC-LABEL: i16_test: | ||
| ; PIC: # %bb.0: | ||
| ; PIC-NEXT: addw -{{[0-9]+}}(%rsp), %di | ||
| ; PIC-NEXT: movzwl %di, %eax | ||
| ; PIC-NEXT: retq | ||
| ; | ||
| ; WIN-LABEL: i16_test: | ||
| ; WIN: # %bb.0: | ||
| ; WIN-NEXT: pushq %rax | ||
| ; WIN-NEXT: addw {{[0-9]+}}(%rsp), %cx | ||
| ; WIN-NEXT: movzwl %cx, %eax | ||
| ; WIN-NEXT: popq %rcx | ||
| ; WIN-NEXT: retq | ||
| %loc = alloca i16 | ||
| %j = load i16, i16 * %loc | ||
| %r = add i16 %i, %j | ||
| %ext = zext i16 %r to i64 | ||
| ret i64 %ext | ||
| } | ||
|
|
||
| define i64 @i8_test(i8 %i) nounwind readnone { | ||
| ; PIC-LABEL: i8_test: | ||
| ; PIC: # %bb.0: | ||
| ; PIC-NEXT: addb -{{[0-9]+}}(%rsp), %dil | ||
| ; PIC-NEXT: movzbl %dil, %eax | ||
| ; PIC-NEXT: retq | ||
| ; | ||
| ; WIN-LABEL: i8_test: | ||
| ; WIN: # %bb.0: | ||
| ; WIN-NEXT: pushq %rax | ||
| ; WIN-NEXT: addb {{[0-9]+}}(%rsp), %cl | ||
| ; WIN-NEXT: movzbl %cl, %eax | ||
| ; WIN-NEXT: popq %rcx | ||
| ; WIN-NEXT: retq | ||
| %loc = alloca i8 | ||
| %j = load i8, i8 * %loc | ||
| %r = add i8 %i, %j | ||
| %ext = zext i8 %r to i64 | ||
| ret i64 %ext | ||
| } |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,33 @@ | ||
| ; RUN: llc -mtriple=x86_64 -stop-after=finalize-isel -debug-only=isel -o /dev/null %s 2>&1 | FileCheck %s --check-prefix=PIC | ||
| ; RUN: llc -mtriple=x86_64-windows -stop-after=finalize-isel -debug-only=isel -o /dev/null %s 2>&1 | FileCheck %s --check-prefix=WIN | ||
|
|
||
| define i64 @i64_test(i64 %i) nounwind readnone { | ||
| %loc = alloca i64 | ||
| %j = load i64, i64 * %loc | ||
| %r = add i64 %i, %j | ||
| ret i64 %r | ||
| } | ||
|
|
||
| define i64 @i32_test(i32 %i) nounwind readnone { | ||
| %loc = alloca i32 | ||
| %j = load i32, i32 * %loc | ||
| %r = add i32 %i, %j | ||
| %ext = zext i32 %r to i64 | ||
| ret i64 %ext | ||
| } | ||
|
|
||
| define i64 @i16_test(i16 %i) nounwind readnone { | ||
| %loc = alloca i16 | ||
| %j = load i16, i16 * %loc | ||
| %r = add i16 %i, %j | ||
| %ext = zext i16 %r to i64 | ||
| ret i64 %ext | ||
| } | ||
|
|
||
| define i64 @i8_test(i8 %i) nounwind readnone { | ||
| %loc = alloca i8 | ||
| %j = load i8, i8 * %loc | ||
| %r = add i8 %i, %j | ||
| %ext = zext i8 %r to i64 | ||
| ret i64 %ext | ||
| } |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,114 @@ | ||
| ; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py | ||
| ; RUN: llc -mtriple=x86_64 -stop-after=finalize-isel -debug-only=isel -o /dev/null %s 2>&1 | FileCheck %s --check-prefix=PIC | ||
| ; RUN: llc -mtriple=x86_64-windows -stop-after=finalize-isel -debug-only=isel -o /dev/null %s 2>&1 | FileCheck %s --check-prefix=WIN | ||
|
|
||
| define i64 @i64_test(i64 %i) nounwind readnone { | ||
| ; PIC-LABEL: i64_test: | ||
| ; PIC: SelectionDAG has 12 nodes: | ||
| ; PIC-NEXT: t0: ch = EntryToken | ||
| ; PIC-NEXT: t2: i64,ch = CopyFromReg t0, Register:i64 %0 | ||
| ; PIC-NEXT: t7: i64,i32,ch = ADD64rm<Mem:(dereferenceable load (s64) from %ir.loc)> t2, TargetFrameIndex:i64<0>, TargetConstant:i8<1>, Register:i64 $noreg, TargetConstant:i32<0>, Register:i16 $noreg, t0 | ||
| ; PIC-NEXT: t10: ch,glue = CopyToReg t0, Register:i64 $rax, t7 | ||
| ; PIC-NEXT: t11: ch = RET TargetConstant:i32<0>, Register:i64 $rax, t10, t10:1 | ||
| ; PIC-EMPTY: | ||
| ; | ||
| ; WIN-LABEL: i64_test: | ||
| ; WIN: SelectionDAG has 12 nodes: | ||
| ; WIN-NEXT: t0: ch = EntryToken | ||
| ; WIN-NEXT: t2: i64,ch = CopyFromReg t0, Register:i64 %0 | ||
| ; WIN-NEXT: t7: i64,i32,ch = ADD64rm<Mem:(dereferenceable load (s64) from %ir.loc)> t2, TargetFrameIndex:i64<0>, TargetConstant:i8<1>, Register:i64 $noreg, TargetConstant:i32<0>, Register:i16 $noreg, t0 | ||
| ; WIN-NEXT: t10: ch,glue = CopyToReg t0, Register:i64 $rax, t7 | ||
| ; WIN-NEXT: t11: ch = RET TargetConstant:i32<0>, Register:i64 $rax, t10, t10:1 | ||
| ; WIN-EMPTY: | ||
| %loc = alloca i64 | ||
| %j = load i64, i64 * %loc | ||
| %r = add i64 %i, %j | ||
| ret i64 %r | ||
| } | ||
|
|
||
| define i64 @i32_test(i32 %i) nounwind readnone { | ||
| ; PIC-LABEL: i32_test: | ||
| ; PIC: SelectionDAG has 15 nodes: | ||
| ; PIC-NEXT: t0: ch = EntryToken | ||
| ; PIC-NEXT: t2: i32,ch = CopyFromReg t0, Register:i32 %0 | ||
| ; PIC-NEXT: t7: i32,i32,ch = ADD32rm<Mem:(dereferenceable load (s32) from %ir.loc)> t2, TargetFrameIndex:i64<0>, TargetConstant:i8<1>, Register:i64 $noreg, TargetConstant:i32<0>, Register:i16 $noreg, t0 | ||
| ; PIC-NEXT: t8: i64 = SUBREG_TO_REG TargetConstant:i64<0>, t7, TargetConstant:i32<6> | ||
| ; PIC-NEXT: t11: ch,glue = CopyToReg t0, Register:i64 $rax, t8 | ||
| ; PIC-NEXT: t12: ch = RET TargetConstant:i32<0>, Register:i64 $rax, t11, t11:1 | ||
| ; PIC-EMPTY: | ||
| ; | ||
| ; WIN-LABEL: i32_test: | ||
| ; WIN: SelectionDAG has 15 nodes: | ||
| ; WIN-NEXT: t0: ch = EntryToken | ||
| ; WIN-NEXT: t2: i32,ch = CopyFromReg t0, Register:i32 %0 | ||
| ; WIN-NEXT: t7: i32,i32,ch = ADD32rm<Mem:(dereferenceable load (s32) from %ir.loc)> t2, TargetFrameIndex:i64<0>, TargetConstant:i8<1>, Register:i64 $noreg, TargetConstant:i32<0>, Register:i16 $noreg, t0 | ||
| ; WIN-NEXT: t8: i64 = SUBREG_TO_REG TargetConstant:i64<0>, t7, TargetConstant:i32<6> | ||
| ; WIN-NEXT: t11: ch,glue = CopyToReg t0, Register:i64 $rax, t8 | ||
| ; WIN-NEXT: t12: ch = RET TargetConstant:i32<0>, Register:i64 $rax, t11, t11:1 | ||
| ; WIN-EMPTY: | ||
| %loc = alloca i32 | ||
| %j = load i32, i32 * %loc | ||
| %r = add i32 %i, %j | ||
| %ext = zext i32 %r to i64 | ||
| ret i64 %ext | ||
| } | ||
|
|
||
| define i64 @i16_test(i16 %i) nounwind readnone { | ||
| ; PIC-LABEL: i16_test: | ||
| ; PIC: SelectionDAG has 18 nodes: | ||
| ; PIC-NEXT: t0: ch = EntryToken | ||
| ; PIC-NEXT: t2: i32,ch = CopyFromReg t0, Register:i32 %0 | ||
| ; PIC-NEXT: t3: i16 = EXTRACT_SUBREG t2, TargetConstant:i32<4> | ||
| ; PIC-NEXT: t8: i16,i32,ch = ADD16rm<Mem:(dereferenceable load (s16) from %ir.loc)> t3, TargetFrameIndex:i64<0>, TargetConstant:i8<1>, Register:i64 $noreg, TargetConstant:i32<0>, Register:i16 $noreg, t0 | ||
| ; PIC-NEXT: t15: i32 = MOVZX32rr16 t8 | ||
| ; PIC-NEXT: t9: i64 = SUBREG_TO_REG TargetConstant:i64<0>, t15, TargetConstant:i32<6> | ||
| ; PIC-NEXT: t12: ch,glue = CopyToReg t0, Register:i64 $rax, t9 | ||
| ; PIC-NEXT: t13: ch = RET TargetConstant:i32<0>, Register:i64 $rax, t12, t12:1 | ||
| ; PIC-EMPTY: | ||
| ; | ||
| ; WIN-LABEL: i16_test: | ||
| ; WIN: SelectionDAG has 16 nodes: | ||
| ; WIN-NEXT: t0: ch = EntryToken | ||
| ; WIN-NEXT: t2: i16,ch = CopyFromReg t0, Register:i16 %0 | ||
| ; WIN-NEXT: t7: i16,i32,ch = ADD16rm<Mem:(dereferenceable load (s16) from %ir.loc)> t2, TargetFrameIndex:i64<0>, TargetConstant:i8<1>, Register:i64 $noreg, TargetConstant:i32<0>, Register:i16 $noreg, t0 | ||
| ; WIN-NEXT: t14: i32 = MOVZX32rr16 t7 | ||
| ; WIN-NEXT: t8: i64 = SUBREG_TO_REG TargetConstant:i64<0>, t14, TargetConstant:i32<6> | ||
| ; WIN-NEXT: t11: ch,glue = CopyToReg t0, Register:i64 $rax, t8 | ||
| ; WIN-NEXT: t12: ch = RET TargetConstant:i32<0>, Register:i64 $rax, t11, t11:1 | ||
| ; WIN-EMPTY: | ||
| %loc = alloca i16 | ||
| %j = load i16, i16 * %loc | ||
| %r = add i16 %i, %j | ||
| %ext = zext i16 %r to i64 | ||
| ret i64 %ext | ||
| } | ||
|
|
||
| define i64 @i8_test(i8 %i) nounwind readnone { | ||
| ; PIC-LABEL: i8_test: | ||
| ; PIC: SelectionDAG has 18 nodes: | ||
| ; PIC-NEXT: t0: ch = EntryToken | ||
| ; PIC-NEXT: t2: i32,ch = CopyFromReg t0, Register:i32 %0 | ||
| ; PIC-NEXT: t3: i8 = EXTRACT_SUBREG t2, TargetConstant:i32<1> | ||
| ; PIC-NEXT: t8: i8,i32,ch = ADD8rm<Mem:(dereferenceable load (s8) from %ir.loc)> t3, TargetFrameIndex:i64<0>, TargetConstant:i8<1>, Register:i64 $noreg, TargetConstant:i32<0>, Register:i16 $noreg, t0 | ||
| ; PIC-NEXT: t15: i32 = MOVZX32rr8 t8 | ||
| ; PIC-NEXT: t9: i64 = SUBREG_TO_REG TargetConstant:i64<0>, t15, TargetConstant:i32<6> | ||
| ; PIC-NEXT: t12: ch,glue = CopyToReg t0, Register:i64 $rax, t9 | ||
| ; PIC-NEXT: t13: ch = RET TargetConstant:i32<0>, Register:i64 $rax, t12, t12:1 | ||
| ; PIC-EMPTY: | ||
| ; | ||
| ; WIN-LABEL: i8_test: | ||
| ; WIN: SelectionDAG has 16 nodes: | ||
| ; WIN-NEXT: t0: ch = EntryToken | ||
| ; WIN-NEXT: t2: i8,ch = CopyFromReg t0, Register:i8 %0 | ||
| ; WIN-NEXT: t7: i8,i32,ch = ADD8rm<Mem:(dereferenceable load (s8) from %ir.loc)> t2, TargetFrameIndex:i64<0>, TargetConstant:i8<1>, Register:i64 $noreg, TargetConstant:i32<0>, Register:i16 $noreg, t0 | ||
| ; WIN-NEXT: t14: i32 = MOVZX32rr8 t7 | ||
| ; WIN-NEXT: t8: i64 = SUBREG_TO_REG TargetConstant:i64<0>, t14, TargetConstant:i32<6> | ||
| ; WIN-NEXT: t11: ch,glue = CopyToReg t0, Register:i64 $rax, t8 | ||
| ; WIN-NEXT: t12: ch = RET TargetConstant:i32<0>, Register:i64 $rax, t11, t11:1 | ||
| ; WIN-EMPTY: | ||
| %loc = alloca i8 | ||
| %j = load i8, i8 * %loc | ||
| %r = add i8 %i, %j | ||
| %ext = zext i8 %r to i64 | ||
| ret i64 %ext | ||
| } |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,10 @@ | ||
| # REQUIRES: amdgpu-registered-target | ||
| ## Basic test checking that update_llc_test_checks.py can update a file with isel debug output | ||
|
|
||
| # RUN: cp -f %S/Inputs/amdgpu_isel.ll %t.ll && %update_llc_test_checks %t.ll | ||
| # RUN: cat %S/Inputs/amdgpu_isel.ll.expected > %t.expected.ll | ||
| # RUN: diff -u %t.expected.ll %t.ll | ||
|
|
||
| # RUN: cp -f %S/Inputs/amdgpu_asm.ll %t.ll && %update_llc_test_checks %t.ll | ||
| # RUN: cat %S/Inputs/amdgpu_asm.ll.expected > %t.expected.ll | ||
| # RUN: diff -u %t.expected.ll %t.ll |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,10 @@ | ||
| # REQUIRES: lanai-registered-target | ||
| ## Basic test checking that update_llc_test_checks.py can update a file with isel debug output | ||
|
|
||
| # RUN: cp -f %S/Inputs/lanai_isel.ll %t.ll && %update_llc_test_checks %t.ll | ||
| # RUN: cat %S/Inputs/lanai_isel.ll.expected > %t.expected.ll | ||
| # RUN: diff -u %t.expected.ll %t.ll | ||
|
|
||
| # RUN: cp -f %S/Inputs/lanai_asm.ll %t.ll && %update_llc_test_checks %t.ll | ||
| # RUN: cat %S/Inputs/lanai_asm.ll.expected > %t.expected.ll | ||
| # RUN: diff -u %t.expected.ll %t.ll |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,10 @@ | ||
| # REQUIRES: x86-registered-target | ||
| ## Basic test checking that update_llc_test_checks.py can update a file with isel debug output | ||
|
|
||
| # RUN: cp -f %S/Inputs/x86_isel.ll %t.ll && %update_llc_test_checks %t.ll | ||
| # RUN: cat %S/Inputs/x86_isel.ll.expected > %t.expected.ll | ||
| # RUN: diff -u %t.expected.ll %t.ll | ||
|
|
||
| # RUN: cp -f %S/Inputs/x86_asm.ll %t.ll && %update_llc_test_checks %t.ll | ||
| # RUN: cat %S/Inputs/x86_asm.ll.expected > %t.expected.ll | ||
| # RUN: diff -u %t.expected.ll %t.ll |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,57 @@ | ||
| import re | ||
| from . import common | ||
| import sys | ||
|
|
||
| if sys.version_info[0] > 2: | ||
| class string: | ||
| expandtabs = str.expandtabs | ||
| else: | ||
| import string | ||
|
|
||
| # Support of isel debug checks | ||
| # RegEx: this is where the magic happens. | ||
|
|
||
| ##### iSel parser | ||
|
|
||
| # TODO: add function prefix | ||
| ISEL_FUNCTION_DEFAULT_RE = re.compile( | ||
| r'Selected[\s]*selection[\s]*DAG:[\s]*%bb.0[\s]*\'(?P<func>.*?):[^\']*\'*\n' | ||
| r'(?P<body>.*?)\n' | ||
| r'Total[\s]*amount[\s]*of[\s]*phi[\s]*nodes[\s]*to[\s]*update:[\s]*[0-9]+', | ||
| flags=(re.M | re.S)) | ||
|
|
||
| def scrub_isel_default(isel, args): | ||
| # Scrub runs of whitespace out of the iSel debug output, but leave the leading | ||
| # whitespace in place. | ||
| isel = common.SCRUB_WHITESPACE_RE.sub(r' ', isel) | ||
| # Expand the tabs used for indentation. | ||
| isel = string.expandtabs(isel, 2) | ||
| # Strip trailing whitespace. | ||
| isel = common.SCRUB_TRAILING_WHITESPACE_RE.sub(r'', isel) | ||
| return isel | ||
|
|
||
| def get_run_handler(triple): | ||
| target_handlers = { | ||
| } | ||
| handler = None | ||
| best_prefix = '' | ||
| for prefix, s in target_handlers.items(): | ||
| if triple.startswith(prefix) and len(prefix) > len(best_prefix): | ||
| handler = s | ||
| best_prefix = prefix | ||
|
|
||
| if handler is None: | ||
| common.debug('Using default handler.') | ||
| handler = (scrub_isel_default, ISEL_FUNCTION_DEFAULT_RE) | ||
|
|
||
| return handler | ||
|
|
||
| ##### Generator of iSel CHECK lines | ||
|
|
||
| def add_checks(output_lines, comment_marker, prefix_list, func_dict, func_name, is_filtered): | ||
| # Label format is based on iSel string. | ||
| check_label_format = '{} %s-LABEL: %s%s:'.format(comment_marker) | ||
| global_vars_seen_dict = {} | ||
| common.add_checks(output_lines, comment_marker, prefix_list, func_dict, | ||
| func_name, check_label_format, True, False, | ||
| global_vars_seen_dict, is_filtered = is_filtered) |