[PATCH] D45616: [X86] Lower _mm[256|512]_cmp[.]_mask intrinsics to native llvm IR

Gabor Buella via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Thu Jun 14 00:43:49 PDT 2018


GBuella added inline comments.


================
Comment at: lib/CodeGen/CGBuiltin.cpp:10107-10112
+    case 0x0b: // FALSE_OQ
+    case 0x1b: // FALSE_OS
+      return llvm::Constant::getNullValue(ConvertType(E->getType()));
+    case 0x0f: // TRUE_UQ
+    case 0x1f: // TRUE_US
+      return llvm::Constant::getAllOnesValue(ConvertType(E->getType()));
----------------
spatel wrote:
> On 2nd thought, why are we optimizing when we have matching IR predicates for these?
> Just translate to FCMP_TRUE / FCMP_FALSE instead of special-casing these values.
> InstSimplify can handle the constant folding if optimization is on.
I don't know, these TRUE/FALSE cases were already handled here, I only rearranged the code.
Does this cause any problems? I mean, if it meant an extra dozen lines of code I would get it, but as it is, does it hurt anything?


https://reviews.llvm.org/D45616





More information about the cfe-commits mailing list