1 ; RUN: llc < %s | FileCheck %s
2 ; RUN: %if ptxas %{ llc < %s | %ptxas-verify %}
4 target triple = "nvptx64-nvidia-cuda"
8 ; Load a value, then call a function. Branch, and use the loaded value only on
9 ; one side of the branch. The load shouldn't be sunk beneath the call, because
10 ; the call may modify memory.
11 define i32 @f(i32 %x, ptr %ptr, i1 %cond) {
14 %ptr_val = load i32, ptr %ptr
17 br i1 %cond, label %L1, label %L2
19 %ptr_val2 = add i32 %ptr_val, 100
22 %v4 = phi i32 [ %x, %Start ], [ %ptr_val2, %L1 ]
23 %v5 = add i32 %v4, 1000