mirror of
https://github.com/RPCS3/llvm-mirror.git
synced 2024-11-30 06:40:53 +00:00
Emit trailing padding on constant vectors when TargetData says that the vector
is larger than the sum of the elements (including per-element padding). llvm-svn: 133631
This commit is contained in:
parent
da4d209996
commit
bf55e4b776
@ -1516,6 +1516,13 @@ static void EmitGlobalConstantVector(const ConstantVector *CV,
|
||||
unsigned AddrSpace, AsmPrinter &AP) {
|
||||
for (unsigned i = 0, e = CV->getType()->getNumElements(); i != e; ++i)
|
||||
EmitGlobalConstantImpl(CV->getOperand(i), AddrSpace, AP);
|
||||
|
||||
const TargetData &TD = *AP.TM.getTargetData();
|
||||
unsigned Size = TD.getTypeAllocSize(CV->getType());
|
||||
unsigned EmittedSize = TD.getTypeAllocSize(CV->getType()->getElementType()) *
|
||||
CV->getType()->getNumElements();
|
||||
if (unsigned Padding = Size - EmittedSize)
|
||||
AP.OutStreamer.EmitZeros(Padding, AddrSpace);
|
||||
}
|
||||
|
||||
static void EmitGlobalConstantStruct(const ConstantStruct *CS,
|
||||
|
@ -44,3 +44,16 @@ define void @f7(i32 %a) {
|
||||
r:
|
||||
ret void
|
||||
}
|
||||
|
||||
%t1 = type { <3 x float>, <3 x float> }
|
||||
|
||||
@const1 = global %t1 { <3 x float> zeroinitializer,
|
||||
<3 x float> <float 1.000000e+00,
|
||||
float 2.000000e+00,
|
||||
float 3.000000e+00> }, align 16
|
||||
; CHECK: const1
|
||||
; CHECK: .zero 16
|
||||
; CHECK: float 1.0
|
||||
; CHECK: float 2.0
|
||||
; CHECK: float 3.0
|
||||
; CHECK: .zero 4
|
||||
|
Loading…
Reference in New Issue
Block a user