brintos

brintos / llvm-project-archived public Read only

0
0
Text · 749 B · 9cf1892 Raw
24 lines · plain
1; RUN: opt -passes=dse -S < %s | FileCheck %s2 3; Don't eliminate stores to allocas before tail calls to functions that use4; byval. It's correct to mark calls like these as 'tail'. To implement this tail5; call, the backend should copy the bytes from the alloca into the argument area6; before clearing the stack.7 8target datalayout = "e-m:e-p:32:32-f64:32:64-f80:32-n8:16:32-S128"9target triple = "i386-unknown-linux-gnu"10 11declare void @g(ptr byval(i32) %p)12 13define void @f(ptr byval(i32) %x) {14entry:15  %p = alloca i3216  %v = load i32, ptr %x17  store i32 %v, ptr %p18  tail call void @g(ptr byval(i32) %p)19  ret void20}21; CHECK-LABEL: define void @f(ptr byval(i32) %x)22; CHECK:   store i32 %v, ptr %p23; CHECK:   tail call void @g(ptr byval(i32) %p)24