Go to file
Alexey Bataev ec95c6cc0a [InstCombine] PR35354: Convert store(bitcast, load bitcast (select (Cond, &V1, &V2)) --> store (, load (select(Cond, load &V1, load &V2)))
Summary:
If we have the code like this:
```
float a, b;
a = std::max(a ,b);
```
it is converted into something like this:
```
%call = call dereferenceable(4) float* @_ZSt3maxIfERKT_S2_S2_(float* nonnull dereferenceable(4) %a.addr, float* nonnull dereferenceable(4) %b.addr)
%1 = bitcast float* %call to i32*
%2 = load i32, i32* %1, align 4
%3 = bitcast float* %a.addr to i32*
store i32 %2, i32* %3, align 4
```
After inlinning this code is converted to the next:
```
%1 = load float, float* %a.addr
%2 = load float, float* %b.addr
%cmp.i = fcmp fast olt float %1, %2
%__b.__a.i = select i1 %cmp.i, float* %a.addr, float* %b.addr
%3 = bitcast float* %__b.__a.i to i32*
%4 = load i32, i32* %3, align 4
%5 = bitcast float* %arrayidx to i32*
store i32 %4, i32* %5, align 4

```
This pattern is not recognized as minmax pattern.
Patch solves this problem by converting sequence
```
store (bitcast, (load bitcast (select ((cmp V1, V2), &V1, &V2))))
```
to a sequence
```
store (,load (select((cmp V1, V2), &V1, &V2)))
```
After this the code is recognized as minmax pattern.

Reviewers: RKSimon, spatel

Subscribers: llvm-commits

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

llvm-svn: 320157
2017-12-08 15:32:10 +00:00
clang [OPENMP] Initial codegen for `target teams distribute` directive. 2017-12-08 15:03:50 +00:00
clang-tools-extra [clangd] Convert lit code completion tests to unit-tests. NFC 2017-12-08 15:00:59 +00:00
compiler-rt [ubsan] Test for pass_object_size bounds checks 2017-12-08 01:51:51 +00:00
debuginfo-tests Revert "Temporarily pin tests to DWARF v2 until a more recent version of LLDB" 2017-12-07 19:40:31 +00:00
libclc configure.py: Add gfx900 (Vega, Raven) 2017-11-27 11:14:06 +00:00
libcxx [libcxx] [test] Strip trailing whitespace. NFC. 2017-12-07 00:50:23 +00:00
libcxxabi [libcxxabi] Set up .arcconfig to point to new Diffusion CXXA repository 2017-12-04 23:14:03 +00:00
libunwind [libunwind][CMake] Set TARGET_TRIPLE if LIBUNWND_TARGET_TRIPLE is set 2017-12-05 20:48:05 +00:00
lld Print the bad value and required alignment for unaligned relocations 2017-12-08 14:53:14 +00:00
lldb [MachException] Avoid alignment UB, NFC 2017-12-08 01:09:40 +00:00
llgo irgen: Create functions instead of global variables for builtin hash and equal algorithms. 2017-06-04 22:11:28 +00:00
llvm [InstCombine] PR35354: Convert store(bitcast, load bitcast (select (Cond, &V1, &V2)) --> store (, load (select(Cond, load &V1, load &V2))) 2017-12-08 15:32:10 +00:00
openmp [CMake] Remove legacy LIBOMP_LIT_ARGS 2017-12-08 15:07:08 +00:00
parallel-libs [Axccel] Remove -Wno-missing-braces in build 2016-12-19 21:34:07 +00:00
polly [NFC] Fix formatting 2017-12-06 22:01:08 +00:00
README.md Add an svn project to contain the files that appear at the root of the 2017-10-19 21:09:49 +00:00

README.md

Low Level Virtual Machine (LLVM)

This directory and its subdirectories contain source code for LLVM, a toolkit for the construction of highly optimized compilers, optimizers, and runtime environments.