[llvm-commits] [llvm] r145891 - in /llvm/trunk: lib/Target/ARM/ARMFastISel.cpp test/CodeGen/ARM/fast-isel.ll
Chad Rosier
mcrosier at apple.com
Mon Dec 5 17:44:17 PST 2011
Author: mcrosier
Date: Mon Dec 5 19:44:17 2011
New Revision: 145891
URL: http://llvm.org/viewvc/llvm-project?rev=145891&view=rev
Log:
[arm-fast-isel] Doublewords only require word-alignment.
rdar://10528060
Modified:
llvm/trunk/lib/Target/ARM/ARMFastISel.cpp
llvm/trunk/test/CodeGen/ARM/fast-isel.ll
Modified: llvm/trunk/lib/Target/ARM/ARMFastISel.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/ARM/ARMFastISel.cpp?rev=145891&r1=145890&r2=145891&view=diff
==============================================================================
--- llvm/trunk/lib/Target/ARM/ARMFastISel.cpp (original)
+++ llvm/trunk/lib/Target/ARM/ARMFastISel.cpp Mon Dec 5 19:44:17 2011
@@ -1106,7 +1106,7 @@
case MVT::f32:
if (!Subtarget->hasVFP2()) return false;
StrOpc = ARM::VSTRS;
- // Unaligned stores need special handling.
+ // Unaligned stores need special handling. Floats require word-alignment.
if (Alignment && Alignment < 4) {
unsigned MoveReg = createResultReg(TLI.getRegClassFor(MVT::i32));
AddOptionalDefs(BuildMI(*FuncInfo.MBB, FuncInfo.InsertPt, DL,
@@ -1119,8 +1119,9 @@
break;
case MVT::f64:
if (!Subtarget->hasVFP2()) return false;
- // FIXME: Unaligned stores need special handling.
- if (Alignment && Alignment < 8) {
+ // FIXME: Unaligned stores need special handling. Doublewords require
+ // word-alignment.
+ if (Alignment && Alignment < 4) {
return false;
}
StrOpc = ARM::VSTRD;
Modified: llvm/trunk/test/CodeGen/ARM/fast-isel.ll
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/CodeGen/ARM/fast-isel.ll?rev=145891&r1=145890&r2=145891&view=diff
==============================================================================
--- llvm/trunk/test/CodeGen/ARM/fast-isel.ll (original)
+++ llvm/trunk/test/CodeGen/ARM/fast-isel.ll Mon Dec 5 19:44:17 2011
@@ -180,3 +180,21 @@
store float %add, float* %x1, align 1
ret void
}
+
+; Doublewords require only word-alignment.
+; rdar://10528060
+%struct.anon.0 = type { double }
+
+ at foo_unpacked = common global %struct.anon.0 zeroinitializer, align 4
+
+define void @test5(double %a, double %b) nounwind {
+entry:
+; ARM: @test5
+; THUMB: @test5
+ %add = fadd double %a, %b
+ store double %add, double* getelementptr inbounds (%struct.anon.0* @foo_unpacked, i32 0, i32 0), align 4
+; ARM: vstr d16, [r0]
+; THUMB: vstr d16, [r0]
+ ret void
+}
+
More information about the llvm-commits
mailing list