mirror of
https://github.com/RPCS3/llvm-mirror.git
synced 2024-12-28 06:27:16 +00:00
Fix stride computations for long double arrays.
llvm-svn: 42508
This commit is contained in:
parent
d3dfb76a43
commit
d94f00234f
@ -816,8 +816,12 @@ void AsmPrinter::EmitGlobalConstant(const Constant *CV) {
|
||||
if (CVA->isString()) {
|
||||
EmitString(CVA);
|
||||
} else { // Not a string. Print the values in successive locations
|
||||
for (unsigned i = 0, e = CVA->getNumOperands(); i != e; ++i)
|
||||
for (unsigned i = 0, e = CVA->getNumOperands(); i != e; ++i) {
|
||||
EmitGlobalConstant(CVA->getOperand(i));
|
||||
const Type* EltTy = CVA->getType()->getElementType();
|
||||
uint64_t padSize = TD->getABITypeSize(EltTy) - TD->getTypeSize(EltTy);
|
||||
EmitZeros(padSize);
|
||||
}
|
||||
}
|
||||
return;
|
||||
} else if (const ConstantStruct *CVS = dyn_cast<ConstantStruct>(CV)) {
|
||||
|
@ -2279,13 +2279,13 @@ void SelectionDAGLowering::visitGetElementPtr(User &I) {
|
||||
if (ConstantInt *CI = dyn_cast<ConstantInt>(Idx)) {
|
||||
if (CI->getZExtValue() == 0) continue;
|
||||
uint64_t Offs =
|
||||
TD->getTypeSize(Ty)*cast<ConstantInt>(CI)->getSExtValue();
|
||||
TD->getABITypeSize(Ty)*cast<ConstantInt>(CI)->getSExtValue();
|
||||
N = DAG.getNode(ISD::ADD, N.getValueType(), N, getIntPtrConstant(Offs));
|
||||
continue;
|
||||
}
|
||||
|
||||
// N = N + Idx * ElementSize;
|
||||
uint64_t ElementSize = TD->getTypeSize(Ty);
|
||||
uint64_t ElementSize = TD->getABITypeSize(Ty);
|
||||
SDOperand IdxN = getValue(Idx);
|
||||
|
||||
// If the index is smaller or larger than intptr_t, truncate or extend
|
||||
|
@ -286,7 +286,7 @@ SCEVHandle LoopStrengthReduce::GetExpressionSCEV(Instruction *Exp, Loop *L) {
|
||||
Value *OpVal = getCastedVersionOf(opcode, GEP->getOperand(i));
|
||||
SCEVHandle Idx = SE->getSCEV(OpVal);
|
||||
|
||||
uint64_t TypeSize = TD->getTypeSize(GTI.getIndexedType());
|
||||
uint64_t TypeSize = TD->getABITypeSize(GTI.getIndexedType());
|
||||
if (TypeSize != 1)
|
||||
Idx = SCEVMulExpr::get(Idx,
|
||||
SCEVConstant::get(ConstantInt::get(UIntPtrTy,
|
||||
|
Loading…
Reference in New Issue
Block a user