summaryrefslogtreecommitdiffstats
path: root/llvm/lib/CodeGen
diff options
context:
space:
mode:
authorSimon Pilgrim <llvm-dev@redking.me.uk>2015-06-13 16:25:12 +0000
committerSimon Pilgrim <llvm-dev@redking.me.uk>2015-06-13 16:25:12 +0000
commitd3f64274462e500724ae2df9d7b590094eff87b4 (patch)
treede7dd92d7cd14a1a625f098ef574a8403842f3bf /llvm/lib/CodeGen
parent57149984849a14f664b749a312f61fbdfe413691 (diff)
downloadbcm5719-llvm-d3f64274462e500724ae2df9d7b590094eff87b4.tar.gz
bcm5719-llvm-d3f64274462e500724ae2df9d7b590094eff87b4.zip
[DAGCombiner] Added BSWAP(BSWAP(x)) -> x combine pattern.
llvm-svn: 239682
Diffstat (limited to 'llvm/lib/CodeGen')
-rw-r--r--llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp3
1 files changed, 3 insertions, 0 deletions
diff --git a/llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp b/llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp
index 1e33f1ed10f..33f5f52332a 100644
--- a/llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp
+++ b/llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp
@@ -4773,6 +4773,9 @@ SDValue DAGCombiner::visitBSWAP(SDNode *N) {
// fold (bswap c1) -> c2
if (isConstantIntBuildVectorOrConstantInt(N0))
return DAG.getNode(ISD::BSWAP, SDLoc(N), VT, N0);
+ // fold (bswap (bswap x)) -> x
+ if (N0.getOpcode() == ISD::BSWAP)
+ return N0->getOperand(0);
return SDValue();
}
OpenPOWER on IntegriCloud