[X86] Remove masking from pternlog llvm intrinsics and use a select instruction instead.
authorCraig Topper <craig.topper@intel.com>
Mon, 21 May 2018 20:58:23 +0000 (20:58 +0000)
committerCraig Topper <craig.topper@intel.com>
Mon, 21 May 2018 20:58:23 +0000 (20:58 +0000)
commit288bd2e5a082897be30a050bd14d387ae5eb8208
treeed215159d11d54d6c826fdb5641ed164246b07c7
parentaad3aefaeba7574531aeb125f6d148cdeee83057
[X86] Remove masking from pternlog llvm intrinsics and use a select instruction instead.

Because the intrinsics in the headers are implemented as macros, we can't just use a select builtin and pternlog builtin. This would require one of the macro arguments to be used twice. Depending on what was passed to the macro we could expand an expression twice leading to weird behavior. We could maybe declare our local variable in the macro, but that would need to worry about name collisions.

To avoid that just generate IR directly in CGBuiltin.cpp.

Differential Revision: https://reviews.llvm.org/D47125

llvm-svn: 332891
clang/lib/CodeGen/CGBuiltin.cpp
clang/test/CodeGen/avx512f-builtins.c
clang/test/CodeGen/avx512vl-builtins.c