diff options
author | Patrik Hagglund <patrik.h.hagglund@ericsson.com> | 2012-12-17 14:30:06 +0000 |
---|---|---|
committer | Patrik Hagglund <patrik.h.hagglund@ericsson.com> | 2012-12-17 14:30:06 +0000 |
commit | 3d170e64ca1af491e2aa58f882f93b8e8111eef8 (patch) | |
tree | 0adbb20e4241c4dd3789e67dbdb4e37d610126c0 /lib/CodeGen/SelectionDAG/FastISel.cpp | |
parent | 179481419851ca4bd3643dc89d3d83056246c4a8 (diff) |
Revert/correct some FastISel changes in r170104 (EVT->MVT for
TargetLowering::getRegClassFor).
Some isSimple() guards were missing, or getSimpleVT() were hoisted too
far, resulting in asserts on valid LLVM assembly input.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@170336 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/CodeGen/SelectionDAG/FastISel.cpp')
-rw-r--r-- | lib/CodeGen/SelectionDAG/FastISel.cpp | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/lib/CodeGen/SelectionDAG/FastISel.cpp b/lib/CodeGen/SelectionDAG/FastISel.cpp index e30a66f05b..b7042532e8 100644 --- a/lib/CodeGen/SelectionDAG/FastISel.cpp +++ b/lib/CodeGen/SelectionDAG/FastISel.cpp @@ -737,14 +737,15 @@ bool FastISel::SelectBitCast(const User *I) { } // Bitcasts of other values become reg-reg copies or BITCAST operators. - MVT SrcVT = TLI.getSimpleValueType(I->getOperand(0)->getType()); - MVT DstVT = TLI.getSimpleValueType(I->getType()); - - if (SrcVT == MVT::Other || DstVT == MVT::Other || - !TLI.isTypeLegal(SrcVT) || !TLI.isTypeLegal(DstVT)) + EVT SrcEVT = TLI.getValueType(I->getOperand(0)->getType()); + EVT DstEVT = TLI.getValueType(I->getType()); + if (SrcEVT == MVT::Other || DstEVT == MVT::Other || + !TLI.isTypeLegal(SrcEVT) || !TLI.isTypeLegal(DstEVT)) // Unhandled type. Halt "fast" selection and bail. return false; + MVT SrcVT = SrcEVT.getSimpleVT(); + MVT DstVT = DstEVT.getSimpleVT(); unsigned Op0 = getRegForValue(I->getOperand(0)); if (Op0 == 0) // Unhandled operand. Halt "fast" selection and bail. |