From b74652aa5bfb3a9453654fb33f0b94fc5dedf0e0 Mon Sep 17 00:00:00 2001 From: Mark Punzalan Date: Thu, 16 Apr 2020 23:01:32 -0700 Subject: [PATCH] [FIR] Use ieee754equals for floating-point equality operations --- .../generators/OperatorExpressionGenerator.kt | 90 ++++---- .../kotlin/backend/jvm/ir/IrUtils.kt | 24 +- .../codegen/box/binaryOp/eqNullableDoubles.kt | 1 - .../box/binaryOp/eqNullableDoublesWithTP.kt | 1 - .../adaptedReferences/inlineDefault.kt | 1 - .../testData/codegen/box/ieee754/anyToReal.kt | 1 - .../codegen/box/ieee754/equalsDouble.kt | 1 - .../equalsDouble_properIeeeComparisons.kt | 1 - .../codegen/box/ieee754/equalsFloat.kt | 1 - .../equalsFloat_properIeeeComparisons.kt | 1 - .../testData/codegen/box/ieee754/equalsNaN.kt | 1 - .../box/ieee754/equalsNullableDouble.kt | 1 - ...alsNullableDouble_properIeeeComparisons.kt | 1 - .../box/ieee754/equalsNullableFloat.kt | 1 - ...ualsNullableFloat_properIeeeComparisons.kt | 1 - .../testData/codegen/box/ieee754/generic.kt | 1 - .../testData/codegen/box/ieee754/inline.kt | 1 - .../codegen/box/ieee754/nullableAnyToReal.kt | 1 - ...hNumericPromotion_properIeeeComparisons.kt | 1 - ...tToDifferentTypes_properIeeeComparisons.kt | 1 - .../smartCastToDoubleAndComparableToDouble.kt | 1 - compiler/testData/codegen/box/ieee754/when.kt | 1 - .../whenNoSubject_properIeeeComparisons.kt | 1 - .../box/ieee754/when_properIeeeComparisons.kt | 1 - .../primitiveNumberComparisons/doubleEqeq.kt | 1 - .../primitiveNumberComparisons/floatEqeq.kt | 1 - .../box/primitiveTypes/comparisonWithNaN.kt | 1 - .../whenSubjectVariable/ieee754Equality.kt | 1 - .../floatingPointEqeq.fir.txt | 195 ---------------- .../floatingPointEqeq.kt | 1 + .../floatingPointExcleq.fir.txt | 209 ------------------ .../floatingPointExcleq.kt | 1 + .../nullableFloatingPointEqeq.fir.txt | 8 +- ...meterWithPrimitiveNumericSupertype.fir.txt | 12 +- .../whenByFloatingPoint.fir.txt | 8 +- .../irText/regressions/coercionInLoop.fir.txt | 2 +- 36 files changed, 85 insertions(+), 491 deletions(-) delete mode 100644 compiler/testData/ir/irText/expressions/floatingPointComparisons/floatingPointEqeq.fir.txt delete mode 100644 compiler/testData/ir/irText/expressions/floatingPointComparisons/floatingPointExcleq.fir.txt diff --git a/compiler/fir/fir2ir/src/org/jetbrains/kotlin/fir/backend/generators/OperatorExpressionGenerator.kt b/compiler/fir/fir2ir/src/org/jetbrains/kotlin/fir/backend/generators/OperatorExpressionGenerator.kt index c56e35f44e7..92f13e7badb 100644 --- a/compiler/fir/fir2ir/src/org/jetbrains/kotlin/fir/backend/generators/OperatorExpressionGenerator.kt +++ b/compiler/fir/fir2ir/src/org/jetbrains/kotlin/fir/backend/generators/OperatorExpressionGenerator.kt @@ -20,7 +20,6 @@ import org.jetbrains.kotlin.ir.symbols.IrClassifierSymbol import org.jetbrains.kotlin.ir.symbols.IrSimpleFunctionSymbol import org.jetbrains.kotlin.ir.types.classifierOrFail import org.jetbrains.kotlin.ir.util.getSimpleFunction -import java.util.* internal class OperatorExpressionGenerator( private val components: Fir2IrComponents, @@ -28,12 +27,6 @@ internal class OperatorExpressionGenerator( private val callGenerator: CallAndReferenceGenerator ) : Fir2IrComponents by components { - companion object { - private val NEGATED_OPERATIONS: Set = EnumSet.of(FirOperation.NOT_EQ, FirOperation.NOT_IDENTITY) - - private val UNARY_OPERATIONS: Set = EnumSet.of(FirOperation.EXCL) - } - fun convertComparisonExpression(comparisonExpression: FirComparisonExpression): IrExpression { return comparisonExpression.convertWithOffsets { startOffset, endOffset -> generateComparisonCall(startOffset, endOffset, comparisonExpression) @@ -92,39 +85,60 @@ internal class OperatorExpressionGenerator( private fun generateOperatorCall( startOffset: Int, endOffset: Int, operation: FirOperation, arguments: List - ): IrExpression { - val (type, symbol, origin) = when (operation) { - FirOperation.EQ -> Triple(irBuiltIns.booleanType, irBuiltIns.eqeqSymbol, IrStatementOrigin.EQEQ) - FirOperation.NOT_EQ -> Triple(irBuiltIns.booleanType, irBuiltIns.eqeqSymbol, IrStatementOrigin.EXCLEQ) - FirOperation.IDENTITY -> Triple(irBuiltIns.booleanType, irBuiltIns.eqeqeqSymbol, IrStatementOrigin.EQEQEQ) - FirOperation.NOT_IDENTITY -> Triple(irBuiltIns.booleanType, irBuiltIns.eqeqeqSymbol, IrStatementOrigin.EXCLEQEQ) - FirOperation.EXCL -> Triple(irBuiltIns.booleanType, irBuiltIns.booleanNotSymbol, IrStatementOrigin.EXCL) - FirOperation.LT, FirOperation.GT, - FirOperation.LT_EQ, FirOperation.GT_EQ, - FirOperation.OTHER, FirOperation.ASSIGN, FirOperation.PLUS_ASSIGN, - FirOperation.MINUS_ASSIGN, FirOperation.TIMES_ASSIGN, - FirOperation.DIV_ASSIGN, FirOperation.REM_ASSIGN, - FirOperation.IS, FirOperation.NOT_IS, - FirOperation.AS, FirOperation.SAFE_AS - -> { - TODO("Should not be here: incompatible operation in FirOperatorCall: $operation") - } - } - val result = if (operation in UNARY_OPERATIONS) { - primitiveOp1(startOffset, endOffset, symbol, type, origin, visitor.convertToIrExpression(arguments[0])) - } else { - val comparisonInfo = inferPrimitiveNumericComparisonInfo(arguments[0], arguments[1]) - val comparisonType = comparisonInfo?.comparisonType - primitiveOp2( - startOffset, endOffset, symbol, type, origin, - visitor.convertToIrExpression(arguments[0]).asComparisonOperand(comparisonInfo?.leftType, comparisonType), - visitor.convertToIrExpression(arguments[1]).asComparisonOperand(comparisonInfo?.rightType, comparisonType) - ) - } - if (operation !in NEGATED_OPERATIONS) return result - return primitiveOp1(startOffset, endOffset, irBuiltIns.booleanNotSymbol, irBuiltIns.booleanType, origin, result) + ): IrExpression = when (operation) { + FirOperation.EQ, FirOperation.NOT_EQ -> generateEqualityOperatorCall(startOffset, endOffset, operation, arguments) + FirOperation.IDENTITY, FirOperation.NOT_IDENTITY -> generateIdentityOperatorCall(startOffset, endOffset, operation, arguments) + FirOperation.EXCL -> visitor.convertToIrExpression(arguments[0]).negate(IrStatementOrigin.EXCL) + else -> error("Unexpected operation: $operation") } + private fun generateEqualityOperatorCall( + startOffset: Int, endOffset: Int, operation: FirOperation, arguments: List + ): IrExpression { + val origin = when (operation) { + FirOperation.EQ -> IrStatementOrigin.EQEQ + FirOperation.NOT_EQ -> IrStatementOrigin.EXCLEQ + else -> error("Not an equality operation: $operation") + } + val comparisonInfo = inferPrimitiveNumericComparisonInfo(arguments[0], arguments[1]) + val comparisonType = comparisonInfo?.comparisonType + val eqeqSymbol = comparisonType?.let { typeConverter.classIdToSymbolMap[it.lookupTag.classId] } + ?.let { irBuiltIns.ieee754equalsFunByOperandType[it] } ?: irBuiltIns.eqeqSymbol + val equalsCall = primitiveOp2( + startOffset, endOffset, eqeqSymbol, irBuiltIns.booleanType, origin, + visitor.convertToIrExpression(arguments[0]).asComparisonOperand(comparisonInfo?.leftType, comparisonType), + visitor.convertToIrExpression(arguments[1]).asComparisonOperand(comparisonInfo?.rightType, comparisonType) + ) + return if (operation == FirOperation.EQ) { + equalsCall + } else { + equalsCall.negate(origin) + } + } + + private fun generateIdentityOperatorCall( + startOffset: Int, endOffset: Int, operation: FirOperation, arguments: List + ): IrExpression { + val origin = when (operation) { + FirOperation.IDENTITY -> IrStatementOrigin.EQEQEQ + FirOperation.NOT_IDENTITY -> IrStatementOrigin.EXCLEQEQ + else -> error("Not an identity operation: $operation") + } + val identityCall = primitiveOp2( + startOffset, endOffset, irBuiltIns.eqeqeqSymbol, irBuiltIns.booleanType, origin, + visitor.convertToIrExpression(arguments[0]), + visitor.convertToIrExpression(arguments[1]) + ) + return if (operation == FirOperation.IDENTITY) { + identityCall + } else { + identityCall.negate(origin) + } + } + + private fun IrExpression.negate(origin: IrStatementOrigin) = + primitiveOp1(startOffset, endOffset, irBuiltIns.booleanNotSymbol, irBuiltIns.booleanType, origin, this) + private fun IrExpression.asComparisonOperand( operandType: ConeClassLikeType?, targetType: ConeClassLikeType? diff --git a/compiler/ir/backend.jvm/src/org/jetbrains/kotlin/backend/jvm/ir/IrUtils.kt b/compiler/ir/backend.jvm/src/org/jetbrains/kotlin/backend/jvm/ir/IrUtils.kt index ab0bd35be08..cd19e1fab87 100644 --- a/compiler/ir/backend.jvm/src/org/jetbrains/kotlin/backend/jvm/ir/IrUtils.kt +++ b/compiler/ir/backend.jvm/src/org/jetbrains/kotlin/backend/jvm/ir/IrUtils.kt @@ -29,10 +29,7 @@ import org.jetbrains.kotlin.ir.expressions.* import org.jetbrains.kotlin.ir.expressions.impl.IrCallImpl import org.jetbrains.kotlin.ir.expressions.impl.IrConstImpl import org.jetbrains.kotlin.ir.expressions.impl.IrGetFieldImpl -import org.jetbrains.kotlin.ir.symbols.IrClassSymbol -import org.jetbrains.kotlin.ir.symbols.IrSimpleFunctionSymbol -import org.jetbrains.kotlin.ir.symbols.IrSymbol -import org.jetbrains.kotlin.ir.symbols.IrTypeParameterSymbol +import org.jetbrains.kotlin.ir.symbols.* import org.jetbrains.kotlin.ir.types.* import org.jetbrains.kotlin.ir.types.impl.IrSimpleTypeImpl import org.jetbrains.kotlin.ir.types.impl.IrStarProjectionImpl @@ -216,10 +213,21 @@ fun IrDeclaration.isInCurrentModule(): Boolean = // This is needed to pinpoint exceptional treatment of IEEE754 floating point comparisons, where proper IEEE // comparisons are used "if values are statically known to be of primitive numeric types", taken to mean as // "not learned through smartcasting". -fun IrExpression.isSmartcastFromHigherThanNullable(context: JvmBackendContext) = - this is IrTypeOperatorCall && - operator == IrTypeOperator.IMPLICIT_CAST && - !this.argument.type.isSubtypeOf(type.makeNullable(), context.irBuiltIns) +fun IrExpression.isSmartcastFromHigherThanNullable(context: JvmBackendContext): Boolean { + return when (this) { + is IrTypeOperatorCall -> operator == IrTypeOperator.IMPLICIT_CAST && !argument.type.isSubtypeOf( + type.makeNullable(), + context.irBuiltIns + ) + is IrGetValue -> { + // Check if the variable initializer is smartcast. In FIR, if the subject of a `when` is smartcast, + // the IMPLICIT_CAST is in the initializer of the variable for the subject. + val variable = (symbol as? IrVariableSymbol)?.owner ?: return false + !variable.isVar && variable.initializer?.isSmartcastFromHigherThanNullable(context) == true + } + else -> false + } +} fun IrBody.replaceThisByStaticReference( declarationFactory: JvmDeclarationFactory, diff --git a/compiler/testData/codegen/box/binaryOp/eqNullableDoubles.kt b/compiler/testData/codegen/box/binaryOp/eqNullableDoubles.kt index fd62573c2bd..c911ad0d1c4 100644 --- a/compiler/testData/codegen/box/binaryOp/eqNullableDoubles.kt +++ b/compiler/testData/codegen/box/binaryOp/eqNullableDoubles.kt @@ -1,5 +1,4 @@ // !LANGUAGE: +ProperIeee754Comparisons -// IGNORE_BACKEND_FIR: JVM_IR fun eq_double_doubleN(a: Double, b: Double?) = a == b diff --git a/compiler/testData/codegen/box/binaryOp/eqNullableDoublesWithTP.kt b/compiler/testData/codegen/box/binaryOp/eqNullableDoublesWithTP.kt index 14ccea99a90..e6de75ac350 100644 --- a/compiler/testData/codegen/box/binaryOp/eqNullableDoublesWithTP.kt +++ b/compiler/testData/codegen/box/binaryOp/eqNullableDoublesWithTP.kt @@ -1,5 +1,4 @@ // !LANGUAGE: +ProperIeee754Comparisons -// IGNORE_BACKEND_FIR: JVM_IR fun eq_double_doubleN(a: A, b: B) = a == b diff --git a/compiler/testData/codegen/box/callableReference/adaptedReferences/inlineDefault.kt b/compiler/testData/codegen/box/callableReference/adaptedReferences/inlineDefault.kt index 8e21a8de238..c9c2d198a1a 100644 --- a/compiler/testData/codegen/box/callableReference/adaptedReferences/inlineDefault.kt +++ b/compiler/testData/codegen/box/callableReference/adaptedReferences/inlineDefault.kt @@ -1,4 +1,3 @@ -// IGNORE_BACKEND_FIR: JVM_IR // !LANGUAGE: +NewInference +FunctionReferenceWithDefaultValueAsOtherType // WITH_RUNTIME // KJS_WITH_FULL_RUNTIME diff --git a/compiler/testData/codegen/box/ieee754/anyToReal.kt b/compiler/testData/codegen/box/ieee754/anyToReal.kt index 33606b05476..3ba490d870e 100644 --- a/compiler/testData/codegen/box/ieee754/anyToReal.kt +++ b/compiler/testData/codegen/box/ieee754/anyToReal.kt @@ -1,4 +1,3 @@ -// IGNORE_BACKEND_FIR: JVM_IR fun box(): String { val plusZero: Any = 0.0 val minusZero: Any = -0.0 diff --git a/compiler/testData/codegen/box/ieee754/equalsDouble.kt b/compiler/testData/codegen/box/ieee754/equalsDouble.kt index 8e041591338..eca47b808ec 100644 --- a/compiler/testData/codegen/box/ieee754/equalsDouble.kt +++ b/compiler/testData/codegen/box/ieee754/equalsDouble.kt @@ -1,5 +1,4 @@ // !LANGUAGE: -ProperIeee754Comparisons -// IGNORE_BACKEND_FIR: JVM_IR // DONT_TARGET_EXACT_BACKEND: JS_IR fun equals1(a: Double, b: Double) = a == b diff --git a/compiler/testData/codegen/box/ieee754/equalsDouble_properIeeeComparisons.kt b/compiler/testData/codegen/box/ieee754/equalsDouble_properIeeeComparisons.kt index 33130348d91..7c9b369ca24 100644 --- a/compiler/testData/codegen/box/ieee754/equalsDouble_properIeeeComparisons.kt +++ b/compiler/testData/codegen/box/ieee754/equalsDouble_properIeeeComparisons.kt @@ -1,5 +1,4 @@ // !LANGUAGE: +ProperIeee754Comparisons -// IGNORE_BACKEND_FIR: JVM_IR fun equals1(a: Double, b: Double) = a == b diff --git a/compiler/testData/codegen/box/ieee754/equalsFloat.kt b/compiler/testData/codegen/box/ieee754/equalsFloat.kt index 20a5e876b0b..f733deec06e 100644 --- a/compiler/testData/codegen/box/ieee754/equalsFloat.kt +++ b/compiler/testData/codegen/box/ieee754/equalsFloat.kt @@ -1,5 +1,4 @@ // !LANGUAGE: -ProperIeee754Comparisons -// IGNORE_BACKEND_FIR: JVM_IR // DONT_TARGET_EXACT_BACKEND: JS_IR fun equals1(a: Float, b: Float) = a == b diff --git a/compiler/testData/codegen/box/ieee754/equalsFloat_properIeeeComparisons.kt b/compiler/testData/codegen/box/ieee754/equalsFloat_properIeeeComparisons.kt index c5c59439567..7a7589838d3 100644 --- a/compiler/testData/codegen/box/ieee754/equalsFloat_properIeeeComparisons.kt +++ b/compiler/testData/codegen/box/ieee754/equalsFloat_properIeeeComparisons.kt @@ -1,5 +1,4 @@ // !LANGUAGE: +ProperIeee754Comparisons -// IGNORE_BACKEND_FIR: JVM_IR fun equals1(a: Float, b: Float) = a == b diff --git a/compiler/testData/codegen/box/ieee754/equalsNaN.kt b/compiler/testData/codegen/box/ieee754/equalsNaN.kt index 75fc508a12c..3fe196d3c14 100644 --- a/compiler/testData/codegen/box/ieee754/equalsNaN.kt +++ b/compiler/testData/codegen/box/ieee754/equalsNaN.kt @@ -1,5 +1,4 @@ // !LANGUAGE: -ProperIeee754Comparisons -// IGNORE_BACKEND_FIR: JVM_IR // DONT_TARGET_EXACT_BACKEND: JS_IR // WITH_RUNTIME diff --git a/compiler/testData/codegen/box/ieee754/equalsNullableDouble.kt b/compiler/testData/codegen/box/ieee754/equalsNullableDouble.kt index 54ab5782b0a..83ea21d9e68 100644 --- a/compiler/testData/codegen/box/ieee754/equalsNullableDouble.kt +++ b/compiler/testData/codegen/box/ieee754/equalsNullableDouble.kt @@ -1,5 +1,4 @@ // !LANGUAGE: -ProperIeee754Comparisons -// IGNORE_BACKEND_FIR: JVM_IR // DONT_TARGET_EXACT_BACKEND: JS_IR fun equals1(a: Double, b: Double?) = a == b diff --git a/compiler/testData/codegen/box/ieee754/equalsNullableDouble_properIeeeComparisons.kt b/compiler/testData/codegen/box/ieee754/equalsNullableDouble_properIeeeComparisons.kt index 883ab370171..3573cfbc43a 100644 --- a/compiler/testData/codegen/box/ieee754/equalsNullableDouble_properIeeeComparisons.kt +++ b/compiler/testData/codegen/box/ieee754/equalsNullableDouble_properIeeeComparisons.kt @@ -1,5 +1,4 @@ // !LANGUAGE: +ProperIeee754Comparisons -// IGNORE_BACKEND_FIR: JVM_IR fun equals1(a: Double, b: Double?) = a == b diff --git a/compiler/testData/codegen/box/ieee754/equalsNullableFloat.kt b/compiler/testData/codegen/box/ieee754/equalsNullableFloat.kt index 8c702327ffc..50f62117ce1 100644 --- a/compiler/testData/codegen/box/ieee754/equalsNullableFloat.kt +++ b/compiler/testData/codegen/box/ieee754/equalsNullableFloat.kt @@ -1,5 +1,4 @@ // !LANGUAGE: -ProperIeee754Comparisons -// IGNORE_BACKEND_FIR: JVM_IR // DONT_TARGET_EXACT_BACKEND: JS_IR fun equals1(a: Float, b: Float?) = a == b diff --git a/compiler/testData/codegen/box/ieee754/equalsNullableFloat_properIeeeComparisons.kt b/compiler/testData/codegen/box/ieee754/equalsNullableFloat_properIeeeComparisons.kt index 67e2d772878..692ba98ad18 100644 --- a/compiler/testData/codegen/box/ieee754/equalsNullableFloat_properIeeeComparisons.kt +++ b/compiler/testData/codegen/box/ieee754/equalsNullableFloat_properIeeeComparisons.kt @@ -1,5 +1,4 @@ // !LANGUAGE: +ProperIeee754Comparisons -// IGNORE_BACKEND_FIR: JVM_IR fun equals1(a: Float, b: Float?) = a == b diff --git a/compiler/testData/codegen/box/ieee754/generic.kt b/compiler/testData/codegen/box/ieee754/generic.kt index 901cf43e7c5..6d621ffd2c0 100644 --- a/compiler/testData/codegen/box/ieee754/generic.kt +++ b/compiler/testData/codegen/box/ieee754/generic.kt @@ -1,4 +1,3 @@ -// IGNORE_BACKEND_FIR: JVM_IR // FILE: b.kt class Foo(val minus0: T, val plus0: T) { diff --git a/compiler/testData/codegen/box/ieee754/inline.kt b/compiler/testData/codegen/box/ieee754/inline.kt index 378bab9e97a..c1d3e721321 100644 --- a/compiler/testData/codegen/box/ieee754/inline.kt +++ b/compiler/testData/codegen/box/ieee754/inline.kt @@ -1,4 +1,3 @@ -// IGNORE_BACKEND_FIR: JVM_IR inline fun less(a: Comparable, b: Double): Boolean { return a < b } diff --git a/compiler/testData/codegen/box/ieee754/nullableAnyToReal.kt b/compiler/testData/codegen/box/ieee754/nullableAnyToReal.kt index 3fddb1f5cd0..7c4a950202f 100644 --- a/compiler/testData/codegen/box/ieee754/nullableAnyToReal.kt +++ b/compiler/testData/codegen/box/ieee754/nullableAnyToReal.kt @@ -1,4 +1,3 @@ -// IGNORE_BACKEND_FIR: JVM_IR fun box(): String { val plusZero: Any? = 0.0 val minusZero: Any? = -0.0 diff --git a/compiler/testData/codegen/box/ieee754/smartCastToDifferentTypesWithNumericPromotion_properIeeeComparisons.kt b/compiler/testData/codegen/box/ieee754/smartCastToDifferentTypesWithNumericPromotion_properIeeeComparisons.kt index b2c9e80608f..5f0ad6a37af 100644 --- a/compiler/testData/codegen/box/ieee754/smartCastToDifferentTypesWithNumericPromotion_properIeeeComparisons.kt +++ b/compiler/testData/codegen/box/ieee754/smartCastToDifferentTypesWithNumericPromotion_properIeeeComparisons.kt @@ -1,5 +1,4 @@ // !LANGUAGE: +ProperIeee754Comparisons -// IGNORE_BACKEND_FIR: JVM_IR fun eqDI(x: Any?, y: Any?) = x is Double? && y is Int? && x == y fun eqDL(x: Any?, y: Any?) = x is Double? && y is Long? && x == y diff --git a/compiler/testData/codegen/box/ieee754/smartCastToDifferentTypes_properIeeeComparisons.kt b/compiler/testData/codegen/box/ieee754/smartCastToDifferentTypes_properIeeeComparisons.kt index 076ec0a8ebc..582053bdf55 100644 --- a/compiler/testData/codegen/box/ieee754/smartCastToDifferentTypes_properIeeeComparisons.kt +++ b/compiler/testData/codegen/box/ieee754/smartCastToDifferentTypes_properIeeeComparisons.kt @@ -1,5 +1,4 @@ // !LANGUAGE: +ProperIeee754Comparisons -// IGNORE_BACKEND_FIR: JVM_IR fun ne(x: Any, y: Any) = x is Double && y is Float && x != y fun lt(x: Any, y: Any) = x is Double && y is Float && x < y diff --git a/compiler/testData/codegen/box/ieee754/smartCastToDoubleAndComparableToDouble.kt b/compiler/testData/codegen/box/ieee754/smartCastToDoubleAndComparableToDouble.kt index ea9853c20be..f6ad5a161d2 100644 --- a/compiler/testData/codegen/box/ieee754/smartCastToDoubleAndComparableToDouble.kt +++ b/compiler/testData/codegen/box/ieee754/smartCastToDoubleAndComparableToDouble.kt @@ -1,5 +1,4 @@ // !LANGUAGE: +ProperIeee754Comparisons -// IGNORE_BACKEND_FIR: JVM_IR val minus: Any = -0.0 diff --git a/compiler/testData/codegen/box/ieee754/when.kt b/compiler/testData/codegen/box/ieee754/when.kt index 7b851b7f132..3eb48ecb4c9 100644 --- a/compiler/testData/codegen/box/ieee754/when.kt +++ b/compiler/testData/codegen/box/ieee754/when.kt @@ -14,7 +14,6 @@ fun box(): String { -0.0 -> { return "fail 2" } - else -> {} } if (minusZero is Double) { diff --git a/compiler/testData/codegen/box/ieee754/whenNoSubject_properIeeeComparisons.kt b/compiler/testData/codegen/box/ieee754/whenNoSubject_properIeeeComparisons.kt index 8109a1fd426..2dc15da6894 100644 --- a/compiler/testData/codegen/box/ieee754/whenNoSubject_properIeeeComparisons.kt +++ b/compiler/testData/codegen/box/ieee754/whenNoSubject_properIeeeComparisons.kt @@ -1,5 +1,4 @@ // !LANGUAGE: +ProperIeee754Comparisons -// IGNORE_BACKEND_FIR: JVM_IR fun box(): String { val plusZero: Any = 0.0 diff --git a/compiler/testData/codegen/box/ieee754/when_properIeeeComparisons.kt b/compiler/testData/codegen/box/ieee754/when_properIeeeComparisons.kt index f4a0219e479..dd3ec4586ba 100644 --- a/compiler/testData/codegen/box/ieee754/when_properIeeeComparisons.kt +++ b/compiler/testData/codegen/box/ieee754/when_properIeeeComparisons.kt @@ -1,5 +1,4 @@ // !LANGUAGE: +ProperIeee754Comparisons -// IGNORE_BACKEND_FIR: JVM_IR fun box(): String { val plusZero: Any = 0.0 diff --git a/compiler/testData/codegen/box/ir/primitiveNumberComparisons/doubleEqeq.kt b/compiler/testData/codegen/box/ir/primitiveNumberComparisons/doubleEqeq.kt index dd31622a8b8..9856a0cbc43 100644 --- a/compiler/testData/codegen/box/ir/primitiveNumberComparisons/doubleEqeq.kt +++ b/compiler/testData/codegen/box/ir/primitiveNumberComparisons/doubleEqeq.kt @@ -1,5 +1,4 @@ // !LANGUAGE: +ProperIeee754Comparisons -// IGNORE_BACKEND_FIR: JVM_IR fun eqeq(x: Any, y: Any) = x is Double && y is Double && x == y diff --git a/compiler/testData/codegen/box/ir/primitiveNumberComparisons/floatEqeq.kt b/compiler/testData/codegen/box/ir/primitiveNumberComparisons/floatEqeq.kt index e0085def136..f1117be0b1f 100644 --- a/compiler/testData/codegen/box/ir/primitiveNumberComparisons/floatEqeq.kt +++ b/compiler/testData/codegen/box/ir/primitiveNumberComparisons/floatEqeq.kt @@ -1,5 +1,4 @@ // !LANGUAGE: +ProperIeee754Comparisons -// IGNORE_BACKEND_FIR: JVM_IR fun eqeq(x: Any, y: Any) = x is Float && y is Float && x == y diff --git a/compiler/testData/codegen/box/primitiveTypes/comparisonWithNaN.kt b/compiler/testData/codegen/box/primitiveTypes/comparisonWithNaN.kt index 665393215d2..9f0cce8ef26 100644 --- a/compiler/testData/codegen/box/primitiveTypes/comparisonWithNaN.kt +++ b/compiler/testData/codegen/box/primitiveTypes/comparisonWithNaN.kt @@ -1,4 +1,3 @@ -// IGNORE_BACKEND_FIR: JVM_IR // TARGET_BACKEND: JVM // This test checks that our bytecode is consistent with javac bytecode diff --git a/compiler/testData/codegen/box/when/whenSubjectVariable/ieee754Equality.kt b/compiler/testData/codegen/box/when/whenSubjectVariable/ieee754Equality.kt index 02e8ed3704f..70dcdbabe43 100644 --- a/compiler/testData/codegen/box/when/whenSubjectVariable/ieee754Equality.kt +++ b/compiler/testData/codegen/box/when/whenSubjectVariable/ieee754Equality.kt @@ -1,5 +1,4 @@ // !LANGUAGE: +VariableDeclarationInWhenSubject -// IGNORE_BACKEND_FIR: JVM_IR val dz = -0.0 val fz = -0.0f diff --git a/compiler/testData/ir/irText/expressions/floatingPointComparisons/floatingPointEqeq.fir.txt b/compiler/testData/ir/irText/expressions/floatingPointComparisons/floatingPointEqeq.fir.txt deleted file mode 100644 index 883f885fd26..00000000000 --- a/compiler/testData/ir/irText/expressions/floatingPointComparisons/floatingPointEqeq.fir.txt +++ /dev/null @@ -1,195 +0,0 @@ -FILE fqName: fileName:/floatingPointEqeq.kt - FUN name:test1d visibility:public modality:FINAL <> (x:kotlin.Double, y:kotlin.Double) returnType:kotlin.Boolean - VALUE_PARAMETER name:x index:0 type:kotlin.Double - VALUE_PARAMETER name:y index:1 type:kotlin.Double - BLOCK_BODY - RETURN type=kotlin.Nothing from='public final fun test1d (x: kotlin.Double, y: kotlin.Double): kotlin.Boolean declared in ' - CALL 'public final fun EQEQ (arg0: kotlin.Any?, arg1: kotlin.Any?): kotlin.Boolean declared in kotlin.internal.ir' type=kotlin.Boolean origin=EQEQ - arg0: GET_VAR 'x: kotlin.Double declared in .test1d' type=kotlin.Double origin=null - arg1: GET_VAR 'y: kotlin.Double declared in .test1d' type=kotlin.Double origin=null - FUN name:test2d visibility:public modality:FINAL <> (x:kotlin.Double, y:kotlin.Double?) returnType:kotlin.Boolean - VALUE_PARAMETER name:x index:0 type:kotlin.Double - VALUE_PARAMETER name:y index:1 type:kotlin.Double? - BLOCK_BODY - RETURN type=kotlin.Nothing from='public final fun test2d (x: kotlin.Double, y: kotlin.Double?): kotlin.Boolean declared in ' - CALL 'public final fun EQEQ (arg0: kotlin.Any?, arg1: kotlin.Any?): kotlin.Boolean declared in kotlin.internal.ir' type=kotlin.Boolean origin=EQEQ - arg0: GET_VAR 'x: kotlin.Double declared in .test2d' type=kotlin.Double origin=null - arg1: GET_VAR 'y: kotlin.Double? declared in .test2d' type=kotlin.Double? origin=null - FUN name:test3d visibility:public modality:FINAL <> (x:kotlin.Double, y:kotlin.Any) returnType:kotlin.Boolean - VALUE_PARAMETER name:x index:0 type:kotlin.Double - VALUE_PARAMETER name:y index:1 type:kotlin.Any - BLOCK_BODY - RETURN type=kotlin.Nothing from='public final fun test3d (x: kotlin.Double, y: kotlin.Any): kotlin.Boolean declared in ' - CALL 'public final fun EQEQ (arg0: kotlin.Any?, arg1: kotlin.Any?): kotlin.Boolean declared in kotlin.internal.ir' type=kotlin.Boolean origin=EQEQ - arg0: GET_VAR 'x: kotlin.Double declared in .test3d' type=kotlin.Double origin=null - arg1: GET_VAR 'y: kotlin.Any declared in .test3d' type=kotlin.Any origin=null - FUN name:test4d visibility:public modality:FINAL <> (x:kotlin.Double, y:kotlin.Number) returnType:kotlin.Boolean - VALUE_PARAMETER name:x index:0 type:kotlin.Double - VALUE_PARAMETER name:y index:1 type:kotlin.Number - BLOCK_BODY - RETURN type=kotlin.Nothing from='public final fun test4d (x: kotlin.Double, y: kotlin.Number): kotlin.Boolean declared in ' - CALL 'public final fun EQEQ (arg0: kotlin.Any?, arg1: kotlin.Any?): kotlin.Boolean declared in kotlin.internal.ir' type=kotlin.Boolean origin=EQEQ - arg0: GET_VAR 'x: kotlin.Double declared in .test4d' type=kotlin.Double origin=null - arg1: GET_VAR 'y: kotlin.Number declared in .test4d' type=kotlin.Number origin=null - FUN name:test5d visibility:public modality:FINAL <> (x:kotlin.Double, y:kotlin.Any) returnType:kotlin.Boolean - VALUE_PARAMETER name:x index:0 type:kotlin.Double - VALUE_PARAMETER name:y index:1 type:kotlin.Any - BLOCK_BODY - RETURN type=kotlin.Nothing from='public final fun test5d (x: kotlin.Double, y: kotlin.Any): kotlin.Boolean declared in ' - WHEN type=kotlin.Boolean origin=ANDAND - BRANCH - if: TYPE_OP type=kotlin.Boolean origin=INSTANCEOF typeOperand=kotlin.Double - GET_VAR 'y: kotlin.Any declared in .test5d' type=kotlin.Any origin=null - then: CALL 'public final fun EQEQ (arg0: kotlin.Any?, arg1: kotlin.Any?): kotlin.Boolean declared in kotlin.internal.ir' type=kotlin.Boolean origin=EQEQ - arg0: GET_VAR 'x: kotlin.Double declared in .test5d' type=kotlin.Double origin=null - arg1: TYPE_OP type=kotlin.Double origin=IMPLICIT_CAST typeOperand=kotlin.Double - GET_VAR 'y: kotlin.Any declared in .test5d' type=kotlin.Any origin=null - BRANCH - if: CONST Boolean type=kotlin.Boolean value=true - then: CONST Boolean type=kotlin.Boolean value=false - FUN name:test6d visibility:public modality:FINAL <> (x:kotlin.Any, y:kotlin.Any) returnType:kotlin.Boolean - VALUE_PARAMETER name:x index:0 type:kotlin.Any - VALUE_PARAMETER name:y index:1 type:kotlin.Any - BLOCK_BODY - RETURN type=kotlin.Nothing from='public final fun test6d (x: kotlin.Any, y: kotlin.Any): kotlin.Boolean declared in ' - WHEN type=kotlin.Boolean origin=ANDAND - BRANCH - if: WHEN type=kotlin.Boolean origin=ANDAND - BRANCH - if: TYPE_OP type=kotlin.Boolean origin=INSTANCEOF typeOperand=kotlin.Double - GET_VAR 'x: kotlin.Any declared in .test6d' type=kotlin.Any origin=null - then: TYPE_OP type=kotlin.Boolean origin=INSTANCEOF typeOperand=kotlin.Double - GET_VAR 'y: kotlin.Any declared in .test6d' type=kotlin.Any origin=null - BRANCH - if: CONST Boolean type=kotlin.Boolean value=true - then: CONST Boolean type=kotlin.Boolean value=false - then: CALL 'public final fun EQEQ (arg0: kotlin.Any?, arg1: kotlin.Any?): kotlin.Boolean declared in kotlin.internal.ir' type=kotlin.Boolean origin=EQEQ - arg0: TYPE_OP type=kotlin.Double origin=IMPLICIT_CAST typeOperand=kotlin.Double - GET_VAR 'x: kotlin.Any declared in .test6d' type=kotlin.Any origin=null - arg1: TYPE_OP type=kotlin.Double origin=IMPLICIT_CAST typeOperand=kotlin.Double - GET_VAR 'y: kotlin.Any declared in .test6d' type=kotlin.Any origin=null - BRANCH - if: CONST Boolean type=kotlin.Boolean value=true - then: CONST Boolean type=kotlin.Boolean value=false - FUN name:test1f visibility:public modality:FINAL <> (x:kotlin.Float, y:kotlin.Float) returnType:kotlin.Boolean - VALUE_PARAMETER name:x index:0 type:kotlin.Float - VALUE_PARAMETER name:y index:1 type:kotlin.Float - BLOCK_BODY - RETURN type=kotlin.Nothing from='public final fun test1f (x: kotlin.Float, y: kotlin.Float): kotlin.Boolean declared in ' - CALL 'public final fun EQEQ (arg0: kotlin.Any?, arg1: kotlin.Any?): kotlin.Boolean declared in kotlin.internal.ir' type=kotlin.Boolean origin=EQEQ - arg0: GET_VAR 'x: kotlin.Float declared in .test1f' type=kotlin.Float origin=null - arg1: GET_VAR 'y: kotlin.Float declared in .test1f' type=kotlin.Float origin=null - FUN name:test2f visibility:public modality:FINAL <> (x:kotlin.Float, y:kotlin.Float?) returnType:kotlin.Boolean - VALUE_PARAMETER name:x index:0 type:kotlin.Float - VALUE_PARAMETER name:y index:1 type:kotlin.Float? - BLOCK_BODY - RETURN type=kotlin.Nothing from='public final fun test2f (x: kotlin.Float, y: kotlin.Float?): kotlin.Boolean declared in ' - CALL 'public final fun EQEQ (arg0: kotlin.Any?, arg1: kotlin.Any?): kotlin.Boolean declared in kotlin.internal.ir' type=kotlin.Boolean origin=EQEQ - arg0: GET_VAR 'x: kotlin.Float declared in .test2f' type=kotlin.Float origin=null - arg1: GET_VAR 'y: kotlin.Float? declared in .test2f' type=kotlin.Float? origin=null - FUN name:test3f visibility:public modality:FINAL <> (x:kotlin.Float, y:kotlin.Any) returnType:kotlin.Boolean - VALUE_PARAMETER name:x index:0 type:kotlin.Float - VALUE_PARAMETER name:y index:1 type:kotlin.Any - BLOCK_BODY - RETURN type=kotlin.Nothing from='public final fun test3f (x: kotlin.Float, y: kotlin.Any): kotlin.Boolean declared in ' - CALL 'public final fun EQEQ (arg0: kotlin.Any?, arg1: kotlin.Any?): kotlin.Boolean declared in kotlin.internal.ir' type=kotlin.Boolean origin=EQEQ - arg0: GET_VAR 'x: kotlin.Float declared in .test3f' type=kotlin.Float origin=null - arg1: GET_VAR 'y: kotlin.Any declared in .test3f' type=kotlin.Any origin=null - FUN name:test4f visibility:public modality:FINAL <> (x:kotlin.Float, y:kotlin.Number) returnType:kotlin.Boolean - VALUE_PARAMETER name:x index:0 type:kotlin.Float - VALUE_PARAMETER name:y index:1 type:kotlin.Number - BLOCK_BODY - RETURN type=kotlin.Nothing from='public final fun test4f (x: kotlin.Float, y: kotlin.Number): kotlin.Boolean declared in ' - CALL 'public final fun EQEQ (arg0: kotlin.Any?, arg1: kotlin.Any?): kotlin.Boolean declared in kotlin.internal.ir' type=kotlin.Boolean origin=EQEQ - arg0: GET_VAR 'x: kotlin.Float declared in .test4f' type=kotlin.Float origin=null - arg1: GET_VAR 'y: kotlin.Number declared in .test4f' type=kotlin.Number origin=null - FUN name:test5f visibility:public modality:FINAL <> (x:kotlin.Float, y:kotlin.Any) returnType:kotlin.Boolean - VALUE_PARAMETER name:x index:0 type:kotlin.Float - VALUE_PARAMETER name:y index:1 type:kotlin.Any - BLOCK_BODY - RETURN type=kotlin.Nothing from='public final fun test5f (x: kotlin.Float, y: kotlin.Any): kotlin.Boolean declared in ' - WHEN type=kotlin.Boolean origin=ANDAND - BRANCH - if: TYPE_OP type=kotlin.Boolean origin=INSTANCEOF typeOperand=kotlin.Float - GET_VAR 'y: kotlin.Any declared in .test5f' type=kotlin.Any origin=null - then: CALL 'public final fun EQEQ (arg0: kotlin.Any?, arg1: kotlin.Any?): kotlin.Boolean declared in kotlin.internal.ir' type=kotlin.Boolean origin=EQEQ - arg0: GET_VAR 'x: kotlin.Float declared in .test5f' type=kotlin.Float origin=null - arg1: TYPE_OP type=kotlin.Float origin=IMPLICIT_CAST typeOperand=kotlin.Float - GET_VAR 'y: kotlin.Any declared in .test5f' type=kotlin.Any origin=null - BRANCH - if: CONST Boolean type=kotlin.Boolean value=true - then: CONST Boolean type=kotlin.Boolean value=false - FUN name:test6f visibility:public modality:FINAL <> (x:kotlin.Any, y:kotlin.Any) returnType:kotlin.Boolean - VALUE_PARAMETER name:x index:0 type:kotlin.Any - VALUE_PARAMETER name:y index:1 type:kotlin.Any - BLOCK_BODY - RETURN type=kotlin.Nothing from='public final fun test6f (x: kotlin.Any, y: kotlin.Any): kotlin.Boolean declared in ' - WHEN type=kotlin.Boolean origin=ANDAND - BRANCH - if: WHEN type=kotlin.Boolean origin=ANDAND - BRANCH - if: TYPE_OP type=kotlin.Boolean origin=INSTANCEOF typeOperand=kotlin.Float - GET_VAR 'x: kotlin.Any declared in .test6f' type=kotlin.Any origin=null - then: TYPE_OP type=kotlin.Boolean origin=INSTANCEOF typeOperand=kotlin.Float - GET_VAR 'y: kotlin.Any declared in .test6f' type=kotlin.Any origin=null - BRANCH - if: CONST Boolean type=kotlin.Boolean value=true - then: CONST Boolean type=kotlin.Boolean value=false - then: CALL 'public final fun EQEQ (arg0: kotlin.Any?, arg1: kotlin.Any?): kotlin.Boolean declared in kotlin.internal.ir' type=kotlin.Boolean origin=EQEQ - arg0: TYPE_OP type=kotlin.Float origin=IMPLICIT_CAST typeOperand=kotlin.Float - GET_VAR 'x: kotlin.Any declared in .test6f' type=kotlin.Any origin=null - arg1: TYPE_OP type=kotlin.Float origin=IMPLICIT_CAST typeOperand=kotlin.Float - GET_VAR 'y: kotlin.Any declared in .test6f' type=kotlin.Any origin=null - BRANCH - if: CONST Boolean type=kotlin.Boolean value=true - then: CONST Boolean type=kotlin.Boolean value=false - FUN name:testFD visibility:public modality:FINAL <> (x:kotlin.Any, y:kotlin.Any) returnType:kotlin.Boolean - VALUE_PARAMETER name:x index:0 type:kotlin.Any - VALUE_PARAMETER name:y index:1 type:kotlin.Any - BLOCK_BODY - RETURN type=kotlin.Nothing from='public final fun testFD (x: kotlin.Any, y: kotlin.Any): kotlin.Boolean declared in ' - WHEN type=kotlin.Boolean origin=ANDAND - BRANCH - if: WHEN type=kotlin.Boolean origin=ANDAND - BRANCH - if: TYPE_OP type=kotlin.Boolean origin=INSTANCEOF typeOperand=kotlin.Float - GET_VAR 'x: kotlin.Any declared in .testFD' type=kotlin.Any origin=null - then: TYPE_OP type=kotlin.Boolean origin=INSTANCEOF typeOperand=kotlin.Double - GET_VAR 'y: kotlin.Any declared in .testFD' type=kotlin.Any origin=null - BRANCH - if: CONST Boolean type=kotlin.Boolean value=true - then: CONST Boolean type=kotlin.Boolean value=false - then: CALL 'public final fun EQEQ (arg0: kotlin.Any?, arg1: kotlin.Any?): kotlin.Boolean declared in kotlin.internal.ir' type=kotlin.Boolean origin=EQEQ - arg0: CALL 'public open fun toDouble (): kotlin.Double declared in kotlin.Float' type=kotlin.Double origin=null - $this: TYPE_OP type=kotlin.Float origin=IMPLICIT_CAST typeOperand=kotlin.Float - GET_VAR 'x: kotlin.Any declared in .testFD' type=kotlin.Any origin=null - arg1: TYPE_OP type=kotlin.Double origin=IMPLICIT_CAST typeOperand=kotlin.Double - GET_VAR 'y: kotlin.Any declared in .testFD' type=kotlin.Any origin=null - BRANCH - if: CONST Boolean type=kotlin.Boolean value=true - then: CONST Boolean type=kotlin.Boolean value=false - FUN name:testDF visibility:public modality:FINAL <> (x:kotlin.Any, y:kotlin.Any) returnType:kotlin.Boolean - VALUE_PARAMETER name:x index:0 type:kotlin.Any - VALUE_PARAMETER name:y index:1 type:kotlin.Any - BLOCK_BODY - RETURN type=kotlin.Nothing from='public final fun testDF (x: kotlin.Any, y: kotlin.Any): kotlin.Boolean declared in ' - WHEN type=kotlin.Boolean origin=ANDAND - BRANCH - if: WHEN type=kotlin.Boolean origin=ANDAND - BRANCH - if: TYPE_OP type=kotlin.Boolean origin=INSTANCEOF typeOperand=kotlin.Double - GET_VAR 'x: kotlin.Any declared in .testDF' type=kotlin.Any origin=null - then: TYPE_OP type=kotlin.Boolean origin=INSTANCEOF typeOperand=kotlin.Float - GET_VAR 'y: kotlin.Any declared in .testDF' type=kotlin.Any origin=null - BRANCH - if: CONST Boolean type=kotlin.Boolean value=true - then: CONST Boolean type=kotlin.Boolean value=false - then: CALL 'public final fun EQEQ (arg0: kotlin.Any?, arg1: kotlin.Any?): kotlin.Boolean declared in kotlin.internal.ir' type=kotlin.Boolean origin=EQEQ - arg0: TYPE_OP type=kotlin.Double origin=IMPLICIT_CAST typeOperand=kotlin.Double - GET_VAR 'x: kotlin.Any declared in .testDF' type=kotlin.Any origin=null - arg1: CALL 'public open fun toDouble (): kotlin.Double declared in kotlin.Float' type=kotlin.Double origin=null - $this: TYPE_OP type=kotlin.Float origin=IMPLICIT_CAST typeOperand=kotlin.Float - GET_VAR 'y: kotlin.Any declared in .testDF' type=kotlin.Any origin=null - BRANCH - if: CONST Boolean type=kotlin.Boolean value=true - then: CONST Boolean type=kotlin.Boolean value=false diff --git a/compiler/testData/ir/irText/expressions/floatingPointComparisons/floatingPointEqeq.kt b/compiler/testData/ir/irText/expressions/floatingPointComparisons/floatingPointEqeq.kt index 67424934619..4782cced083 100644 --- a/compiler/testData/ir/irText/expressions/floatingPointComparisons/floatingPointEqeq.kt +++ b/compiler/testData/ir/irText/expressions/floatingPointComparisons/floatingPointEqeq.kt @@ -1,3 +1,4 @@ +// FIR_IDENTICAL fun test1d(x: Double, y: Double) = x == y fun test2d(x: Double, y: Double?) = x == y fun test3d(x: Double, y: Any) = x == y diff --git a/compiler/testData/ir/irText/expressions/floatingPointComparisons/floatingPointExcleq.fir.txt b/compiler/testData/ir/irText/expressions/floatingPointComparisons/floatingPointExcleq.fir.txt deleted file mode 100644 index 98b6b01fa00..00000000000 --- a/compiler/testData/ir/irText/expressions/floatingPointComparisons/floatingPointExcleq.fir.txt +++ /dev/null @@ -1,209 +0,0 @@ -FILE fqName: fileName:/floatingPointExcleq.kt - FUN name:test1d visibility:public modality:FINAL <> (x:kotlin.Double, y:kotlin.Double) returnType:kotlin.Boolean - VALUE_PARAMETER name:x index:0 type:kotlin.Double - VALUE_PARAMETER name:y index:1 type:kotlin.Double - BLOCK_BODY - RETURN type=kotlin.Nothing from='public final fun test1d (x: kotlin.Double, y: kotlin.Double): kotlin.Boolean declared in ' - CALL 'public final fun not (): kotlin.Boolean [operator] declared in kotlin.Boolean' type=kotlin.Boolean origin=EXCLEQ - $this: CALL 'public final fun EQEQ (arg0: kotlin.Any?, arg1: kotlin.Any?): kotlin.Boolean declared in kotlin.internal.ir' type=kotlin.Boolean origin=EXCLEQ - arg0: GET_VAR 'x: kotlin.Double declared in .test1d' type=kotlin.Double origin=null - arg1: GET_VAR 'y: kotlin.Double declared in .test1d' type=kotlin.Double origin=null - FUN name:test2d visibility:public modality:FINAL <> (x:kotlin.Double, y:kotlin.Double?) returnType:kotlin.Boolean - VALUE_PARAMETER name:x index:0 type:kotlin.Double - VALUE_PARAMETER name:y index:1 type:kotlin.Double? - BLOCK_BODY - RETURN type=kotlin.Nothing from='public final fun test2d (x: kotlin.Double, y: kotlin.Double?): kotlin.Boolean declared in ' - CALL 'public final fun not (): kotlin.Boolean [operator] declared in kotlin.Boolean' type=kotlin.Boolean origin=EXCLEQ - $this: CALL 'public final fun EQEQ (arg0: kotlin.Any?, arg1: kotlin.Any?): kotlin.Boolean declared in kotlin.internal.ir' type=kotlin.Boolean origin=EXCLEQ - arg0: GET_VAR 'x: kotlin.Double declared in .test2d' type=kotlin.Double origin=null - arg1: GET_VAR 'y: kotlin.Double? declared in .test2d' type=kotlin.Double? origin=null - FUN name:test3d visibility:public modality:FINAL <> (x:kotlin.Double, y:kotlin.Any) returnType:kotlin.Boolean - VALUE_PARAMETER name:x index:0 type:kotlin.Double - VALUE_PARAMETER name:y index:1 type:kotlin.Any - BLOCK_BODY - RETURN type=kotlin.Nothing from='public final fun test3d (x: kotlin.Double, y: kotlin.Any): kotlin.Boolean declared in ' - CALL 'public final fun not (): kotlin.Boolean [operator] declared in kotlin.Boolean' type=kotlin.Boolean origin=EXCLEQ - $this: CALL 'public final fun EQEQ (arg0: kotlin.Any?, arg1: kotlin.Any?): kotlin.Boolean declared in kotlin.internal.ir' type=kotlin.Boolean origin=EXCLEQ - arg0: GET_VAR 'x: kotlin.Double declared in .test3d' type=kotlin.Double origin=null - arg1: GET_VAR 'y: kotlin.Any declared in .test3d' type=kotlin.Any origin=null - FUN name:test4d visibility:public modality:FINAL <> (x:kotlin.Double, y:kotlin.Number) returnType:kotlin.Boolean - VALUE_PARAMETER name:x index:0 type:kotlin.Double - VALUE_PARAMETER name:y index:1 type:kotlin.Number - BLOCK_BODY - RETURN type=kotlin.Nothing from='public final fun test4d (x: kotlin.Double, y: kotlin.Number): kotlin.Boolean declared in ' - CALL 'public final fun not (): kotlin.Boolean [operator] declared in kotlin.Boolean' type=kotlin.Boolean origin=EXCLEQ - $this: CALL 'public final fun EQEQ (arg0: kotlin.Any?, arg1: kotlin.Any?): kotlin.Boolean declared in kotlin.internal.ir' type=kotlin.Boolean origin=EXCLEQ - arg0: GET_VAR 'x: kotlin.Double declared in .test4d' type=kotlin.Double origin=null - arg1: GET_VAR 'y: kotlin.Number declared in .test4d' type=kotlin.Number origin=null - FUN name:test5d visibility:public modality:FINAL <> (x:kotlin.Double, y:kotlin.Any) returnType:kotlin.Boolean - VALUE_PARAMETER name:x index:0 type:kotlin.Double - VALUE_PARAMETER name:y index:1 type:kotlin.Any - BLOCK_BODY - RETURN type=kotlin.Nothing from='public final fun test5d (x: kotlin.Double, y: kotlin.Any): kotlin.Boolean declared in ' - WHEN type=kotlin.Boolean origin=ANDAND - BRANCH - if: TYPE_OP type=kotlin.Boolean origin=INSTANCEOF typeOperand=kotlin.Double - GET_VAR 'y: kotlin.Any declared in .test5d' type=kotlin.Any origin=null - then: CALL 'public final fun not (): kotlin.Boolean [operator] declared in kotlin.Boolean' type=kotlin.Boolean origin=EXCLEQ - $this: CALL 'public final fun EQEQ (arg0: kotlin.Any?, arg1: kotlin.Any?): kotlin.Boolean declared in kotlin.internal.ir' type=kotlin.Boolean origin=EXCLEQ - arg0: GET_VAR 'x: kotlin.Double declared in .test5d' type=kotlin.Double origin=null - arg1: TYPE_OP type=kotlin.Double origin=IMPLICIT_CAST typeOperand=kotlin.Double - GET_VAR 'y: kotlin.Any declared in .test5d' type=kotlin.Any origin=null - BRANCH - if: CONST Boolean type=kotlin.Boolean value=true - then: CONST Boolean type=kotlin.Boolean value=false - FUN name:test6d visibility:public modality:FINAL <> (x:kotlin.Any, y:kotlin.Any) returnType:kotlin.Boolean - VALUE_PARAMETER name:x index:0 type:kotlin.Any - VALUE_PARAMETER name:y index:1 type:kotlin.Any - BLOCK_BODY - RETURN type=kotlin.Nothing from='public final fun test6d (x: kotlin.Any, y: kotlin.Any): kotlin.Boolean declared in ' - WHEN type=kotlin.Boolean origin=ANDAND - BRANCH - if: WHEN type=kotlin.Boolean origin=ANDAND - BRANCH - if: TYPE_OP type=kotlin.Boolean origin=INSTANCEOF typeOperand=kotlin.Double - GET_VAR 'x: kotlin.Any declared in .test6d' type=kotlin.Any origin=null - then: TYPE_OP type=kotlin.Boolean origin=INSTANCEOF typeOperand=kotlin.Double - GET_VAR 'y: kotlin.Any declared in .test6d' type=kotlin.Any origin=null - BRANCH - if: CONST Boolean type=kotlin.Boolean value=true - then: CONST Boolean type=kotlin.Boolean value=false - then: CALL 'public final fun not (): kotlin.Boolean [operator] declared in kotlin.Boolean' type=kotlin.Boolean origin=EXCLEQ - $this: CALL 'public final fun EQEQ (arg0: kotlin.Any?, arg1: kotlin.Any?): kotlin.Boolean declared in kotlin.internal.ir' type=kotlin.Boolean origin=EXCLEQ - arg0: TYPE_OP type=kotlin.Double origin=IMPLICIT_CAST typeOperand=kotlin.Double - GET_VAR 'x: kotlin.Any declared in .test6d' type=kotlin.Any origin=null - arg1: TYPE_OP type=kotlin.Double origin=IMPLICIT_CAST typeOperand=kotlin.Double - GET_VAR 'y: kotlin.Any declared in .test6d' type=kotlin.Any origin=null - BRANCH - if: CONST Boolean type=kotlin.Boolean value=true - then: CONST Boolean type=kotlin.Boolean value=false - FUN name:test1f visibility:public modality:FINAL <> (x:kotlin.Float, y:kotlin.Float) returnType:kotlin.Boolean - VALUE_PARAMETER name:x index:0 type:kotlin.Float - VALUE_PARAMETER name:y index:1 type:kotlin.Float - BLOCK_BODY - RETURN type=kotlin.Nothing from='public final fun test1f (x: kotlin.Float, y: kotlin.Float): kotlin.Boolean declared in ' - CALL 'public final fun not (): kotlin.Boolean [operator] declared in kotlin.Boolean' type=kotlin.Boolean origin=EXCLEQ - $this: CALL 'public final fun EQEQ (arg0: kotlin.Any?, arg1: kotlin.Any?): kotlin.Boolean declared in kotlin.internal.ir' type=kotlin.Boolean origin=EXCLEQ - arg0: GET_VAR 'x: kotlin.Float declared in .test1f' type=kotlin.Float origin=null - arg1: GET_VAR 'y: kotlin.Float declared in .test1f' type=kotlin.Float origin=null - FUN name:test2f visibility:public modality:FINAL <> (x:kotlin.Float, y:kotlin.Float?) returnType:kotlin.Boolean - VALUE_PARAMETER name:x index:0 type:kotlin.Float - VALUE_PARAMETER name:y index:1 type:kotlin.Float? - BLOCK_BODY - RETURN type=kotlin.Nothing from='public final fun test2f (x: kotlin.Float, y: kotlin.Float?): kotlin.Boolean declared in ' - CALL 'public final fun not (): kotlin.Boolean [operator] declared in kotlin.Boolean' type=kotlin.Boolean origin=EXCLEQ - $this: CALL 'public final fun EQEQ (arg0: kotlin.Any?, arg1: kotlin.Any?): kotlin.Boolean declared in kotlin.internal.ir' type=kotlin.Boolean origin=EXCLEQ - arg0: GET_VAR 'x: kotlin.Float declared in .test2f' type=kotlin.Float origin=null - arg1: GET_VAR 'y: kotlin.Float? declared in .test2f' type=kotlin.Float? origin=null - FUN name:test3f visibility:public modality:FINAL <> (x:kotlin.Float, y:kotlin.Any) returnType:kotlin.Boolean - VALUE_PARAMETER name:x index:0 type:kotlin.Float - VALUE_PARAMETER name:y index:1 type:kotlin.Any - BLOCK_BODY - RETURN type=kotlin.Nothing from='public final fun test3f (x: kotlin.Float, y: kotlin.Any): kotlin.Boolean declared in ' - CALL 'public final fun not (): kotlin.Boolean [operator] declared in kotlin.Boolean' type=kotlin.Boolean origin=EXCLEQ - $this: CALL 'public final fun EQEQ (arg0: kotlin.Any?, arg1: kotlin.Any?): kotlin.Boolean declared in kotlin.internal.ir' type=kotlin.Boolean origin=EXCLEQ - arg0: GET_VAR 'x: kotlin.Float declared in .test3f' type=kotlin.Float origin=null - arg1: GET_VAR 'y: kotlin.Any declared in .test3f' type=kotlin.Any origin=null - FUN name:test4f visibility:public modality:FINAL <> (x:kotlin.Float, y:kotlin.Number) returnType:kotlin.Boolean - VALUE_PARAMETER name:x index:0 type:kotlin.Float - VALUE_PARAMETER name:y index:1 type:kotlin.Number - BLOCK_BODY - RETURN type=kotlin.Nothing from='public final fun test4f (x: kotlin.Float, y: kotlin.Number): kotlin.Boolean declared in ' - CALL 'public final fun not (): kotlin.Boolean [operator] declared in kotlin.Boolean' type=kotlin.Boolean origin=EXCLEQ - $this: CALL 'public final fun EQEQ (arg0: kotlin.Any?, arg1: kotlin.Any?): kotlin.Boolean declared in kotlin.internal.ir' type=kotlin.Boolean origin=EXCLEQ - arg0: GET_VAR 'x: kotlin.Float declared in .test4f' type=kotlin.Float origin=null - arg1: GET_VAR 'y: kotlin.Number declared in .test4f' type=kotlin.Number origin=null - FUN name:test5f visibility:public modality:FINAL <> (x:kotlin.Float, y:kotlin.Any) returnType:kotlin.Boolean - VALUE_PARAMETER name:x index:0 type:kotlin.Float - VALUE_PARAMETER name:y index:1 type:kotlin.Any - BLOCK_BODY - RETURN type=kotlin.Nothing from='public final fun test5f (x: kotlin.Float, y: kotlin.Any): kotlin.Boolean declared in ' - WHEN type=kotlin.Boolean origin=ANDAND - BRANCH - if: TYPE_OP type=kotlin.Boolean origin=INSTANCEOF typeOperand=kotlin.Float - GET_VAR 'y: kotlin.Any declared in .test5f' type=kotlin.Any origin=null - then: CALL 'public final fun not (): kotlin.Boolean [operator] declared in kotlin.Boolean' type=kotlin.Boolean origin=EXCLEQ - $this: CALL 'public final fun EQEQ (arg0: kotlin.Any?, arg1: kotlin.Any?): kotlin.Boolean declared in kotlin.internal.ir' type=kotlin.Boolean origin=EXCLEQ - arg0: GET_VAR 'x: kotlin.Float declared in .test5f' type=kotlin.Float origin=null - arg1: TYPE_OP type=kotlin.Float origin=IMPLICIT_CAST typeOperand=kotlin.Float - GET_VAR 'y: kotlin.Any declared in .test5f' type=kotlin.Any origin=null - BRANCH - if: CONST Boolean type=kotlin.Boolean value=true - then: CONST Boolean type=kotlin.Boolean value=false - FUN name:test6f visibility:public modality:FINAL <> (x:kotlin.Any, y:kotlin.Any) returnType:kotlin.Boolean - VALUE_PARAMETER name:x index:0 type:kotlin.Any - VALUE_PARAMETER name:y index:1 type:kotlin.Any - BLOCK_BODY - RETURN type=kotlin.Nothing from='public final fun test6f (x: kotlin.Any, y: kotlin.Any): kotlin.Boolean declared in ' - WHEN type=kotlin.Boolean origin=ANDAND - BRANCH - if: WHEN type=kotlin.Boolean origin=ANDAND - BRANCH - if: TYPE_OP type=kotlin.Boolean origin=INSTANCEOF typeOperand=kotlin.Float - GET_VAR 'x: kotlin.Any declared in .test6f' type=kotlin.Any origin=null - then: TYPE_OP type=kotlin.Boolean origin=INSTANCEOF typeOperand=kotlin.Float - GET_VAR 'y: kotlin.Any declared in .test6f' type=kotlin.Any origin=null - BRANCH - if: CONST Boolean type=kotlin.Boolean value=true - then: CONST Boolean type=kotlin.Boolean value=false - then: CALL 'public final fun not (): kotlin.Boolean [operator] declared in kotlin.Boolean' type=kotlin.Boolean origin=EXCLEQ - $this: CALL 'public final fun EQEQ (arg0: kotlin.Any?, arg1: kotlin.Any?): kotlin.Boolean declared in kotlin.internal.ir' type=kotlin.Boolean origin=EXCLEQ - arg0: TYPE_OP type=kotlin.Float origin=IMPLICIT_CAST typeOperand=kotlin.Float - GET_VAR 'x: kotlin.Any declared in .test6f' type=kotlin.Any origin=null - arg1: TYPE_OP type=kotlin.Float origin=IMPLICIT_CAST typeOperand=kotlin.Float - GET_VAR 'y: kotlin.Any declared in .test6f' type=kotlin.Any origin=null - BRANCH - if: CONST Boolean type=kotlin.Boolean value=true - then: CONST Boolean type=kotlin.Boolean value=false - FUN name:testFD visibility:public modality:FINAL <> (x:kotlin.Any, y:kotlin.Any) returnType:kotlin.Boolean - VALUE_PARAMETER name:x index:0 type:kotlin.Any - VALUE_PARAMETER name:y index:1 type:kotlin.Any - BLOCK_BODY - RETURN type=kotlin.Nothing from='public final fun testFD (x: kotlin.Any, y: kotlin.Any): kotlin.Boolean declared in ' - WHEN type=kotlin.Boolean origin=ANDAND - BRANCH - if: WHEN type=kotlin.Boolean origin=ANDAND - BRANCH - if: TYPE_OP type=kotlin.Boolean origin=INSTANCEOF typeOperand=kotlin.Float - GET_VAR 'x: kotlin.Any declared in .testFD' type=kotlin.Any origin=null - then: TYPE_OP type=kotlin.Boolean origin=INSTANCEOF typeOperand=kotlin.Double - GET_VAR 'y: kotlin.Any declared in .testFD' type=kotlin.Any origin=null - BRANCH - if: CONST Boolean type=kotlin.Boolean value=true - then: CONST Boolean type=kotlin.Boolean value=false - then: CALL 'public final fun not (): kotlin.Boolean [operator] declared in kotlin.Boolean' type=kotlin.Boolean origin=EXCLEQ - $this: CALL 'public final fun EQEQ (arg0: kotlin.Any?, arg1: kotlin.Any?): kotlin.Boolean declared in kotlin.internal.ir' type=kotlin.Boolean origin=EXCLEQ - arg0: CALL 'public open fun toDouble (): kotlin.Double declared in kotlin.Float' type=kotlin.Double origin=null - $this: TYPE_OP type=kotlin.Float origin=IMPLICIT_CAST typeOperand=kotlin.Float - GET_VAR 'x: kotlin.Any declared in .testFD' type=kotlin.Any origin=null - arg1: TYPE_OP type=kotlin.Double origin=IMPLICIT_CAST typeOperand=kotlin.Double - GET_VAR 'y: kotlin.Any declared in .testFD' type=kotlin.Any origin=null - BRANCH - if: CONST Boolean type=kotlin.Boolean value=true - then: CONST Boolean type=kotlin.Boolean value=false - FUN name:testDF visibility:public modality:FINAL <> (x:kotlin.Any, y:kotlin.Any) returnType:kotlin.Boolean - VALUE_PARAMETER name:x index:0 type:kotlin.Any - VALUE_PARAMETER name:y index:1 type:kotlin.Any - BLOCK_BODY - RETURN type=kotlin.Nothing from='public final fun testDF (x: kotlin.Any, y: kotlin.Any): kotlin.Boolean declared in ' - WHEN type=kotlin.Boolean origin=ANDAND - BRANCH - if: WHEN type=kotlin.Boolean origin=ANDAND - BRANCH - if: TYPE_OP type=kotlin.Boolean origin=INSTANCEOF typeOperand=kotlin.Double - GET_VAR 'x: kotlin.Any declared in .testDF' type=kotlin.Any origin=null - then: TYPE_OP type=kotlin.Boolean origin=INSTANCEOF typeOperand=kotlin.Float - GET_VAR 'y: kotlin.Any declared in .testDF' type=kotlin.Any origin=null - BRANCH - if: CONST Boolean type=kotlin.Boolean value=true - then: CONST Boolean type=kotlin.Boolean value=false - then: CALL 'public final fun not (): kotlin.Boolean [operator] declared in kotlin.Boolean' type=kotlin.Boolean origin=EXCLEQ - $this: CALL 'public final fun EQEQ (arg0: kotlin.Any?, arg1: kotlin.Any?): kotlin.Boolean declared in kotlin.internal.ir' type=kotlin.Boolean origin=EXCLEQ - arg0: TYPE_OP type=kotlin.Double origin=IMPLICIT_CAST typeOperand=kotlin.Double - GET_VAR 'x: kotlin.Any declared in .testDF' type=kotlin.Any origin=null - arg1: CALL 'public open fun toDouble (): kotlin.Double declared in kotlin.Float' type=kotlin.Double origin=null - $this: TYPE_OP type=kotlin.Float origin=IMPLICIT_CAST typeOperand=kotlin.Float - GET_VAR 'y: kotlin.Any declared in .testDF' type=kotlin.Any origin=null - BRANCH - if: CONST Boolean type=kotlin.Boolean value=true - then: CONST Boolean type=kotlin.Boolean value=false diff --git a/compiler/testData/ir/irText/expressions/floatingPointComparisons/floatingPointExcleq.kt b/compiler/testData/ir/irText/expressions/floatingPointComparisons/floatingPointExcleq.kt index 2d853a016f1..82445eca8f3 100644 --- a/compiler/testData/ir/irText/expressions/floatingPointComparisons/floatingPointExcleq.kt +++ b/compiler/testData/ir/irText/expressions/floatingPointComparisons/floatingPointExcleq.kt @@ -1,3 +1,4 @@ +// FIR_IDENTICAL fun test1d(x: Double, y: Double) = x != y fun test2d(x: Double, y: Double?) = x != y fun test3d(x: Double, y: Any) = x != y diff --git a/compiler/testData/ir/irText/expressions/floatingPointComparisons/nullableFloatingPointEqeq.fir.txt b/compiler/testData/ir/irText/expressions/floatingPointComparisons/nullableFloatingPointEqeq.fir.txt index 8257b14fb59..1ab58c34d7d 100644 --- a/compiler/testData/ir/irText/expressions/floatingPointComparisons/nullableFloatingPointEqeq.fir.txt +++ b/compiler/testData/ir/irText/expressions/floatingPointComparisons/nullableFloatingPointEqeq.fir.txt @@ -4,7 +4,7 @@ FILE fqName: fileName:/nullableFloatingPointEqeq.kt VALUE_PARAMETER name:y index:1 type:kotlin.Double? BLOCK_BODY RETURN type=kotlin.Nothing from='public final fun testDD (x: kotlin.Double?, y: kotlin.Double?): kotlin.Boolean declared in ' - CALL 'public final fun EQEQ (arg0: kotlin.Any?, arg1: kotlin.Any?): kotlin.Boolean declared in kotlin.internal.ir' type=kotlin.Boolean origin=EQEQ + CALL 'public final fun ieee754equals (arg0: kotlin.Double?, arg1: kotlin.Double?): kotlin.Boolean declared in kotlin.internal.ir' type=kotlin.Boolean origin=EQEQ arg0: GET_VAR 'x: kotlin.Double? declared in .testDD' type=kotlin.Double? origin=null arg1: GET_VAR 'y: kotlin.Double? declared in .testDD' type=kotlin.Double? origin=null FUN name:testDF visibility:public modality:FINAL <> (x:kotlin.Double?, y:kotlin.Any?) returnType:kotlin.Boolean @@ -16,7 +16,7 @@ FILE fqName: fileName:/nullableFloatingPointEqeq.kt BRANCH if: TYPE_OP type=kotlin.Boolean origin=INSTANCEOF typeOperand=kotlin.Float? GET_VAR 'y: kotlin.Any? declared in .testDF' type=kotlin.Any? origin=null - then: CALL 'public final fun EQEQ (arg0: kotlin.Any?, arg1: kotlin.Any?): kotlin.Boolean declared in kotlin.internal.ir' type=kotlin.Boolean origin=EQEQ + then: CALL 'public final fun ieee754equals (arg0: kotlin.Double?, arg1: kotlin.Double?): kotlin.Boolean declared in kotlin.internal.ir' type=kotlin.Boolean origin=EQEQ arg0: GET_VAR 'x: kotlin.Double? declared in .testDF' type=kotlin.Double? origin=null arg1: BLOCK type=kotlin.Double? origin=SAFE_CALL VAR IR_TEMPORARY_VARIABLE name:tmp_0 type:kotlin.Float? [val] @@ -44,7 +44,7 @@ FILE fqName: fileName:/nullableFloatingPointEqeq.kt BRANCH if: TYPE_OP type=kotlin.Boolean origin=INSTANCEOF typeOperand=kotlin.Int? GET_VAR 'y: kotlin.Any? declared in .testDI' type=kotlin.Any? origin=null - then: CALL 'public final fun EQEQ (arg0: kotlin.Any?, arg1: kotlin.Any?): kotlin.Boolean declared in kotlin.internal.ir' type=kotlin.Boolean origin=EQEQ + then: CALL 'public final fun ieee754equals (arg0: kotlin.Double?, arg1: kotlin.Double?): kotlin.Boolean declared in kotlin.internal.ir' type=kotlin.Boolean origin=EQEQ arg0: GET_VAR 'x: kotlin.Double? declared in .testDI' type=kotlin.Double? origin=null arg1: BLOCK type=kotlin.Double? origin=SAFE_CALL VAR IR_TEMPORARY_VARIABLE name:tmp_1 type:kotlin.Int? [val] @@ -79,7 +79,7 @@ FILE fqName: fileName:/nullableFloatingPointEqeq.kt BRANCH if: CONST Boolean type=kotlin.Boolean value=true then: CONST Boolean type=kotlin.Boolean value=false - then: CALL 'public final fun EQEQ (arg0: kotlin.Any?, arg1: kotlin.Any?): kotlin.Boolean declared in kotlin.internal.ir' type=kotlin.Boolean origin=EQEQ + then: CALL 'public final fun ieee754equals (arg0: kotlin.Double?, arg1: kotlin.Double?): kotlin.Boolean declared in kotlin.internal.ir' type=kotlin.Boolean origin=EQEQ arg0: BLOCK type=kotlin.Double? origin=SAFE_CALL VAR IR_TEMPORARY_VARIABLE name:tmp_2 type:kotlin.Int? [val] TYPE_OP type=kotlin.Int? origin=IMPLICIT_CAST typeOperand=kotlin.Int? diff --git a/compiler/testData/ir/irText/expressions/floatingPointComparisons/typeParameterWithPrimitiveNumericSupertype.fir.txt b/compiler/testData/ir/irText/expressions/floatingPointComparisons/typeParameterWithPrimitiveNumericSupertype.fir.txt index 501d7424ae1..dfe96dfc2bf 100644 --- a/compiler/testData/ir/irText/expressions/floatingPointComparisons/typeParameterWithPrimitiveNumericSupertype.fir.txt +++ b/compiler/testData/ir/irText/expressions/floatingPointComparisons/typeParameterWithPrimitiveNumericSupertype.fir.txt @@ -26,7 +26,7 @@ FILE fqName: fileName:/typeParameterWithPrimitiveNumericSupertype.kt BRANCH if: TYPE_OP type=kotlin.Boolean origin=INSTANCEOF typeOperand=kotlin.Float GET_VAR 'x: kotlin.Any declared in .test1' type=kotlin.Any origin=null - then: CALL 'public final fun EQEQ (arg0: kotlin.Any?, arg1: kotlin.Any?): kotlin.Boolean declared in kotlin.internal.ir' type=kotlin.Boolean origin=EQEQ + then: CALL 'public final fun ieee754equals (arg0: kotlin.Float?, arg1: kotlin.Float?): kotlin.Boolean declared in kotlin.internal.ir' type=kotlin.Boolean origin=EQEQ arg0: TYPE_OP type=kotlin.Float origin=IMPLICIT_CAST typeOperand=kotlin.Float GET_VAR 'x: kotlin.Any declared in .test1' type=kotlin.Any origin=null arg1: GET_VAR 'y: T of .test1 declared in .test1' type=T of .test1 origin=null @@ -43,7 +43,7 @@ FILE fqName: fileName:/typeParameterWithPrimitiveNumericSupertype.kt BRANCH if: TYPE_OP type=kotlin.Boolean origin=INSTANCEOF typeOperand=kotlin.Float GET_VAR 'x: kotlin.Any declared in .test2' type=kotlin.Any origin=null - then: CALL 'public final fun EQEQ (arg0: kotlin.Any?, arg1: kotlin.Any?): kotlin.Boolean declared in kotlin.internal.ir' type=kotlin.Boolean origin=EQEQ + then: CALL 'public final fun ieee754equals (arg0: kotlin.Double?, arg1: kotlin.Double?): kotlin.Boolean declared in kotlin.internal.ir' type=kotlin.Boolean origin=EQEQ arg0: CALL 'public open fun toDouble (): kotlin.Double declared in kotlin.Float' type=kotlin.Double origin=null $this: TYPE_OP type=kotlin.Float origin=IMPLICIT_CAST typeOperand=kotlin.Float GET_VAR 'x: kotlin.Any declared in .test2' type=kotlin.Any origin=null @@ -61,7 +61,7 @@ FILE fqName: fileName:/typeParameterWithPrimitiveNumericSupertype.kt BRANCH if: TYPE_OP type=kotlin.Boolean origin=INSTANCEOF typeOperand=kotlin.Int GET_VAR 'x: kotlin.Any declared in .test3' type=kotlin.Any origin=null - then: CALL 'public final fun EQEQ (arg0: kotlin.Any?, arg1: kotlin.Any?): kotlin.Boolean declared in kotlin.internal.ir' type=kotlin.Boolean origin=EQEQ + then: CALL 'public final fun ieee754equals (arg0: kotlin.Float?, arg1: kotlin.Float?): kotlin.Boolean declared in kotlin.internal.ir' type=kotlin.Boolean origin=EQEQ arg0: CALL 'public open fun toFloat (): kotlin.Float declared in kotlin.Int' type=kotlin.Float origin=null $this: TYPE_OP type=kotlin.Int origin=IMPLICIT_CAST typeOperand=kotlin.Int GET_VAR 'x: kotlin.Any declared in .test3' type=kotlin.Any origin=null @@ -79,7 +79,7 @@ FILE fqName: fileName:/typeParameterWithPrimitiveNumericSupertype.kt BRANCH if: TYPE_OP type=kotlin.Boolean origin=INSTANCEOF typeOperand=kotlin.Int GET_VAR 'x: kotlin.Any declared in .test4' type=kotlin.Any origin=null - then: CALL 'public final fun EQEQ (arg0: kotlin.Any?, arg1: kotlin.Any?): kotlin.Boolean declared in kotlin.internal.ir' type=kotlin.Boolean origin=EQEQ + then: CALL 'public final fun ieee754equals (arg0: kotlin.Float?, arg1: kotlin.Float?): kotlin.Boolean declared in kotlin.internal.ir' type=kotlin.Boolean origin=EQEQ arg0: CALL 'public open fun toFloat (): kotlin.Float declared in kotlin.Int' type=kotlin.Float origin=null $this: TYPE_OP type=kotlin.Int origin=IMPLICIT_CAST typeOperand=kotlin.Int GET_VAR 'x: kotlin.Any declared in .test4' type=kotlin.Any origin=null @@ -98,7 +98,7 @@ FILE fqName: fileName:/typeParameterWithPrimitiveNumericSupertype.kt BRANCH if: TYPE_OP type=kotlin.Boolean origin=INSTANCEOF typeOperand=kotlin.Int GET_VAR 'x: kotlin.Any declared in .test5' type=kotlin.Any origin=null - then: CALL 'public final fun EQEQ (arg0: kotlin.Any?, arg1: kotlin.Any?): kotlin.Boolean declared in kotlin.internal.ir' type=kotlin.Boolean origin=EQEQ + then: CALL 'public final fun ieee754equals (arg0: kotlin.Float?, arg1: kotlin.Float?): kotlin.Boolean declared in kotlin.internal.ir' type=kotlin.Boolean origin=EQEQ arg0: CALL 'public open fun toFloat (): kotlin.Float declared in kotlin.Int' type=kotlin.Float origin=null $this: TYPE_OP type=kotlin.Int origin=IMPLICIT_CAST typeOperand=kotlin.Int GET_VAR 'x: kotlin.Any declared in .test5' type=kotlin.Any origin=null @@ -140,7 +140,7 @@ FILE fqName: fileName:/typeParameterWithPrimitiveNumericSupertype.kt BRANCH if: TYPE_OP type=kotlin.Boolean origin=INSTANCEOF typeOperand=kotlin.Double GET_VAR 'y: kotlin.Any declared in .F.testCapturedType' type=kotlin.Any origin=null - then: CALL 'public final fun EQEQ (arg0: kotlin.Any?, arg1: kotlin.Any?): kotlin.Boolean declared in kotlin.internal.ir' type=kotlin.Boolean origin=EQEQ + then: CALL 'public final fun ieee754equals (arg0: kotlin.Double?, arg1: kotlin.Double?): kotlin.Boolean declared in kotlin.internal.ir' type=kotlin.Boolean origin=EQEQ arg0: CALL 'public open fun toDouble (): kotlin.Double declared in kotlin.Float' type=kotlin.Double origin=null $this: GET_VAR 'x: T of .F declared in .F.testCapturedType' type=T of .F origin=null arg1: TYPE_OP type=kotlin.Double origin=IMPLICIT_CAST typeOperand=kotlin.Double diff --git a/compiler/testData/ir/irText/expressions/floatingPointComparisons/whenByFloatingPoint.fir.txt b/compiler/testData/ir/irText/expressions/floatingPointComparisons/whenByFloatingPoint.fir.txt index 9e3014995a7..c56f47b511b 100644 --- a/compiler/testData/ir/irText/expressions/floatingPointComparisons/whenByFloatingPoint.fir.txt +++ b/compiler/testData/ir/irText/expressions/floatingPointComparisons/whenByFloatingPoint.fir.txt @@ -8,7 +8,7 @@ FILE fqName: fileName:/whenByFloatingPoint.kt GET_VAR 'x: kotlin.Double declared in .testSimple' type=kotlin.Double origin=null WHEN type=kotlin.Int origin=WHEN BRANCH - if: CALL 'public final fun EQEQ (arg0: kotlin.Any?, arg1: kotlin.Any?): kotlin.Boolean declared in kotlin.internal.ir' type=kotlin.Boolean origin=EQEQ + if: CALL 'public final fun ieee754equals (arg0: kotlin.Double?, arg1: kotlin.Double?): kotlin.Boolean declared in kotlin.internal.ir' type=kotlin.Boolean origin=EQEQ arg0: GET_VAR 'val tmp_0: kotlin.Double [val] declared in .testSimple' type=kotlin.Double origin=null arg1: CONST Double type=kotlin.Double value=0.0 then: CONST Int type=kotlin.Int value=0 @@ -32,7 +32,7 @@ FILE fqName: fileName:/whenByFloatingPoint.kt GET_VAR 'x: kotlin.Any declared in .testSmartCastInWhenSubject' type=kotlin.Any origin=null WHEN type=kotlin.Int origin=WHEN BRANCH - if: CALL 'public final fun EQEQ (arg0: kotlin.Any?, arg1: kotlin.Any?): kotlin.Boolean declared in kotlin.internal.ir' type=kotlin.Boolean origin=EQEQ + if: CALL 'public final fun ieee754equals (arg0: kotlin.Double?, arg1: kotlin.Double?): kotlin.Boolean declared in kotlin.internal.ir' type=kotlin.Boolean origin=EQEQ arg0: GET_VAR 'val tmp_1: kotlin.Double [val] declared in .testSmartCastInWhenSubject' type=kotlin.Double origin=null arg1: CONST Double type=kotlin.Double value=0.0 then: CONST Int type=kotlin.Int value=0 @@ -56,7 +56,7 @@ FILE fqName: fileName:/whenByFloatingPoint.kt GET_VAR 'x: kotlin.Double declared in .testSmartCastInWhenCondition' type=kotlin.Double origin=null WHEN type=kotlin.Int origin=WHEN BRANCH - if: CALL 'public final fun EQEQ (arg0: kotlin.Any?, arg1: kotlin.Any?): kotlin.Boolean declared in kotlin.internal.ir' type=kotlin.Boolean origin=EQEQ + if: CALL 'public final fun ieee754equals (arg0: kotlin.Double?, arg1: kotlin.Double?): kotlin.Boolean declared in kotlin.internal.ir' type=kotlin.Boolean origin=EQEQ arg0: GET_VAR 'val tmp_2: kotlin.Double [val] declared in .testSmartCastInWhenCondition' type=kotlin.Double origin=null arg1: TYPE_OP type=kotlin.Double origin=IMPLICIT_CAST typeOperand=kotlin.Double GET_VAR 'y: kotlin.Any declared in .testSmartCastInWhenCondition' type=kotlin.Any origin=null @@ -110,7 +110,7 @@ FILE fqName: fileName:/whenByFloatingPoint.kt GET_VAR 'x: kotlin.Any declared in .testSmartCastToDifferentTypes' type=kotlin.Any origin=null WHEN type=kotlin.Int origin=WHEN BRANCH - if: CALL 'public final fun EQEQ (arg0: kotlin.Any?, arg1: kotlin.Any?): kotlin.Boolean declared in kotlin.internal.ir' type=kotlin.Boolean origin=EQEQ + if: CALL 'public final fun ieee754equals (arg0: kotlin.Double?, arg1: kotlin.Double?): kotlin.Boolean declared in kotlin.internal.ir' type=kotlin.Boolean origin=EQEQ arg0: GET_VAR 'val tmp_4: kotlin.Double [val] declared in .testSmartCastToDifferentTypes' type=kotlin.Double origin=null arg1: CALL 'public open fun toDouble (): kotlin.Double declared in kotlin.Float' type=kotlin.Double origin=null $this: TYPE_OP type=kotlin.Float origin=IMPLICIT_CAST typeOperand=kotlin.Float diff --git a/compiler/testData/ir/irText/regressions/coercionInLoop.fir.txt b/compiler/testData/ir/irText/regressions/coercionInLoop.fir.txt index ad848e89cdf..4df4be7a6c5 100644 --- a/compiler/testData/ir/irText/regressions/coercionInLoop.fir.txt +++ b/compiler/testData/ir/irText/regressions/coercionInLoop.fir.txt @@ -16,7 +16,7 @@ FILE fqName: fileName:/coercionInLoop.kt WHEN type=kotlin.Unit origin=IF BRANCH if: CALL 'public final fun not (): kotlin.Boolean [operator] declared in kotlin.Boolean' type=kotlin.Boolean origin=EXCLEQ - $this: CALL 'public final fun EQEQ (arg0: kotlin.Any?, arg1: kotlin.Any?): kotlin.Boolean declared in kotlin.internal.ir' type=kotlin.Boolean origin=EXCLEQ + $this: CALL 'public final fun ieee754equals (arg0: kotlin.Double?, arg1: kotlin.Double?): kotlin.Boolean declared in kotlin.internal.ir' type=kotlin.Boolean origin=EXCLEQ arg0: CALL 'public final fun get (index: kotlin.Int): kotlin.Double [operator] declared in kotlin.DoubleArray' type=kotlin.Double origin=null $this: GET_VAR 'val a: kotlin.DoubleArray [val] declared in .box' type=kotlin.DoubleArray origin=null index: GET_VAR 'var i: kotlin.Int [var] declared in .box' type=kotlin.Int origin=null