summaryrefslogtreecommitdiffstats
path: root/llvm/test/CodeGen/ARM/2012-10-04-FixedFrame-vs-byval.ll
diff options
context:
space:
mode:
authorStepan Dyatkovskiy <stpworld@narod.ru>2012-10-10 11:37:36 +0000
committerStepan Dyatkovskiy <stpworld@narod.ru>2012-10-10 11:37:36 +0000
commitf13dbb8e243372cd5228620285c3d73fc5aa7c86 (patch)
treec1bd2b4261d11357704e33ba99c676774ad68f80 /llvm/test/CodeGen/ARM/2012-10-04-FixedFrame-vs-byval.ll
parenta6399a519d4d89602ecf918b3d6841601095a648 (diff)
downloadbcm5719-llvm-f13dbb8e243372cd5228620285c3d73fc5aa7c86.tar.gz
bcm5719-llvm-f13dbb8e243372cd5228620285c3d73fc5aa7c86.zip
Issue description:
SchedulerDAGInstrs::buildSchedGraph ignores dependencies between FixedStack objects and byval parameters. So loading byval parameters from stack may be inserted *before* it will be stored, since these operations are treated as independent. Fix: Currently ARMTargetLowering::LowerFormalArguments saves byval registers with FixedStack MachinePointerInfo. To fix the problem we need to store byval registers with MachinePointerInfo referenced to first the "byval" parameter. Also commit adds two new fields to the InputArg structure: Function's argument index and InputArg's part offset in bytes relative to the start position of Function's argument. E.g.: If function's argument is 128 bit width and it was splitted onto 32 bit regs, then we got 4 InputArg structs with same arg index, but different offset values. llvm-svn: 165616
Diffstat (limited to 'llvm/test/CodeGen/ARM/2012-10-04-FixedFrame-vs-byval.ll')
-rw-r--r--llvm/test/CodeGen/ARM/2012-10-04-FixedFrame-vs-byval.ll19
1 files changed, 19 insertions, 0 deletions
diff --git a/llvm/test/CodeGen/ARM/2012-10-04-FixedFrame-vs-byval.ll b/llvm/test/CodeGen/ARM/2012-10-04-FixedFrame-vs-byval.ll
new file mode 100644
index 00000000000..478048d0960
--- /dev/null
+++ b/llvm/test/CodeGen/ARM/2012-10-04-FixedFrame-vs-byval.ll
@@ -0,0 +1,19 @@
+; RUN: llc < %s -mtriple=armv7-none-linux-gnueabi | FileCheck %s
+
+@.str = private unnamed_addr constant [12 x i8] c"val.a = %f\0A\00"
+%struct_t = type { double, double, double }
+@static_val = constant %struct_t { double 1.0, double 2.0, double 3.0 }
+
+declare i32 @printf(i8*, ...)
+
+; CHECK: test_byval_usage_scheduling:
+; CHECK: str r3, [sp, #12]
+; CHECK: str r2, [sp, #8]
+; CHECK: vldr d16, [sp, #8]
+define void @test_byval_usage_scheduling(i32 %n1, i32 %n2, %struct_t* byval %val) nounwind {
+entry:
+ %a = getelementptr inbounds %struct_t* %val, i32 0, i32 0
+ %0 = load double* %a
+ %call = call i32 (i8*, ...)* @printf(i8* getelementptr inbounds ([12 x i8]* @.str, i32 0, i32 0), double %0)
+ ret void
+}
OpenPOWER on IntegriCloud