1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2024-11-24 11:42:57 +01:00

[ConstantFold] Don't evaluate FP or FP vector casts or truncations when simplifying icmp

Fix PR41476

llvm-svn: 358262
This commit is contained in:
Fangrui Song 2019-04-12 07:34:30 +00:00
parent e1ecb61f36
commit 3fd11db307
2 changed files with 9 additions and 1 deletions

View File

@ -1574,7 +1574,7 @@ static ICmpInst::Predicate evaluateICmpRelation(Constant *V1, Constant *V2,
case Instruction::ZExt:
case Instruction::SExt:
// We can't evaluate floating point casts or truncations.
if (CE1Op0->getType()->isFloatingPointTy())
if (CE1Op0->getType()->isFPOrFPVectorTy())
break;
// If the cast is not actually changing bits, and the second operand is a

View File

@ -74,6 +74,14 @@ define <4 x i32> @test9(<1 x i64> %y) {
ret <4 x i32> %c
}
define <1 x i1> @test10() {
; CHECK-LABEL: @test10(
; CHECK-NEXT: ret <1 x i1> <i1 icmp eq (i64 bitcast (<1 x double> <double 0xFFFFFFFFFFFFFFFF> to i64), i64 0)>
;
%ret = icmp eq <1 x i64> <i64 bitcast (<1 x double> <double 0xFFFFFFFFFFFFFFFF> to i64)>, zeroinitializer
ret <1 x i1> %ret
}
; from MultiSource/Benchmarks/Bullet
define <2 x float> @foo() {
; CHECK-LABEL: @foo(