Index: lib/CodeGen/SelectionDAG/LegalizeTypes.cpp =================================================================== --- lib/CodeGen/SelectionDAG/LegalizeTypes.cpp +++ lib/CodeGen/SelectionDAG/LegalizeTypes.cpp @@ -33,7 +33,9 @@ // of PromotedIntegers, ExpandedIntegers, ..., ReplacedValues. // If a node is processed, then each value with an illegal type must be mapped - // by exactly one of PromotedIntegers, ExpandedIntegers, ..., ReplacedValues. + // by exactly one of PromotedIntegers, ExpandedIntegers, ..., ReplacedValues + // with the exception that a value may be in SoftenedFloats and in + // ReplacedValues simultaneously. // Values with a legal type may be mapped by ReplacedValues, but not by any of // the other maps. @@ -124,7 +126,9 @@ // Since we allow ReplacedValues to map deleted nodes, it may map nodes // marked NewNode too, since a deleted node may have been reallocated as // another node that has not been seen by the LegalizeTypes machinery. - if ((Node.getNodeId() == NewNode && Mapped > 1) || + // Treatment of SoftenedFloats may also create nodes that are abandoned + // latter. + if ((Node.getNodeId() == NewNode && Mapped > 1 && Mapped != 4) || (Node.getNodeId() != NewNode && Mapped != 0)) { dbgs() << "Unprocessed value in a map!"; Failed = true; @@ -138,7 +142,7 @@ if (Mapped == 0) { dbgs() << "Processed value not in any map!"; Failed = true; - } else if (Mapped & (Mapped - 1)) { + } else if ((Mapped != (1 | 4)) && (Mapped & (Mapped - 1))) { dbgs() << "Value in multiple maps!"; Failed = true; } Index: test/CodeGen/ARM/fp16.ll =================================================================== --- test/CodeGen/ARM/fp16.ll +++ test/CodeGen/ARM/fp16.ll @@ -2,7 +2,7 @@ ; RUN: llc -mtriple=armv7a--none-gnueabi < %s | FileCheck --check-prefix=CHECK --check-prefix=CHECK-HARDFLOAT-GNU %s ; RUN: llc -mtriple=armv7a--none-musleabi < %s | FileCheck --check-prefix=CHECK --check-prefix=CHECK-HARDFLOAT-GNU %s ; RUN: llc -mtriple=armv8-eabihf < %s | FileCheck --check-prefix=CHECK --check-prefix=CHECK-ARMV8 %s -; RUN: llc -mtriple=thumbv7m-eabi < %s | FileCheck --check-prefix=CHECK --check-prefix=CHECK-SOFTFLOAT-EABI %s +; RUN: llc -mtriple=thumbv7m-eabi -enable-legalize-types-checking < %s | FileCheck --check-prefix=CHECK --check-prefix=CHECK-SOFTFLOAT-EABI %s ; RUN: llc -mtriple=thumbv7m-gnueabi < %s | FileCheck --check-prefix=CHECK --check-prefix=CHECK-SOFTFLOAT-GNU %s ; RUN: llc -mtriple=thumbv7m-musleabi < %s | FileCheck --check-prefix=CHECK --check-prefix=CHECK-SOFTFLOAT-GNU %s Index: test/CodeGen/X86/soft-fp.ll =================================================================== --- test/CodeGen/X86/soft-fp.ll +++ test/CodeGen/X86/soft-fp.ll @@ -2,7 +2,7 @@ ; RUN: | FileCheck %s --check-prefix=SOFT1 --check-prefix=CHECK ; RUN: llc < %s -march=x86-64 -mattr=+mmx,+sse2,+soft-float \ ; RUN: | FileCheck %s --check-prefix=SOFT2 --check-prefix=CHECK -; RUN: llc < %s -march=x86-64 -mattr=+mmx,+sse \ +; RUN: llc < %s -march=x86-64 -mattr=+mmx,+sse -enable-legalize-types-checking \ ; RUN: | FileCheck %s --check-prefix=SSE1 --check-prefix=CHECK ; RUN: llc < %s -march=x86-64 -mattr=+mmx,+sse2 \ ; RUN: | FileCheck %s --check-prefix=SSE2 --check-prefix=CHECK