diff options
Diffstat (limited to 'lib/CodeGen/SelectionDAG/LegalizeDAG.cpp')
| -rw-r--r-- | lib/CodeGen/SelectionDAG/LegalizeDAG.cpp | 20 |
1 files changed, 15 insertions, 5 deletions
diff --git a/lib/CodeGen/SelectionDAG/LegalizeDAG.cpp b/lib/CodeGen/SelectionDAG/LegalizeDAG.cpp index 0d6a47c..9355e48 100644 --- a/lib/CodeGen/SelectionDAG/LegalizeDAG.cpp +++ b/lib/CodeGen/SelectionDAG/LegalizeDAG.cpp @@ -1135,11 +1135,21 @@ SDOperand SelectionDAGLegalize::LegalizeOp(SDOperand Op) { case ISD::MEMBARRIER: { assert(Node->getNumOperands() == 6 && "Invalid MemBarrier node!"); - SDOperand Ops[6]; - Ops[0] = LegalizeOp(Node->getOperand(0)); // Legalize the chain. - for (int x = 1; x < 6; ++x) - Ops[x] = PromoteOp(Node->getOperand(x)); - Result = DAG.UpdateNodeOperands(Result, &Ops[0], 6); + switch (TLI.getOperationAction(ISD::MEMBARRIER, MVT::Other)) { + default: assert(0 && "This action is not supported yet!"); + case TargetLowering::Legal: { + SDOperand Ops[6]; + Ops[0] = LegalizeOp(Node->getOperand(0)); // Legalize the chain. + for (int x = 1; x < 6; ++x) + Ops[x] = PromoteOp(Node->getOperand(x)); + Result = DAG.UpdateNodeOperands(Result, &Ops[0], 6); + break; + } + case TargetLowering::Expand: + //There is no libgcc call for this op + Result = Node->getOperand(0); // Noop + break; + } break; } |
