diff options
author | Dan Gohman <gohman@apple.com> | 2008-09-05 01:33:56 +0000 |
---|---|---|
committer | Dan Gohman <gohman@apple.com> | 2008-09-05 01:33:56 +0000 |
commit | 4f22bb0676e09aacf6898c5b9ab489a8b01f8fc0 (patch) | |
tree | 54f3d780f32176673a46a398c48c0c5a827e6bd6 | |
parent | f52550b50ee2d076dfad077bbe81b11f1300ab03 (diff) |
Check a comparion's operand type for legality before
expanding its operands.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@55820 91177308-0d34-0410-b5e6-96231b3b80d8
-rw-r--r-- | lib/Target/X86/X86FastISel.cpp | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/lib/Target/X86/X86FastISel.cpp b/lib/Target/X86/X86FastISel.cpp index 1314f63682..6f6b9908da 100644 --- a/lib/Target/X86/X86FastISel.cpp +++ b/lib/Target/X86/X86FastISel.cpp @@ -262,15 +262,15 @@ bool X86FastISel::X86SelectLoad(Instruction *I) { bool X86FastISel::X86SelectCmp(Instruction *I) { CmpInst *CI = cast<CmpInst>(I); + MVT VT = TLI.getValueType(I->getOperand(0)->getType()); + if (!TLI.isTypeLegal(VT)) + return false; + unsigned Op0Reg = getRegForValue(CI->getOperand(0)); if (Op0Reg == 0) return false; unsigned Op1Reg = getRegForValue(CI->getOperand(1)); if (Op1Reg == 0) return false; - MVT VT = TLI.getValueType(I->getOperand(0)->getType()); - if (!TLI.isTypeLegal(VT)) - return false; - unsigned Opc; switch (VT.getSimpleVT()) { case MVT::i8: Opc = X86::CMP8rr; break; |