(Apologies for email spam, I'm still trying to work out how to arcanist to upload a branch as a series of patches instead of one patch. In lieu of that, here's all the patches smushed together for now:)
[InstCombine] Pattern match expressions for naive complex multiply/divide. These patterns are currently hidden via a command-line flag, since the complex intrinsics are still experimental. [Clang][CodeGen] Lower C _Complex multiplies and divides to intrinsics. [CodeGen] Expand complex multiply and divide intrinsics for codegen. For architectures without complex multiply or divide intrinsics (most of them), a pass is needed to expand these intrinsics before codegen. The tricky thing here is that where the intrinsics need to expand into a compiler-rt helper function (e.g., __mulsc3), the ABI of complex floating point types needs to be retrieved from the target. However, this target information isn't fully validated for all targets, only x86 (where the i386 _Complex float ABI is unsupported in this patch, due to its insanity). [IRBuilder] Add methods to construct complex intrinsics to IRBuilder. [IR] Add intrinsics to represent complex multiply and divide instructions. This patch represents the first in a series of patches to bring a more standardized version of complex values into LLVM. Representation of the complex multiply and division instructions are added as intrinsics, and their precise behavior is controlled via attributes and fast-math flags.