brintos

brintos / llvm-project-archived public Read only

0
0
Text · 658 B · aeb4a50 Raw
26 lines · plain
1; RUN: llc < %s | FileCheck %s2; RUN: %if ptxas %{ llc < %s | %ptxas-verify %}3 4target triple = "nvptx64-nvidia-cuda"5 6declare void @foo()7 8; Load a value, then call a function.  Branch, and use the loaded value only on9; one side of the branch.  The load shouldn't be sunk beneath the call, because10; the call may modify memory.11define i32 @f(i32 %x, ptr %ptr, i1 %cond) {12Start:13  ; CHECK: ld.b3214  %ptr_val = load i32, ptr %ptr15  ; CHECK: call.uni16  call void @foo()17  br i1 %cond, label %L1, label %L218L1:19  %ptr_val2 = add i32 %ptr_val, 10020  br label %L221L2:22  %v4 = phi i32 [ %x, %Start ], [ %ptr_val2, %L1 ]23  %v5 = add i32 %v4, 100024  ret i32 %v525}26