diff options
author | Akira Hatanaka <ahatanaka@mips.com> | 2012-06-02 01:10:34 +0000 |
---|---|---|
committer | Akira Hatanaka <ahatanaka@mips.com> | 2012-06-02 01:10:34 +0000 |
commit | 55a105160dc02a0d990a69820cfe63fef504195e (patch) | |
tree | 72db0ebd2b56a53a0d1707a0a2c9b8b6df3bec65 /lib | |
parent | 00edc3dea28c158c5e2b6d4fd3d2da13ee933e2a (diff) | |
download | external_llvm-55a105160dc02a0d990a69820cfe63fef504195e.zip external_llvm-55a105160dc02a0d990a69820cfe63fef504195e.tar.gz external_llvm-55a105160dc02a0d990a69820cfe63fef504195e.tar.bz2 |
Fix a bug in the code which custom-lowers truncating stores in LegalizeDAG.
Check that the SDValue TargetLowering::LowerOperation returns is not null
before replacing the original node with the returned node.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@157873 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib')
-rw-r--r-- | lib/CodeGen/SelectionDAG/LegalizeDAG.cpp | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/lib/CodeGen/SelectionDAG/LegalizeDAG.cpp b/lib/CodeGen/SelectionDAG/LegalizeDAG.cpp index 7ba7442..c2972b0 100644 --- a/lib/CodeGen/SelectionDAG/LegalizeDAG.cpp +++ b/lib/CodeGen/SelectionDAG/LegalizeDAG.cpp @@ -1312,8 +1312,9 @@ void SelectionDAGLegalize::LegalizeOp(SDNode *Node) { } break; case TargetLowering::Custom: - ReplaceNode(SDValue(Node, 0), - TLI.LowerOperation(SDValue(Node, 0), DAG)); + Tmp1 = TLI.LowerOperation(SDValue(Node, 0), DAG); + if (Tmp1.getNode()) + ReplaceNode(SDValue(Node, 0), Tmp1); break; case TargetLowering::Expand: assert(!StVT.isVector() && |