diff options
author | Jakob Stoklund Olesen <stoklund@2pi.dk> | 2011-10-12 00:06:23 +0000 |
---|---|---|
committer | Jakob Stoklund Olesen <stoklund@2pi.dk> | 2011-10-12 00:06:23 +0000 |
commit | 1c062c24aba08962b4687f56b274f182e5b7a8e5 (patch) | |
tree | 748a2179f039b93e4586c59726da9c05dc9d0b9f /test/CodeGen/ARM/widen-vmovs.ll | |
parent | fad62874883ab78af47b4eeba042775a67ea7515 (diff) | |
download | llvm-1c062c24aba08962b4687f56b274f182e5b7a8e5.tar.gz llvm-1c062c24aba08962b4687f56b274f182e5b7a8e5.tar.bz2 llvm-1c062c24aba08962b4687f56b274f182e5b7a8e5.tar.xz |
Fix -widen-vmovs liveness issues.
When widening a copy, we are reading a larger register that may not be
live. Use an <undef> flag to tell the register scavenger and machine
code verifier that we know the value isn't defined.
We now widen:
%S6<def> = COPY %S4<kill>, %D3<imp-def>
into:
%D3<def> = VMOVD %D2<undef>, pred:14, pred:%noreg, %S4<imp-use,kill>
This also keeps the <kill> flag on %S4 so we don't inadvertently kill a
live value in %S5.
Finally, ensure that ARMBaseInstrInfo::setExecutionDomain() preserves
the <undef> flag when converting VMOVD to VORR.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@141746 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'test/CodeGen/ARM/widen-vmovs.ll')
-rw-r--r-- | test/CodeGen/ARM/widen-vmovs.ll | 35 |
1 files changed, 35 insertions, 0 deletions
diff --git a/test/CodeGen/ARM/widen-vmovs.ll b/test/CodeGen/ARM/widen-vmovs.ll new file mode 100644 index 0000000000..8fd99ba7af --- /dev/null +++ b/test/CodeGen/ARM/widen-vmovs.ll @@ -0,0 +1,35 @@ +; RUN: llc < %s -widen-vmovs -mcpu=cortex-a8 -verify-machineinstrs | FileCheck %s +target triple = "thumbv7-apple-ios" + +; The 0.0 constant is loaded from the constant pool and kept in a register. +; CHECK: %entry +; CHECK: vldr.32 s +; The float loop variable is initialized with a vmovs from the constant register. +; The vmovs is first widened to a vmovd, and then converted to a vorr because of the v2f32 vadd.f32. +; CHECK: vorr [[DL:d[0-9]+]], [[DN:d[0-9]+]] +; CHECK: , [[DN]] +; CHECK: %for.body.i +; CHECK: vadd.f32 [[DL]], [[DL]], [[DN]] +; +; This test is verifying: +; - The VMOVS widening is happening. +; - Register liveness is verified. +; - The execution domain switch to vorr works across basic blocks. + +define void @Mm() nounwind { +entry: + br label %for.body4 + +for.body4: + br label %for.body.i + +for.body.i: + %tmp3.i = phi float [ 0.000000e+00, %for.body4 ], [ %add.i, %for.body.i ] + %add.i = fadd float %tmp3.i, 0.000000e+00 + %exitcond.i = icmp eq i32 undef, 41 + br i1 %exitcond.i, label %rInnerproduct.exit, label %for.body.i + +rInnerproduct.exit: + store float %add.i, float* undef, align 4 + br label %for.body4 +} |