This patch attempts to fix a compiler crash that occurs when long double type
is used with -mno-x87 compiler option.
The option disables x87 target feature, which in turn disables x87 registers, so
CG cannot select them for x86_fp80 LLVM IR type. Long double is lowered as
x86_fp80 for some targets, so it leads to a crash.
The option seems to contradict the SystemV ABI, which requires long double to
be represented as a 80-bit floating point, and it also requires to use x87 registers.
In addition to that, float and double also use x87 registers for
return values on 32-bit x86, so they are disabled as well.
I think SPIR targets already do something like this, can you check and see how they do it instead?