summaryrefslogtreecommitdiffstats
path: root/llvm/lib
diff options
context:
space:
mode:
authorDuncan Sands <baldrick@free.fr>2008-07-14 17:15:45 +0000
committerDuncan Sands <baldrick@free.fr>2008-07-14 17:15:45 +0000
commitd47d2d6b122cbab18da30d9443f60e21fc3c80e6 (patch)
tree75c02f7342d646d55a9be76cac478246d7142a26 /llvm/lib
parent6d1a3c2e2bb473a3204a680f599b040dc97c4ce1 (diff)
downloadbcm5719-llvm-d47d2d6b122cbab18da30d9443f60e21fc3c80e6.tar.gz
bcm5719-llvm-d47d2d6b122cbab18da30d9443f60e21fc3c80e6.zip
Ignore TargetConstant with an illegal type. These
are used for passing huge immediates in inline ASM from the front-end straight down to the ASM writer. Of course this is a hack, but it is simple, limited in scope, works in practice, and is what LegalizeDAG does. llvm-svn: 53553
Diffstat (limited to 'llvm/lib')
-rw-r--r--llvm/lib/CodeGen/SelectionDAG/LegalizeTypes.cpp28
-rw-r--r--llvm/lib/CodeGen/SelectionDAG/LegalizeTypes.h5
2 files changed, 23 insertions, 10 deletions
diff --git a/llvm/lib/CodeGen/SelectionDAG/LegalizeTypes.cpp b/llvm/lib/CodeGen/SelectionDAG/LegalizeTypes.cpp
index 285d797e351..5c04de912d1 100644
--- a/llvm/lib/CodeGen/SelectionDAG/LegalizeTypes.cpp
+++ b/llvm/lib/CodeGen/SelectionDAG/LegalizeTypes.cpp
@@ -60,11 +60,12 @@ void DAGTypeLegalizer::run() {
assert(N->getNodeId() == ReadyToProcess &&
"Node should be ready if on worklist!");
+ if (IgnoreNodeResults(N))
+ goto ScanOperands;
+
// Scan the values produced by the node, checking to see if any result
// types are illegal.
- unsigned i = 0;
- unsigned NumResults = N->getNumValues();
- do {
+ for (unsigned i = 0, NumResults = N->getNumValues(); i < NumResults; ++i) {
MVT ResultVT = N->getValueType(i);
switch (getTypeAction(ResultVT)) {
default:
@@ -90,14 +91,19 @@ void DAGTypeLegalizer::run() {
SplitVectorResult(N, i);
goto NodeDone;
}
- } while (++i < NumResults);
+ }
+ScanOperands:
// Scan the operand list for the node, handling any nodes with operands that
// are illegal.
{
unsigned NumOperands = N->getNumOperands();
bool NeedsRevisit = false;
+ unsigned i;
for (i = 0; i != NumOperands; ++i) {
+ if (IgnoreNodeResults(N->getOperand(i).Val))
+ continue;
+
MVT OpVT = N->getOperand(i).getValueType();
switch (getTypeAction(OpVT)) {
default:
@@ -187,15 +193,17 @@ NodeDone:
bool Failed = false;
// Check that all result types are legal.
- for (unsigned i = 0, NumVals = I->getNumValues(); i < NumVals; ++i)
- if (!isTypeLegal(I->getValueType(i))) {
- cerr << "Result type " << i << " illegal!\n";
- Failed = true;
- }
+ if (!IgnoreNodeResults(I))
+ for (unsigned i = 0, NumVals = I->getNumValues(); i < NumVals; ++i)
+ if (!isTypeLegal(I->getValueType(i))) {
+ cerr << "Result type " << i << " illegal!\n";
+ Failed = true;
+ }
// Check that all operand types are legal.
for (unsigned i = 0, NumOps = I->getNumOperands(); i < NumOps; ++i)
- if (!isTypeLegal(I->getOperand(i).getValueType())) {
+ if (!IgnoreNodeResults(I->getOperand(i).Val) &&
+ !isTypeLegal(I->getOperand(i).getValueType())) {
cerr << "Operand type " << i << " illegal!\n";
Failed = true;
}
diff --git a/llvm/lib/CodeGen/SelectionDAG/LegalizeTypes.h b/llvm/lib/CodeGen/SelectionDAG/LegalizeTypes.h
index b60ad2708fa..4063c975877 100644
--- a/llvm/lib/CodeGen/SelectionDAG/LegalizeTypes.h
+++ b/llvm/lib/CodeGen/SelectionDAG/LegalizeTypes.h
@@ -105,6 +105,11 @@ private:
return ValueTypeActions.getTypeAction(VT) == TargetLowering::Legal;
}
+ /// IgnoreNodeResults - Pretend all of this node's results are legal.
+ bool IgnoreNodeResults(SDNode *N) const {
+ return N->getOpcode() == ISD::TargetConstant;
+ }
+
/// PromotedIntegers - For integer nodes that are below legal width, this map
/// indicates what promoted value to use.
DenseMap<SDOperand, SDOperand> PromotedIntegers;
OpenPOWER on IntegriCloud