// Try to infer better alignment information than the load already has.
if (OptLevel != CodeGenOpt::None && LD->isUnindexed()) {
- unsigned ABIAlign = TLI.getTargetData()->
- getABITypeAlignment(LD->getMemoryVT().getTypeForEVT(*DAG.getContext()));
- unsigned LDAlign = LD->getAlignment();
- // Do not touch loads with explicit alignments that are smaller than ABI
- // alignment to avoid breaking loads from "packed" types.
- if (!LDAlign || LDAlign >= ABIAlign) {
- if (unsigned Align = DAG.InferPtrAlignment(Ptr)) {
- if (Align > LDAlign)
- return DAG.getExtLoad(LD->getExtensionType(), N->getDebugLoc(),
- LD->getValueType(0),
- Chain, Ptr, LD->getPointerInfo(),
- LD->getMemoryVT(),
- LD->isVolatile(), LD->isNonTemporal(), Align);
- }
+ if (unsigned Align = DAG.InferPtrAlignment(Ptr)) {
+ if (Align > LD->getAlignment())
+ return DAG.getExtLoad(LD->getExtensionType(), N->getDebugLoc(),
+ LD->getValueType(0),
+ Chain, Ptr, LD->getPointerInfo(),
+ LD->getMemoryVT(),
+ LD->isVolatile(), LD->isNonTemporal(), Align);
}
}
// Try to infer better alignment information than the store already has.
if (OptLevel != CodeGenOpt::None && ST->isUnindexed()) {
- unsigned ABIAlign = TLI.getTargetData()->
- getABITypeAlignment(ST->getMemoryVT().getTypeForEVT(*DAG.getContext()));
- unsigned STAlign = ST->getAlignment();
- // Do not touch stores with explicit alignments that are smaller than ABI
- // alignment to avoid breaking stores from "packed" types.
- if (!STAlign || STAlign >= ABIAlign) {
- if (unsigned Align = DAG.InferPtrAlignment(Ptr)) {
- if (Align > STAlign)
- return DAG.getTruncStore(Chain, N->getDebugLoc(), Value,
- Ptr, ST->getPointerInfo(), ST->getMemoryVT(),
- ST->isVolatile(), ST->isNonTemporal(),Align);
- }
+ if (unsigned Align = DAG.InferPtrAlignment(Ptr)) {
+ if (Align > ST->getAlignment())
+ return DAG.getTruncStore(Chain, N->getDebugLoc(), Value,
+ Ptr, ST->getPointerInfo(), ST->getMemoryVT(),
+ ST->isVolatile(), ST->isNonTemporal(), Align);
}
}
store i32 0, i32* %changed, align 4
%r2 = getelementptr float* bitcast ([20 x i64]* @compl to float*), i64 32 ; <float*> [#uses=1]
%r3 = bitcast float* %r2 to <2 x float>* ; <<2 x float>*> [#uses=1]
- %r4 = load <2 x float>* %r3, align 8 ; <<2 x float>> [#uses=1]
+ %r4 = load <2 x float>* %r3, align 4 ; <<2 x float>> [#uses=1]
call void @killcommon(i32* %changed)
br label %"file complex.c, line 34, bb4"