diff options
author | Dan Gohman <gohman@apple.com> | 2008-09-05 21:27:34 +0000 |
---|---|---|
committer | Dan Gohman <gohman@apple.com> | 2008-09-05 21:27:34 +0000 |
commit | c75d4358b511d97c37b5aef25dc17d12f0b2920b (patch) | |
tree | 4592f9f40096f6d25a2935a7349ee0215af91dd0 /lib | |
parent | 91e305b18628619eb5abd3d7a162c7d99f292824 (diff) | |
download | external_llvm-c75d4358b511d97c37b5aef25dc17d12f0b2920b.zip external_llvm-c75d4358b511d97c37b5aef25dc17d12f0b2920b.tar.gz external_llvm-c75d4358b511d97c37b5aef25dc17d12f0b2920b.tar.bz2 |
Fix X86FastISel's shift and select code to reject illegal types.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@55857 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib')
-rw-r--r-- | lib/Target/X86/X86FastISel.cpp | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/lib/Target/X86/X86FastISel.cpp b/lib/Target/X86/X86FastISel.cpp index a9003e8..bf939ab 100644 --- a/lib/Target/X86/X86FastISel.cpp +++ b/lib/Target/X86/X86FastISel.cpp @@ -504,6 +504,10 @@ bool X86FastISel::X86SelectShift(Instruction *I) { return false; } + MVT VT = MVT::getMVT(I->getType(), /*HandleUnknown=*/true); + if (VT == MVT::Other || !TLI.isTypeLegal(VT)) + return false; + unsigned Op0Reg = getRegForValue(I->getOperand(0)); if (Op0Reg == 0) return false; unsigned Op1Reg = getRegForValue(I->getOperand(1)); @@ -516,7 +520,7 @@ bool X86FastISel::X86SelectShift(Instruction *I) { } bool X86FastISel::X86SelectSelect(Instruction *I) { - const Type *Ty = I->getOperand(1)->getType(); + const Type *Ty = I->getType(); if (isa<PointerType>(Ty)) Ty = TLI.getTargetData()->getIntPtrType(); @@ -535,6 +539,10 @@ bool X86FastISel::X86SelectSelect(Instruction *I) { return false; } + MVT VT = MVT::getMVT(Ty, /*HandleUnknown=*/true); + if (VT == MVT::Other || !TLI.isTypeLegal(VT)) + return false; + unsigned Op0Reg = getRegForValue(I->getOperand(0)); if (Op0Reg == 0) return false; unsigned Op1Reg = getRegForValue(I->getOperand(1)); |