mirror of
https://github.com/RPCS3/llvm-mirror.git
synced 2025-04-04 08:41:49 +00:00
Fix X86FastISel's shift and select code to reject illegal types.
llvm-svn: 55857
This commit is contained in:
parent
6b48790d88
commit
930d0be24c
@ -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));
|
||||
|
Loading…
x
Reference in New Issue
Block a user