diff options
author | Owen Anderson <resistor@mac.com> | 2013-02-05 06:25:30 +0000 |
---|---|---|
committer | Owen Anderson <resistor@mac.com> | 2013-02-05 06:25:30 +0000 |
commit | a47fdbb032d342a2a13c665a060ca9a115ecd506 (patch) | |
tree | 0dc6e41c91c938eb2cd2c7aecf7806ae475b6455 /llvm/lib/CodeGen | |
parent | 03cb13751fc15f5e26c5e77e8c0197513bffc82a (diff) | |
download | bcm5719-llvm-a47fdbb032d342a2a13c665a060ca9a115ecd506.tar.gz bcm5719-llvm-a47fdbb032d342a2a13c665a060ca9a115ecd506.zip |
When the target-independent DAGCombiner inferred a higher alignment for a load,
it would replace the load with one with the higher alignment. However, it did
not place the new load in the worklist, which prevented later DAG combines in
the same phase (for example, target-specific combines) from ever seeing it.
This patch corrects that oversight, and updates some tests whose output changed
due to slightly different DAGCombine outputs.
llvm-svn: 174343
Diffstat (limited to 'llvm/lib/CodeGen')
-rw-r--r-- | llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp b/llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp index 79ec227a22b..39a8e82796a 100644 --- a/llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp +++ b/llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp @@ -7199,12 +7199,15 @@ SDValue DAGCombiner::visitLOAD(SDNode *N) { // Try to infer better alignment information than the load already has. if (OptLevel != CodeGenOpt::None && LD->isUnindexed()) { if (unsigned Align = DAG.InferPtrAlignment(Ptr)) { - if (Align > LD->getAlignment()) - return DAG.getExtLoad(LD->getExtensionType(), N->getDebugLoc(), + if (Align > LD->getAlignment()) { + SDValue NewLoad = + DAG.getExtLoad(LD->getExtensionType(), N->getDebugLoc(), LD->getValueType(0), Chain, Ptr, LD->getPointerInfo(), LD->getMemoryVT(), LD->isVolatile(), LD->isNonTemporal(), Align); + return CombineTo(N, NewLoad, SDValue(NewLoad.getNode(), 1), true); + } } } |