diff options
author | Craig Topper <craig.topper@intel.com> | 2018-10-04 21:24:24 +0000 |
---|---|---|
committer | Craig Topper <craig.topper@intel.com> | 2018-10-04 21:24:24 +0000 |
commit | 7d2155e3f931005f19cd76e3442cc14666a626c2 (patch) | |
tree | 8db66a0006607815bc0e7a2d1c5ee90f193daab6 /llvm/lib/CodeGen/SelectionDAG/LegalizeVectorOps.cpp | |
parent | 1d15f7b02b8ac469d5d70b94aef924791297cb03 (diff) | |
download | bcm5719-llvm-7d2155e3f931005f19cd76e3442cc14666a626c2.tar.gz bcm5719-llvm-7d2155e3f931005f19cd76e3442cc14666a626c2.zip |
[X86][LegalizeVectorOps] Use MERGE_VALUES to return two results from LowerLoad. Remove special case code in LegalizeVectorOps that allowed us to only return one result.
Previously we replaced the chain use ourself and return the data result. LegalizeVectorOps then detected that we'd done this and assumed the chain had already been handled.
This commit instead returns a MERGE_VALUES node with two results joined from nodes. This allows LegalizeVectorOps to do all the replacements for us without any special casing. The MERGE_VALUES will be removed by DAG combine.
llvm-svn: 343817
Diffstat (limited to 'llvm/lib/CodeGen/SelectionDAG/LegalizeVectorOps.cpp')
-rw-r--r-- | llvm/lib/CodeGen/SelectionDAG/LegalizeVectorOps.cpp | 14 |
1 files changed, 3 insertions, 11 deletions
diff --git a/llvm/lib/CodeGen/SelectionDAG/LegalizeVectorOps.cpp b/llvm/lib/CodeGen/SelectionDAG/LegalizeVectorOps.cpp index 6c248bec441..17618d71305 100644 --- a/llvm/lib/CodeGen/SelectionDAG/LegalizeVectorOps.cpp +++ b/llvm/lib/CodeGen/SelectionDAG/LegalizeVectorOps.cpp @@ -240,17 +240,9 @@ SDValue VectorLegalizer::LegalizeOp(SDValue Op) { return TranslateLegalizeResults(Op, Result); case TargetLowering::Custom: if (SDValue Lowered = TLI.LowerOperation(Result, DAG)) { - if (Lowered == Result) - return TranslateLegalizeResults(Op, Lowered); - Changed = true; - if (Lowered->getNumValues() != Op->getNumValues()) { - // This expanded to something other than the load. Assume the - // lowering code took care of any chain values, and just handle the - // returned value. - assert(Result.getValue(1).use_empty() && - "There are still live users of the old chain!"); - return LegalizeOp(Lowered); - } + assert(Lowered->getNumValues() == Op->getNumValues() && + "Unexpected number of results"); + Changed = Lowered != Result; return TranslateLegalizeResults(Op, Lowered); } LLVM_FALLTHROUGH; |