[ARM] Fix infinite loop when lowering STRICT_FP_EXTEND
authorJohn Brawn <john.brawn@arm.com>
Thu, 13 Feb 2020 14:52:33 +0000 (14:52 +0000)
committerJohn Brawn <john.brawn@arm.com>
Thu, 13 Feb 2020 16:12:50 +0000 (16:12 +0000)
commit0ec57972967dfb43fc022c2e3788be041d1db730
tree243451f9c008bb7bbd1f7e5593d2e8a42648f937
parent18789bfe3a39f69f6cfe6490a24a61ea2ff0b5af
[ARM] Fix infinite loop when lowering STRICT_FP_EXTEND

If the target has FP64 but not FP16 then we have custom lowering for FP_EXTEND
and STRICT_FP_EXTEND with type f64. However if the extend is from f32 to f64 the
current implementation will cause in infinite loop for STRICT_FP_EXTEND due to
emitting a merge_values of the original node which after replacement becomes a
merge_values of itself.

Fix this by not doing anything for f32 to f64 extend when we have FP64, though
for STRICT_FP_EXTEND we have to do the strict-to-nonstrict mutation as that
doesn't happen automatically for opcodes with custom lowering.

Differential Revision: https://reviews.llvm.org/D74559
llvm/lib/Target/ARM/ARMISelLowering.cpp
llvm/test/CodeGen/ARM/fp-intrinsics.ll