llvm-project/clang/lib/Headers
Adam Nemet 286ae08e7d Implement AVX1 vbroadcast intrinsics with vector initializers
These intrinsics are special because they directly take a memory operand (AVX2
adds the register counterparts).  Typically, other non-memop intrinsics take
registers and then it's left to isel to fold memory operands.

In order to LICM intrinsics directly reading memory, we require that no stores
are in the loop (LICM) or that the folded load accesses constant memory
(MachineLICM).  When neither is the case we fail to hoist a loop-invariant
broadcast.

We can work around this limitation if we expose the load as a regular load and
then just implement the broadcast using the vector initializer syntax.  This
exposes the load to LICM and other optimizations.

At the IR level this is translated into a series of insertelements.  The
sequence is already recognized as a broadcast so there is no impact on the
quality of codegen.

_mm256_broadcast_pd and _mm256_broadcast_ps are not updated by this patch
because right now we lack the DAG-combiner smartness to recover the broadcast
instructions.  This will be tackled in a follow-on.

There will be completing changes on the LLVM side to remove the LLVM
intrinsics and to auto-upgrade bitcode files.

Fixes <rdar://problem/16494520>

llvm-svn: 209846
2014-05-29 20:47:29 +00:00
..
CMakeLists.txt Rename lib/Headers/module.map to module.modulemap 2014-04-17 00:52:48 +00:00
Intrin.h Define the InterlockedCompareExchange64 intrinsic on 32-bits too 2014-05-13 13:59:05 +00:00
Makefile Rename lib/Headers/module.map to module.modulemap 2014-04-17 00:52:48 +00:00
__wmmintrin_aes.h Split the instrinsic header wmmintrin.h into AES and PCLMUL parts, so 2012-11-05 23:30:26 +00:00
__wmmintrin_pclmul.h Split the instrinsic header wmmintrin.h into AES and PCLMUL parts, so 2012-11-05 23:30:26 +00:00
altivec.h PR15480: fixed second parameter types of vec_lde, vec_lvebx, vec_lvehx, and vec_lvewx according to AltiVec Programming Interface Manual 2013-03-10 16:25:43 +00:00
ammintrin.h
avx2intrin.h Patched clang to emit x86 blends as shufflevectors. 2014-05-13 02:37:02 +00:00
avxintrin.h Implement AVX1 vbroadcast intrinsics with vector initializers 2014-05-29 20:47:29 +00:00
bmi2intrin.h Add intrinsic of MULX in BMI2 header 2012-10-05 18:50:09 +00:00
bmiintrin.h added Intel's BMI intrinsic variants 2014-05-28 20:26:57 +00:00
cpuid.h Add bit_FXSAVE as an alias for bit_FXSR, for gcc compat. 2013-12-16 17:54:57 +00:00
emmintrin.h Fix a SSE2 intrinsics typo 2013-11-23 22:11:57 +00:00
f16cintrin.h Remove some stray underscores from copyright block. Fix first line length to match length of the one after the copyright block. 2013-09-27 03:57:18 +00:00
float.h Remove a broken attempt to cope with someone #undef'ing __has_include_next. 2014-02-19 22:53:42 +00:00
fma4intrin.h
fmaintrin.h Add fma3 intrinsic header file. 2012-06-04 03:42:47 +00:00
ia32intrin.h [X86] Add Clang support for intrinsics __rdtsc and __rdtscp. 2014-04-24 18:26:35 +00:00
immintrin.h The wmmintrin.h header includes two different sub-headers: one for AES support 2014-03-04 18:26:12 +00:00
iso646.h
limits.h Fix two pedantic issues with our builtin headers. The __STDC_VERSION__ 2014-02-19 23:38:18 +00:00
lzcntintrin.h
mm3dnow.h Add PRFCHW intrinsic support 2013-03-26 17:52:08 +00:00
mm_malloc.h PR14964: intrinsic headers using non-reserved identifiers 2013-01-16 23:08:36 +00:00
mmintrin.h
module.modulemap Rename lib/Headers/module.map to module.modulemap 2014-04-17 00:52:48 +00:00
nmmintrin.h
pmmintrin.h PR14964: intrinsic headers using non-reserved identifiers 2013-01-16 23:08:36 +00:00
popcntintrin.h
prfchwintrin.h Add include guards to prfchwintrin.h. 2013-05-09 15:07:39 +00:00
rdseedintrin.h Add missing include guards into headers in lib/Headers. While it may appear 2013-07-14 05:41:45 +00:00
rtmintrin.h Add missing include guards into headers in lib/Headers. While it may appear 2013-07-14 05:41:45 +00:00
shaintrin.h Fix ifdef macro missed in previous commit 2013-09-19 14:07:14 +00:00
smmintrin.h Patched clang to emit x86 blends as shufflevectors. 2014-05-13 02:37:02 +00:00
stdalign.h libstdc++'s <cstdalign> #includes <stdalign.h> and expects it to guard against 2013-02-21 02:17:58 +00:00
stdarg.h Fix two pedantic issues with our builtin headers. The __STDC_VERSION__ 2014-02-19 23:38:18 +00:00
stdbool.h
stddef.h Let stddef.h respect __need_{wchar_t, size_t, NULL, ptrdiff_t, wint_t}. 2014-04-30 04:35:09 +00:00
stdint.h Remove a broken attempt to cope with someone #undef'ing __has_include_next. 2014-02-19 22:53:42 +00:00
stdnoreturn.h Parsing support for C11's _Noreturn keyword. No semantics yet. 2013-01-17 22:16:11 +00:00
tbmintrin.h Use logical/arithmetic operations instead of builtins in tbmintrin.h. This way we can remove the intrinsic support from the backend. 2013-10-05 17:08:42 +00:00
tgmath.h Fix the return type of the complex creal functions. Patch by YunZhong Gao, modified to use _Static_assert and to check __STDC_HOSTED__ by me. 2013-05-09 17:41:19 +00:00
tmmintrin.h PR14964: intrinsic headers using non-reserved identifiers 2013-01-16 23:08:36 +00:00
unwind.h Provide inline definitions of _Unwind_GetIP etc. for ARM in unwind.h 2013-09-25 22:34:03 +00:00
varargs.h
wmmintrin.h Split the instrinsic header wmmintrin.h into AES and PCLMUL parts, so 2012-11-05 23:30:26 +00:00
x86intrin.h Implement __readeflags and __writeeflags intrinsics 2014-03-04 03:03:03 +00:00
xmmintrin.h Fix a bug in xmmintrin.h. 2014-05-23 00:38:07 +00:00
xopintrin.h xopintrin.h: Add wrappers for all flavors of _mm_com. 2013-05-09 15:07:46 +00:00