1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2024-10-19 11:02:59 +02:00

Fixed an assertion failure for tracking sext of a vector of integers

llvm-svn: 90290
This commit is contained in:
Mon P Wang 2009-12-02 04:59:58 +00:00
parent 122acaf238
commit 91ac05d480
2 changed files with 15 additions and 1 deletions

View File

@ -659,7 +659,7 @@ unsigned llvm::ComputeNumSignBits(Value *V, const TargetData *TD,
switch (Operator::getOpcode(V)) {
default: break;
case Instruction::SExt:
Tmp = TyBits-cast<IntegerType>(U->getOperand(0)->getType())->getBitWidth();
Tmp = TyBits - U->getOperand(0)->getType()->getScalarSizeInBits();
return ComputeNumSignBits(U->getOperand(0), TD, Depth+1) + Tmp;
case Instruction::AShr:

View File

@ -0,0 +1,14 @@
; Checks to see that instcombine can handle a sign extension of i1
; RUN: opt < %s -instcombine -S | FileCheck %s
define void @test(<2 x i16> %srcA, <2 x i16> %srcB, <2 x i16>* %dst) nounwind {
entry:
; CHECK-NOT: tmask
; CHECK: ret
%cmp = icmp eq <2 x i16> %srcB, %srcA;
%sext = sext <2 x i1> %cmp to <2 x i16>;
%tmask = ashr <2 x i16> %sext, <i16 15, i16 15> ;
store <2 x i16> %tmask, <2 x i16>* %dst;
ret void
}