brintos

brintos / llvm-project-archived public Read only

0
0
Text · 3.2 KiB · dd64724 Raw
66 lines · plain
1; RUN: llvm-as < %s | llc | FileCheck %s2; PR 52473; check that cmp/test is not scheduled before the add4target datalayout = "e-p:64:64:64-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:64:64-f32:32:32-f64:64:64-v64:64:64-v128:128:128-a0:0:64-s0:64:64-f80:128:128"5target triple = "x86_64-unknown-linux-gnu"6 7@.str76843 = external dso_local constant [45 x i8]          ; <ptr> [#uses=1]8@__profiling_callsite_timestamps_live = external dso_local global [1216 x i64] ; <ptr> [#uses=2]9 10define i32 @cl_init(i32 %initoptions) nounwind {11entry:12  %retval.i = alloca i32                          ; <ptr> [#uses=3]13  %retval = alloca i32                            ; <ptr> [#uses=2]14  %initoptions.addr = alloca i32                  ; <ptr> [#uses=2]15  tail call void asm sideeffect "cpuid", "~{ax},~{bx},~{cx},~{dx},~{memory},~{dirflag},~{fpsr},~{flags}"() nounwind16  %0 = tail call i64 @llvm.readcyclecounter() nounwind ; <i64> [#uses=1]17  store i32 %initoptions, ptr %initoptions.addr18  call void asm sideeffect "cpuid", "~{ax},~{bx},~{cx},~{dx},~{memory},~{dirflag},~{fpsr},~{flags}"() nounwind19  %1 = call i64 @llvm.readcyclecounter() nounwind ; <i64> [#uses=1]20  %call.i = call i32 @lt_dlinit() nounwind        ; <i32> [#uses=1]21  %tobool.i = icmp ne i32 %call.i, 0              ; <i1> [#uses=1]22  br i1 %tobool.i, label %if.then.i, label %if.end.i23 24if.then.i:                                        ; preds = %entry25  %call1.i = call i32 @warn_dlerror(ptr @.str76843) nounwind ; <i32> [#uses=0]26  store i32 -1, ptr %retval.i27  br label %lt_init.exit28 29if.end.i:                                         ; preds = %entry30  store i32 0, ptr %retval.i31  br label %lt_init.exit32 33lt_init.exit:                                     ; preds = %if.end.i, %if.then.i34  %2 = load i32, ptr %retval.i                        ; <i32> [#uses=1]35  call void asm sideeffect "cpuid", "~{ax},~{bx},~{cx},~{dx},~{memory},~{dirflag},~{fpsr},~{flags}"() nounwind36  %3 = call i64 @llvm.readcyclecounter() nounwind ; <i64> [#uses=1]37  %4 = sub i64 %3, %1                             ; <i64> [#uses=1]38  %5 = atomicrmw add ptr getelementptr inbounds ([1216 x i64], ptr @__profiling_callsite_timestamps_live, i32 0, i32 51), i64 %4 monotonic39;CHECK: lock {{xadd|addq}} %rdx, __profiling_callsite_timestamps_live40;CHECK-NEXT: testl [[REG:%e[a-z]+]], [[REG]]41;CHECK-NEXT: jne42  %cmp = icmp eq i32 %2, 0                        ; <i1> [#uses=1]43  br i1 %cmp, label %if.then, label %if.end44 45if.then:                                          ; preds = %lt_init.exit46  call void @cli_rarload()47  br label %if.end48 49if.end:                                           ; preds = %if.then, %lt_init.exit50  store i32 0, ptr %retval51  %6 = load i32, ptr %retval                          ; <i32> [#uses=1]52  tail call void asm sideeffect "cpuid", "~{ax},~{bx},~{cx},~{dx},~{memory},~{dirflag},~{fpsr},~{flags}"() nounwind53  %7 = tail call i64 @llvm.readcyclecounter() nounwind ; <i64> [#uses=1]54  %8 = sub i64 %7, %0                             ; <i64> [#uses=1]55  %9 = atomicrmw add ptr getelementptr inbounds ([1216 x i64], ptr @__profiling_callsite_timestamps_live, i32 0, i32 50), i64 %8 monotonic56  ret i32 %657}58 59declare void @cli_rarload() nounwind60 61declare i32 @lt_dlinit()62 63declare i32 @warn_dlerror(ptr) nounwind64 65declare i64 @llvm.readcyclecounter() nounwind66