summaryrefslogtreecommitdiffstats
path: root/llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp
diff options
context:
space:
mode:
authorDan Gohman <gohman@apple.com>2008-06-28 00:45:22 +0000
committerDan Gohman <gohman@apple.com>2008-06-28 00:45:22 +0000
commit6f7b5a6392957c2d9fe82a50b24fc51b337fe9cc (patch)
tree9ee1348c3a536f5687fc6f80122f37c7b24f10ee /llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp
parent62ea6e8b6afb99bcb93e85ac654714fd42e275e3 (diff)
downloadbcm5719-llvm-6f7b5a6392957c2d9fe82a50b24fc51b337fe9cc.tar.gz
bcm5719-llvm-6f7b5a6392957c2d9fe82a50b24fc51b337fe9cc.zip
When folding a bitcast into a load or store, preserve the alignment
information of the original load or store, which is checked to be at least as good, and possibly better. llvm-svn: 52849
Diffstat (limited to 'llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp')
-rw-r--r--llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp b/llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp
index 64aa7ed5e82..38171dff752 100644
--- a/llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp
+++ b/llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp
@@ -3445,7 +3445,7 @@ SDOperand DAGCombiner::visitBIT_CONVERT(SDNode *N) {
if (Align <= OrigAlign) {
SDOperand Load = DAG.getLoad(VT, LN0->getChain(), LN0->getBasePtr(),
LN0->getSrcValue(), LN0->getSrcValueOffset(),
- LN0->isVolatile(), Align);
+ LN0->isVolatile(), OrigAlign);
AddToWorkList(N);
CombineTo(N0.Val, DAG.getNode(ISD::BIT_CONVERT, N0.getValueType(), Load),
Load.getValue(1));
@@ -4547,7 +4547,7 @@ SDOperand DAGCombiner::visitSTORE(SDNode *N) {
((!AfterLegalize && !ST->isVolatile()) ||
TLI.isOperationLegal(ISD::STORE, SVT)))
return DAG.getStore(Chain, Value.getOperand(0), Ptr, ST->getSrcValue(),
- ST->getSrcValueOffset(), ST->isVolatile(), Align);
+ ST->getSrcValueOffset(), ST->isVolatile(), OrigAlign);
}
// Turn 'store float 1.0, Ptr' -> 'store int 0x12345678, Ptr'
OpenPOWER on IntegriCloud