Add missing handling of STRICT_FSETCC promotion. This prevents assert
failure in llvm::TargetLoweringBase::getTypeToPromoteTo().
|390 ms||linux > HWAddressSanitizer-x86_64.TestCases::sizes.cpp|
Script: -- : 'RUN: at line 3'; /mnt/disks/ssd0/agent/llvm-project/build/./bin/clang --driver-mode=g++ -m64 -gline-tables-only -fsanitize=hwaddress -fuse-ld=lld -mcmodel=large -mllvm -hwasan-globals -mllvm -hwasan-use-short-granules -mllvm -hwasan-instrument-landing-pads=0 -mllvm -hwasan-instrument-personality-functions /mnt/disks/ssd0/agent/llvm-project/compiler-rt/test/hwasan/TestCases/sizes.cpp -nostdlib++ -lstdc++ -o /mnt/disks/ssd0/agent/llvm-project/build/projects/compiler-rt/test/hwasan/X86_64/TestCases/Output/sizes.cpp.tmp
When expanding a strict FP operation, we need to take care to never emit any non-strict operation. It looks like the patch as currently written might cause a "FP_EXTEND" to be emitted, which would violate that rule.
We need to emit a STRICT_FP_EXTEND instead (which needs to be properly chained just before the new STRICT_FSETCC node). Then everything should be OK since the only case where STRICT_FP_EXTEND might raise an exception is if the input is a (signaling) NaN, in which case the original STRICT_FSETCC would also have raised an exception.
See the two inline comments about STRICT_FSETCCS. I guess that shows this path is not really exercised right now -- maybe it would be a good idea to add some tests.
I guess this needs to handle STRICT_FSETCCS here as well.
Should use STRICT_FSETCCS here if we're expanding STRICT_FSETCCS.
The problem is that no target currently promote a STRICT_FSETCC or STRICT_FSETCCS. Our target does which is how I found out the assert failure but I haven't implemented STRICT_FSETCCS yet.