llvm.org GIT mirror llvm / aa97bb5
Fix PR11948: the result type of an icmp may be a vector of boolean - don't assume it is a boolean. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@150247 91177308-0d34-0410-b5e6-96231b3b80d8 Duncan Sands 7 years ago
2 changed file(s) with 12 addition(s) and 0 deletion(s). Raw diff Collapse all Expand all
475475 // the original comparison.
476476 if (TCmp == FCmp)
477477 return TCmp;
478
479 // The remaining cases only make sense if the select condition has the same
480 // type as the result of the comparison, so bail out if this is not so.
481 if (Cond->getType()->isVectorTy() != RHS->getType()->isVectorTy())
482 return 0;
478483 // If the false value simplified to false, then the result of the compare
479484 // is equal to "Cond && TCmp". This also catches the case when the false
480485 // value simplified to false and the true value to true, returning "Cond".
414414 ret <2 x i1> %c
415415 ; CHECK: ret <2 x i1> %cond
416416 }
417
418 define <2 x i1> @vectorselectcrash(i32 %arg1) { ; PR11948
419 %tobool40 = icmp ne i32 %arg1, 0
420 %cond43 = select i1 %tobool40, <2 x i16> , <2 x i16>
421 %cmp45 = icmp ugt <2 x i16> %cond43,
422 ret <2 x i1> %cmp45
423 }