1 //===-- LegalizeTypes.cpp - Common code for DAG type legalizer ------------===//
3 // The LLVM Compiler Infrastructure
5 // This file is distributed under the University of Illinois Open Source
6 // License. See LICENSE.TXT for details.
8 //===----------------------------------------------------------------------===//
10 // This file implements the SelectionDAG::LegalizeTypes method. It transforms
11 // an arbitrary well-formed SelectionDAG to only consist of legal types. This
12 // is common code shared among the LegalizeTypes*.cpp files.
14 //===----------------------------------------------------------------------===//
16 #include "LegalizeTypes.h"
17 #include "llvm/CallingConv.h"
18 #include "llvm/Support/CommandLine.h"
19 #include "llvm/Target/TargetData.h"
22 /// run - This is the main entry point for the type legalizer. This does a
23 /// top-down traversal of the dag, legalizing types as it goes.
24 void DAGTypeLegalizer::run() {
25 // Create a dummy node (which is not added to allnodes), that adds a reference
26 // to the root node, preventing it from being deleted, and tracking any
27 // changes of the root.
28 HandleSDNode Dummy(DAG.getRoot());
30 // The root of the dag may dangle to deleted nodes until the type legalizer is
31 // done. Set it to null to avoid confusion.
32 DAG.setRoot(SDValue());
34 // Walk all nodes in the graph, assigning them a NodeID of 'ReadyToProcess'
35 // (and remembering them) if they are leaves and assigning 'NewNode' if
37 for (SelectionDAG::allnodes_iterator I = DAG.allnodes_begin(),
38 E = DAG.allnodes_end(); I != E; ++I) {
39 if (I->getNumOperands() == 0) {
40 I->setNodeId(ReadyToProcess);
41 Worklist.push_back(I);
43 I->setNodeId(NewNode);
47 // Now that we have a set of nodes to process, handle them all.
48 while (!Worklist.empty()) {
49 SDNode *N = Worklist.back();
51 assert(N->getNodeId() == ReadyToProcess &&
52 "Node should be ready if on worklist!");
54 if (IgnoreNodeResults(N))
57 // Scan the values produced by the node, checking to see if any result
59 for (unsigned i = 0, NumResults = N->getNumValues(); i < NumResults; ++i) {
60 MVT ResultVT = N->getValueType(i);
61 switch (getTypeAction(ResultVT)) {
63 assert(false && "Unknown action!");
67 PromoteIntegerResult(N, i);
70 ExpandIntegerResult(N, i);
73 SoftenFloatResult(N, i);
76 ExpandFloatResult(N, i);
79 ScalarizeVectorResult(N, i);
82 SplitVectorResult(N, i);
88 // Scan the operand list for the node, handling any nodes with operands that
91 unsigned NumOperands = N->getNumOperands();
92 bool NeedsRevisit = false;
94 for (i = 0; i != NumOperands; ++i) {
95 if (IgnoreNodeResults(N->getOperand(i).getNode()))
98 MVT OpVT = N->getOperand(i).getValueType();
99 switch (getTypeAction(OpVT)) {
101 assert(false && "Unknown action!");
105 NeedsRevisit = PromoteIntegerOperand(N, i);
108 NeedsRevisit = ExpandIntegerOperand(N, i);
111 NeedsRevisit = SoftenFloatOperand(N, i);
114 NeedsRevisit = ExpandFloatOperand(N, i);
116 case ScalarizeVector:
117 NeedsRevisit = ScalarizeVectorOperand(N, i);
120 NeedsRevisit = SplitVectorOperand(N, i);
126 // If the node needs revisiting, don't add all users to the worklist etc.
130 if (i == NumOperands) {
131 DEBUG(cerr << "Legally typed node: "; N->dump(&DAG); cerr << "\n");
136 // If we reach here, the node was processed, potentially creating new nodes.
137 // Mark it as processed and add its users to the worklist as appropriate.
138 N->setNodeId(Processed);
140 for (SDNode::use_iterator UI = N->use_begin(), E = N->use_end();
143 int NodeID = User->getNodeId();
144 assert(NodeID != ReadyToProcess && NodeID != Processed &&
145 "Invalid node id for user of unprocessed node!");
147 // This node has two options: it can either be a new node or its Node ID
148 // may be a count of the number of operands it has that are not ready.
150 User->setNodeId(NodeID-1);
152 // If this was the last use it was waiting on, add it to the ready list.
153 if (NodeID-1 == ReadyToProcess)
154 Worklist.push_back(User);
158 // Otherwise, this node is new: this is the first operand of it that
159 // became ready. Its new NodeID is the number of operands it has minus 1
160 // (as this node is now processed).
161 assert(NodeID == NewNode && "Unknown node ID!");
162 User->setNodeId(User->getNumOperands()-1);
164 // If the node only has a single operand, it is now ready.
165 if (User->getNumOperands() == 1)
166 Worklist.push_back(User);
170 // If the root changed (e.g. it was a dead load, update the root).
171 DAG.setRoot(Dummy.getValue());
175 // Remove dead nodes. This is important to do for cleanliness but also before
176 // the checking loop below. Implicit folding by the DAG.getNode operators can
177 // cause unreachable nodes to be around with their flags set to new.
178 DAG.RemoveDeadNodes();
180 // In a debug build, scan all the nodes to make sure we found them all. This
181 // ensures that there are no cycles and that everything got processed.
183 for (SelectionDAG::allnodes_iterator I = DAG.allnodes_begin(),
184 E = DAG.allnodes_end(); I != E; ++I) {
187 // Check that all result types are legal.
188 if (!IgnoreNodeResults(I))
189 for (unsigned i = 0, NumVals = I->getNumValues(); i < NumVals; ++i)
190 if (!isTypeLegal(I->getValueType(i))) {
191 cerr << "Result type " << i << " illegal!\n";
195 // Check that all operand types are legal.
196 for (unsigned i = 0, NumOps = I->getNumOperands(); i < NumOps; ++i)
197 if (!IgnoreNodeResults(I->getOperand(i).getNode()) &&
198 !isTypeLegal(I->getOperand(i).getValueType())) {
199 cerr << "Operand type " << i << " illegal!\n";
203 if (I->getNodeId() != Processed) {
204 if (I->getNodeId() == NewNode)
205 cerr << "New node not 'noticed'?\n";
206 else if (I->getNodeId() > 0)
207 cerr << "Operand not processed?\n";
208 else if (I->getNodeId() == ReadyToProcess)
209 cerr << "Not added to worklist?\n";
214 I->dump(&DAG); cerr << "\n";
221 /// AnalyzeNewNode - The specified node is the root of a subtree of potentially
222 /// new nodes. Correct any processed operands (this may change the node) and
223 /// calculate the NodeId.
224 /// Returns the potentially changed node.
225 void DAGTypeLegalizer::AnalyzeNewNode(SDValue &Val) {
226 SDNode *N = Val.getNode();
228 // If this was an existing node that is already done, we're done.
229 if (N->getNodeId() != NewNode)
232 // Remove any stale map entries.
235 // Okay, we know that this node is new. Recursively walk all of its operands
236 // to see if they are new also. The depth of this walk is bounded by the size
237 // of the new tree that was constructed (usually 2-3 nodes), so we don't worry
238 // about revisiting of nodes.
240 // As we walk the operands, keep track of the number of nodes that are
241 // processed. If non-zero, this will become the new nodeid of this node.
242 // Already processed operands may need to be remapped to the node that
243 // replaced them, which can result in our node changing. Since remapping
244 // is rare, the code tries to minimize overhead in the non-remapping case.
246 SmallVector<SDValue, 8> NewOps;
247 unsigned NumProcessed = 0;
248 for (unsigned i = 0, e = N->getNumOperands(); i != e; ++i) {
249 SDValue OrigOp = N->getOperand(i);
252 if (Op.getNode()->getNodeId() == Processed)
254 else if (Op.getNode()->getNodeId() == NewNode)
257 if (Op.getNode()->getNodeId() == Processed)
260 if (!NewOps.empty()) {
261 // Some previous operand changed. Add this one to the list.
262 NewOps.push_back(Op);
263 } else if (Op != OrigOp) {
264 // This is the first operand to change - add all operands so far.
265 for (unsigned j = 0; j < i; ++j)
266 NewOps.push_back(N->getOperand(j));
267 NewOps.push_back(Op);
271 // Some operands changed - update the node.
272 if (!NewOps.empty()) {
273 Val = DAG.UpdateNodeOperands(Val, &NewOps[0], NewOps.size());
274 if (Val.getNode() != N) {
275 // The node morphed, work with the new node.
278 // Maybe it morphed into a previously analyzed node?
279 if (N->getNodeId() != NewNode) {
280 if (N->getNodeId() == Processed)
281 // An already processed node may need to be remapped.
286 // It morphed into a different new node. Do the equivalent of passing
287 // it to AnalyzeNewNode: expunge it and calculate the NodeId.
292 // Calculate the NodeId.
293 N->setNodeId(N->getNumOperands()-NumProcessed);
294 if (N->getNodeId() == ReadyToProcess)
295 Worklist.push_back(N);
300 /// NodeUpdateListener - This class is a DAGUpdateListener that listens for
301 /// updates to nodes and recomputes their ready state.
302 class VISIBILITY_HIDDEN NodeUpdateListener :
303 public SelectionDAG::DAGUpdateListener {
304 DAGTypeLegalizer &DTL;
306 explicit NodeUpdateListener(DAGTypeLegalizer &dtl) : DTL(dtl) {}
308 virtual void NodeDeleted(SDNode *N, SDNode *E) {
309 assert(N->getNodeId() != DAGTypeLegalizer::Processed &&
310 N->getNodeId() != DAGTypeLegalizer::ReadyToProcess &&
311 "RAUW deleted processed node!");
312 // It is possible, though rare, for the deleted node N to occur as a
313 // target in a map, so note the replacement N -> E in ReplacedNodes.
314 assert(E && "Node not replaced?");
315 DTL.NoteDeletion(N, E);
318 virtual void NodeUpdated(SDNode *N) {
319 // Node updates can mean pretty much anything. It is possible that an
320 // operand was set to something already processed (f.e.) in which case
321 // this node could become ready. Recompute its flags.
322 assert(N->getNodeId() != DAGTypeLegalizer::Processed &&
323 N->getNodeId() != DAGTypeLegalizer::ReadyToProcess &&
324 "RAUW updated processed node!");
325 DTL.ReanalyzeNode(N);
331 /// ReplaceValueWith - The specified value was legalized to the specified other
332 /// value. If they are different, update the DAG and NodeIDs replacing any uses
333 /// of From to use To instead.
334 void DAGTypeLegalizer::ReplaceValueWith(SDValue From, SDValue To) {
335 if (From == To) return;
337 // If expansion produced new nodes, make sure they are properly marked.
338 ExpungeNode(From.getNode());
339 AnalyzeNewNode(To); // Expunges To.
341 // Anything that used the old node should now use the new one. Note that this
342 // can potentially cause recursive merging.
343 NodeUpdateListener NUL(*this);
344 DAG.ReplaceAllUsesOfValueWith(From, To, &NUL);
346 // The old node may still be present in a map like ExpandedIntegers or
347 // PromotedIntegers. Inform maps about the replacement.
348 ReplacedNodes[From] = To;
351 /// ReplaceNodeWith - Replace uses of the 'from' node's results with the 'to'
352 /// node's results. The from and to node must define identical result types.
353 void DAGTypeLegalizer::ReplaceNodeWith(SDNode *From, SDNode *To) {
354 if (From == To) return;
356 // If expansion produced new nodes, make sure they are properly marked.
360 AnalyzeNewNode(Val); // Expunges To. FIXME: All results mapped the same?
363 assert(From->getNumValues() == To->getNumValues() &&
364 "Node results don't match");
366 // Anything that used the old node should now use the new one. Note that this
367 // can potentially cause recursive merging.
368 NodeUpdateListener NUL(*this);
369 DAG.ReplaceAllUsesWith(From, To, &NUL);
371 // The old node may still be present in a map like ExpandedIntegers or
372 // PromotedIntegers. Inform maps about the replacement.
373 for (unsigned i = 0, e = From->getNumValues(); i != e; ++i) {
374 assert(From->getValueType(i) == To->getValueType(i) &&
375 "Node results don't match");
376 ReplacedNodes[SDValue(From, i)] = SDValue(To, i);
380 /// RemapNode - If the specified value was already legalized to another value,
381 /// replace it by that value.
382 void DAGTypeLegalizer::RemapNode(SDValue &N) {
383 DenseMap<SDValue, SDValue>::iterator I = ReplacedNodes.find(N);
384 if (I != ReplacedNodes.end()) {
385 // Use path compression to speed up future lookups if values get multiply
386 // replaced with other values.
387 RemapNode(I->second);
390 assert(N.getNode()->getNodeId() != NewNode && "Mapped to unanalyzed node!");
393 /// ExpungeNode - If N has a bogus mapping in ReplacedNodes, eliminate it.
394 /// This can occur when a node is deleted then reallocated as a new node -
395 /// the mapping in ReplacedNodes applies to the deleted node, not the new
397 /// The only map that can have a deleted node as a source is ReplacedNodes.
398 /// Other maps can have deleted nodes as targets, but since their looked-up
399 /// values are always immediately remapped using RemapNode, resulting in a
400 /// not-deleted node, this is harmless as long as ReplacedNodes/RemapNode
401 /// always performs correct mappings. In order to keep the mapping correct,
402 /// ExpungeNode should be called on any new nodes *before* adding them as
403 /// either source or target to ReplacedNodes (which typically means calling
404 /// Expunge when a new node is first seen, since it may no longer be marked
405 /// NewNode by the time it is added to ReplacedNodes).
406 void DAGTypeLegalizer::ExpungeNode(SDNode *N) {
407 if (N->getNodeId() != NewNode)
410 // If N is not remapped by ReplacedNodes then there is nothing to do.
412 for (i = 0, e = N->getNumValues(); i != e; ++i)
413 if (ReplacedNodes.find(SDValue(N, i)) != ReplacedNodes.end())
419 // Remove N from all maps - this is expensive but rare.
421 for (DenseMap<SDValue, SDValue>::iterator I = PromotedIntegers.begin(),
422 E = PromotedIntegers.end(); I != E; ++I) {
423 assert(I->first.getNode() != N);
424 RemapNode(I->second);
427 for (DenseMap<SDValue, SDValue>::iterator I = SoftenedFloats.begin(),
428 E = SoftenedFloats.end(); I != E; ++I) {
429 assert(I->first.getNode() != N);
430 RemapNode(I->second);
433 for (DenseMap<SDValue, SDValue>::iterator I = ScalarizedVectors.begin(),
434 E = ScalarizedVectors.end(); I != E; ++I) {
435 assert(I->first.getNode() != N);
436 RemapNode(I->second);
439 for (DenseMap<SDValue, std::pair<SDValue, SDValue> >::iterator
440 I = ExpandedIntegers.begin(), E = ExpandedIntegers.end(); I != E; ++I){
441 assert(I->first.getNode() != N);
442 RemapNode(I->second.first);
443 RemapNode(I->second.second);
446 for (DenseMap<SDValue, std::pair<SDValue, SDValue> >::iterator
447 I = ExpandedFloats.begin(), E = ExpandedFloats.end(); I != E; ++I) {
448 assert(I->first.getNode() != N);
449 RemapNode(I->second.first);
450 RemapNode(I->second.second);
453 for (DenseMap<SDValue, std::pair<SDValue, SDValue> >::iterator
454 I = SplitVectors.begin(), E = SplitVectors.end(); I != E; ++I) {
455 assert(I->first.getNode() != N);
456 RemapNode(I->second.first);
457 RemapNode(I->second.second);
460 for (DenseMap<SDValue, SDValue>::iterator I = ReplacedNodes.begin(),
461 E = ReplacedNodes.end(); I != E; ++I)
462 RemapNode(I->second);
464 for (unsigned i = 0, e = N->getNumValues(); i != e; ++i)
465 ReplacedNodes.erase(SDValue(N, i));
468 void DAGTypeLegalizer::SetPromotedInteger(SDValue Op, SDValue Result) {
469 AnalyzeNewNode(Result);
471 SDValue &OpEntry = PromotedIntegers[Op];
472 assert(OpEntry.getNode() == 0 && "Node is already promoted!");
476 void DAGTypeLegalizer::SetSoftenedFloat(SDValue Op, SDValue Result) {
477 AnalyzeNewNode(Result);
479 SDValue &OpEntry = SoftenedFloats[Op];
480 assert(OpEntry.getNode() == 0 && "Node is already converted to integer!");
484 void DAGTypeLegalizer::SetScalarizedVector(SDValue Op, SDValue Result) {
485 AnalyzeNewNode(Result);
487 SDValue &OpEntry = ScalarizedVectors[Op];
488 assert(OpEntry.getNode() == 0 && "Node is already scalarized!");
492 void DAGTypeLegalizer::GetExpandedInteger(SDValue Op, SDValue &Lo,
494 std::pair<SDValue, SDValue> &Entry = ExpandedIntegers[Op];
495 RemapNode(Entry.first);
496 RemapNode(Entry.second);
497 assert(Entry.first.getNode() && "Operand isn't expanded");
502 void DAGTypeLegalizer::SetExpandedInteger(SDValue Op, SDValue Lo,
504 // Lo/Hi may have been newly allocated, if so, add nodeid's as relevant.
508 // Remember that this is the result of the node.
509 std::pair<SDValue, SDValue> &Entry = ExpandedIntegers[Op];
510 assert(Entry.first.getNode() == 0 && "Node already expanded");
515 void DAGTypeLegalizer::GetExpandedFloat(SDValue Op, SDValue &Lo,
517 std::pair<SDValue, SDValue> &Entry = ExpandedFloats[Op];
518 RemapNode(Entry.first);
519 RemapNode(Entry.second);
520 assert(Entry.first.getNode() && "Operand isn't expanded");
525 void DAGTypeLegalizer::SetExpandedFloat(SDValue Op, SDValue Lo,
527 // Lo/Hi may have been newly allocated, if so, add nodeid's as relevant.
531 // Remember that this is the result of the node.
532 std::pair<SDValue, SDValue> &Entry = ExpandedFloats[Op];
533 assert(Entry.first.getNode() == 0 && "Node already expanded");
538 void DAGTypeLegalizer::GetSplitVector(SDValue Op, SDValue &Lo,
540 std::pair<SDValue, SDValue> &Entry = SplitVectors[Op];
541 RemapNode(Entry.first);
542 RemapNode(Entry.second);
543 assert(Entry.first.getNode() && "Operand isn't split");
548 void DAGTypeLegalizer::SetSplitVector(SDValue Op, SDValue Lo,
550 // Lo/Hi may have been newly allocated, if so, add nodeid's as relevant.
554 // Remember that this is the result of the node.
555 std::pair<SDValue, SDValue> &Entry = SplitVectors[Op];
556 assert(Entry.first.getNode() == 0 && "Node already split");
562 //===----------------------------------------------------------------------===//
564 //===----------------------------------------------------------------------===//
566 /// BitConvertToInteger - Convert to an integer of the same size.
567 SDValue DAGTypeLegalizer::BitConvertToInteger(SDValue Op) {
568 unsigned BitWidth = Op.getValueType().getSizeInBits();
569 return DAG.getNode(ISD::BIT_CONVERT, MVT::getIntegerVT(BitWidth), Op);
572 SDValue DAGTypeLegalizer::CreateStackStoreLoad(SDValue Op,
574 // Create the stack frame object. Make sure it is aligned for both
575 // the source and destination types.
577 TLI.getTargetData()->getPrefTypeAlignment(Op.getValueType().getTypeForMVT());
578 SDValue FIPtr = DAG.CreateStackTemporary(DestVT, SrcAlign);
580 // Emit a store to the stack slot.
581 SDValue Store = DAG.getStore(DAG.getEntryNode(), Op, FIPtr, NULL, 0);
582 // Result is a load from the stack slot.
583 return DAG.getLoad(DestVT, Store, FIPtr, NULL, 0);
586 /// JoinIntegers - Build an integer with low bits Lo and high bits Hi.
587 SDValue DAGTypeLegalizer::JoinIntegers(SDValue Lo, SDValue Hi) {
588 MVT LVT = Lo.getValueType();
589 MVT HVT = Hi.getValueType();
590 MVT NVT = MVT::getIntegerVT(LVT.getSizeInBits() + HVT.getSizeInBits());
592 Lo = DAG.getNode(ISD::ZERO_EXTEND, NVT, Lo);
593 Hi = DAG.getNode(ISD::ANY_EXTEND, NVT, Hi);
594 Hi = DAG.getNode(ISD::SHL, NVT, Hi, DAG.getConstant(LVT.getSizeInBits(),
595 TLI.getShiftAmountTy()));
596 return DAG.getNode(ISD::OR, NVT, Lo, Hi);
599 /// SplitInteger - Return the lower LoVT bits of Op in Lo and the upper HiVT
601 void DAGTypeLegalizer::SplitInteger(SDValue Op,
603 SDValue &Lo, SDValue &Hi) {
604 assert(LoVT.getSizeInBits() + HiVT.getSizeInBits() ==
605 Op.getValueType().getSizeInBits() && "Invalid integer splitting!");
606 Lo = DAG.getNode(ISD::TRUNCATE, LoVT, Op);
607 Hi = DAG.getNode(ISD::SRL, Op.getValueType(), Op,
608 DAG.getConstant(LoVT.getSizeInBits(),
609 TLI.getShiftAmountTy()));
610 Hi = DAG.getNode(ISD::TRUNCATE, HiVT, Hi);
613 /// SplitInteger - Return the lower and upper halves of Op's bits in a value type
614 /// half the size of Op's.
615 void DAGTypeLegalizer::SplitInteger(SDValue Op,
616 SDValue &Lo, SDValue &Hi) {
617 MVT HalfVT = MVT::getIntegerVT(Op.getValueType().getSizeInBits()/2);
618 SplitInteger(Op, HalfVT, HalfVT, Lo, Hi);
621 /// MakeLibCall - Generate a libcall taking the given operands as arguments and
622 /// returning a result of type RetVT.
623 SDValue DAGTypeLegalizer::MakeLibCall(RTLIB::Libcall LC, MVT RetVT,
624 const SDValue *Ops, unsigned NumOps,
626 TargetLowering::ArgListTy Args;
627 Args.reserve(NumOps);
629 TargetLowering::ArgListEntry Entry;
630 for (unsigned i = 0; i != NumOps; ++i) {
632 Entry.Ty = Entry.Node.getValueType().getTypeForMVT();
633 Entry.isSExt = isSigned;
634 Entry.isZExt = !isSigned;
635 Args.push_back(Entry);
637 SDValue Callee = DAG.getExternalSymbol(TLI.getLibcallName(LC),
640 const Type *RetTy = RetVT.getTypeForMVT();
641 std::pair<SDValue,SDValue> CallInfo =
642 TLI.LowerCallTo(DAG.getEntryNode(), RetTy, isSigned, !isSigned, false,
643 false, CallingConv::C, false, Callee, Args, DAG);
644 return CallInfo.first;
647 SDValue DAGTypeLegalizer::GetVectorElementPointer(SDValue VecPtr, MVT EltVT,
649 // Make sure the index type is big enough to compute in.
650 if (Index.getValueType().bitsGT(TLI.getPointerTy()))
651 Index = DAG.getNode(ISD::TRUNCATE, TLI.getPointerTy(), Index);
653 Index = DAG.getNode(ISD::ZERO_EXTEND, TLI.getPointerTy(), Index);
655 // Calculate the element offset and add it to the pointer.
656 unsigned EltSize = EltVT.getSizeInBits() / 8; // FIXME: should be ABI size.
658 Index = DAG.getNode(ISD::MUL, Index.getValueType(), Index,
659 DAG.getConstant(EltSize, Index.getValueType()));
660 return DAG.getNode(ISD::ADD, Index.getValueType(), Index, VecPtr);
663 /// GetSplitDestVTs - Compute the VTs needed for the low/hi parts of a type
664 /// which is split into two not necessarily identical pieces.
665 void DAGTypeLegalizer::GetSplitDestVTs(MVT InVT, MVT &LoVT, MVT &HiVT) {
666 if (!InVT.isVector()) {
667 LoVT = HiVT = TLI.getTypeToTransformTo(InVT);
669 MVT NewEltVT = InVT.getVectorElementType();
670 unsigned NumElements = InVT.getVectorNumElements();
671 if ((NumElements & (NumElements-1)) == 0) { // Simple power of two vector.
673 LoVT = HiVT = MVT::getVectorVT(NewEltVT, NumElements);
674 } else { // Non-power-of-two vectors.
675 unsigned NewNumElts_Lo = 1 << Log2_32(NumElements);
676 unsigned NewNumElts_Hi = NumElements - NewNumElts_Lo;
677 LoVT = MVT::getVectorVT(NewEltVT, NewNumElts_Lo);
678 HiVT = MVT::getVectorVT(NewEltVT, NewNumElts_Hi);
684 //===----------------------------------------------------------------------===//
686 //===----------------------------------------------------------------------===//
688 /// LegalizeTypes - This transforms the SelectionDAG into a SelectionDAG that
689 /// only uses types natively supported by the target.
691 /// Note that this is an involved process that may invalidate pointers into
693 void SelectionDAG::LegalizeTypes() {
694 DAGTypeLegalizer(*this).run();