[AVX-512] Split the 3 different usages of the X86ISD::FSETCC opcode into 3 different...
authorCraig Topper <craig.topper@gmail.com>
Wed, 21 Sep 2016 06:37:54 +0000 (06:37 +0000)
committerCraig Topper <craig.topper@gmail.com>
Wed, 21 Sep 2016 06:37:54 +0000 (06:37 +0000)
commit29f1a1f83467bd3647023cc6e855a64c955b49f0
tree0b0ba0f4e7a296a996b35a5b02c82dd0f5873702
parentb29784157250228f96aafdc277d3bbae4767d49e
[AVX-512] Split the 3 different usages of the X86ISD::FSETCC opcode into 3 different opcodes.

It turns out isel is really not robust against having different type profiles for the same opcode. It turns out that if you put an illegal rounding mode(i.e. not CUR_DIRECTION or NO_EXC) on a comiss intrinsic we would generate the FSETCC form with the rounding mode added, but then pattern match to an instruction with ROUND_CUR_DIRECTION.

We can probably get away with just one FSETCCM opcode that always contains the rounding mode and explicitly put ROUND_CUR_DIRECTION in the pattern, but I'll leave that for future work.

With this change the clang tests for the comiss intrinsics that used an incorrect rounding mode of 3 properly fail isel instead of silently doing the wrong thing. Those clang tests will be fixed in a follow up commit and I also plan to add rounding mode checking to clang.

llvm-svn: 282055
llvm/lib/Target/X86/X86ISelLowering.cpp
llvm/lib/Target/X86/X86ISelLowering.h
llvm/lib/Target/X86/X86InstrFragmentsSIMD.td
llvm/lib/Target/X86/X86IntrinsicsInfo.h