brintos

brintos / llvm-project-archived public Read only

0
0
Text · 4.2 KiB · 8b82c4e Raw
124 lines · plain
1# Prevent the machine scheduler from moving instructions past FAKE_USE.2# RUN: llc -run-pass machine-scheduler -mtriple=x86_64-unknown-linux -debug-only=machine-scheduler 2>&1 -o - %s | FileCheck %s3# REQUIRES: asserts4#5# We make sure that, beginning with the first FAKE_USE instruction,6# no changes to the sequence of instructions are undertaken by the7# scheduler. We don't bother to check that the order of the FAKE_USEs8# remains the same. They should, but it is irrelevant.9#10# CHECK: ********** MI Scheduling **********11# CHECK-NEXT: foo:%bb.0 entry12# CHECK-NEXT:   From: %0:gr64 = COPY $rdi13# CHECK-NEXT:     To: FAKE_USE %5:gr6414# CHECK-NEXT:  RegionInstrs: 715#16# CHECK: ********** MI Scheduling **********17# CHECK-NEXT: bar:%bb.0 entry18# CHECK-NEXT:   From: %0:gr64 = COPY $rdi19# CHECK-NEXT:     To: RET 0, killed $rax20# CHECK-NEXT:  RegionInstrs: 721#22--- |23  ; ModuleID = 'test.ll'24  source_filename = "test.ll"25  target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-i128:128-f80:128-n8:16:32:64-S128"26  27  @glb = common dso_local local_unnamed_addr global [100 x i32] zeroinitializer, align 1628  29  define dso_local i64 @foo(ptr %p) local_unnamed_addr optdebug {30  entry:31    %0 = load i32, ptr @glb, align 1632    store i32 %0, ptr %p, align 433    %conv = sext i32 %0 to i6434    %1 = load i32, ptr getelementptr inbounds ([100 x i32], ptr @glb, i64 0, i64 1), align 435    %arrayidx1 = getelementptr inbounds i32, ptr %p, i64 136    store i32 %1, ptr %arrayidx1, align 437    %conv2 = sext i32 %1 to i6438    %add3 = add nsw i64 %conv2, %conv39    notail call void (...) @llvm.fake.use(i64 %add3)40    notail call void (...) @llvm.fake.use(i32 %1)41    notail call void (...) @llvm.fake.use(i32 %0)42    notail call void (...) @llvm.fake.use(ptr %p)43    ret i64 %add344  }45  46  define dso_local i64 @bar(ptr %p) local_unnamed_addr optdebug {47  entry:48    %0 = load i32, ptr @glb, align 1649    store i32 %0, ptr %p, align 450    %conv = sext i32 %0 to i6451    %1 = load i32, ptr getelementptr inbounds ([100 x i32], ptr @glb, i64 0, i64 1), align 452    %arrayidx1 = getelementptr inbounds i32, ptr %p, i64 153    store i32 %1, ptr %arrayidx1, align 454    %conv2 = sext i32 %1 to i6455    %add3 = add nsw i64 %conv2, %conv56    ret i64 %add357  }58  59  ; Function Attrs: nocallback nofree nosync nounwind willreturn60  declare void @llvm.stackprotector(ptr, ptr)61  62...63---64name:            foo65alignment:       1666tracksRegLiveness: true67debugInstrRef:   true68registers:69  - { id: 0, class: gr64, preferred-register: '' }70  - { id: 1, class: gr64_with_sub_8bit, preferred-register: '' }71  - { id: 2, class: gr32, preferred-register: '' }72  - { id: 3, class: gr64_with_sub_8bit, preferred-register: '' }73  - { id: 4, class: gr32, preferred-register: '' }74  - { id: 5, class: gr64, preferred-register: '' }75liveins:76  - { reg: '$rdi', virtual-reg: '%0' }77body:             |78  bb.0.entry:79    liveins: $rdi80  81    %0:gr64 = COPY $rdi82    %1:gr64_with_sub_8bit = MOVSX64rm32 $rip, 1, $noreg, @glb, $noreg83    MOV32mr %0, 1, $noreg, 0, $noreg, %1.sub_32bit84    %3:gr64_with_sub_8bit = MOVSX64rm32 $rip, 1, $noreg, @glb + 4, $noreg85    MOV32mr %0, 1, $noreg, 4, $noreg, %3.sub_32bit86    %5:gr64 = COPY %387    %5:gr64 = nsw ADD64rr %5, %1, implicit-def dead $eflags88    FAKE_USE %589    FAKE_USE %3.sub_32bit90    FAKE_USE %1.sub_32bit91    FAKE_USE %092    $rax = COPY %593    RET 0, killed $rax94 95...96---97name:            bar98alignment:       1699tracksRegLiveness: true100debugInstrRef:   true101registers:102  - { id: 0, class: gr64, preferred-register: '' }103  - { id: 1, class: gr64_with_sub_8bit, preferred-register: '' }104  - { id: 2, class: gr32, preferred-register: '' }105  - { id: 3, class: gr64_with_sub_8bit, preferred-register: '' }106  - { id: 4, class: gr32, preferred-register: '' }107  - { id: 5, class: gr64_with_sub_8bit, preferred-register: '' }108liveins:109  - { reg: '$rdi', virtual-reg: '%0' }110body:             |111  bb.0.entry:112    liveins: $rdi113  114    %0:gr64 = COPY $rdi115    %1:gr64_with_sub_8bit = MOVSX64rm32 $rip, 1, $noreg, @glb, $noreg116    MOV32mr %0, 1, $noreg, 0, $noreg, %1.sub_32bit117    %5:gr64_with_sub_8bit = MOVSX64rm32 $rip, 1, $noreg, @glb + 4, $noreg118    MOV32mr %0, 1, $noreg, 4, $noreg, %5.sub_32bit119    %5:gr64_with_sub_8bit = nsw ADD64rr %5, %1, implicit-def dead $eflags120    $rax = COPY %5121    RET 0, killed $rax122 123...124