Fork of llvm with experimental commits and workarounds for RPCS3
Go to file
Benjamin Kramer 3b38288ea2 Fix for wrong instcombine on vector insert/extract
When trying to collapse sequences of insertelement/extractelement
instructions into single shuffle instructions, there is one specific
case where the Instruction Combiner wrongly updates the resulting
Mask of shuffle indexes.

The problem is in function CollectShuffleElments.

If we have a sequence of insert/extract element instructions
like the one below:

  %tmp1 = extractelement <4 x float> %LHS, i32 0
  %tmp2 = insertelement <4 x float> %RHS, float %tmp1, i32 1
  %tmp3 = extractelement <4 x float> %RHS, i32 2
  %tmp4 = insertelement <4 x float> %tmp2, float %tmp3, i32 3

Where:
  . %RHS will have a mask of [4,5,6,7]
  . %LHS will have a mask of [0,1,2,3]

The Mask of shuffle indexes is wrongly computed to [4,1,6,7]
instead of [4,0,6,7].
When analyzing %tmp2 in order to compute the Mask for the
resulting shuffle instruction, the algorithm forgets to update
the mask index at position 1 with the index associated to the
element extracted from %LHS by instruction %tmp1.

Patch by Andrea DiBiagio!

llvm-svn: 179291
2013-04-11 15:10:09 +00:00
autoconf Refine fenv.h handling: check if the desired macros exist, before using 2013-03-25 13:13:33 +00:00
bindings
cmake [cmake] Avoid rel+asserts warnings when passing -UNDEBUG 2013-04-07 01:45:01 +00:00
docs Add man page for llvm-readobj 2013-04-11 00:05:57 +00:00
examples
include Add a function to check if an argument list is too long. 2013-04-11 14:06:34 +00:00
lib Fix for wrong instcombine on vector insert/extract 2013-04-11 15:10:09 +00:00
projects Print a warning message if compiler-rt can't be built because of old CMake version to make this requirement more visible to users 2013-03-05 14:43:07 +00:00
runtime Remove GCDAProfiling.c. This copy is old, the copy in compiler-rt is newer and 2013-03-07 02:03:08 +00:00
test Fix for wrong instcombine on vector insert/extract 2013-04-11 15:10:09 +00:00
tools Simplify the code. No functionality change. 2013-04-11 03:34:37 +00:00
unittests Delete the functions F1 and F2 to appease the valgrind bot. 2013-04-10 23:21:26 +00:00
utils Add CLAC/STAC instruction encoding/decoding support 2013-04-11 04:52:28 +00:00
.arcconfig
.gitignore
CMakeLists.txt Revert "TMP" 2013-04-10 12:08:57 +00:00
CODE_OWNERS.TXT Move info to CREDITS.TXT file. 2013-04-10 21:56:52 +00:00
configure Refine fenv.h handling: check if the desired macros exist, before using 2013-03-25 13:13:33 +00:00
CREDITS.TXT Add myself in the CREDITS.TXT 2013-04-11 13:15:39 +00:00
LICENSE.TXT
llvm.spec.in
LLVMBuild.txt
Makefile Improved svn repo searching for 'make update' 2013-01-28 03:19:57 +00:00
Makefile.common
Makefile.config.in Turn anonymous type in anonymous union warning back on after cleaning up 2013-03-15 00:43:00 +00:00
Makefile.rules Make check depend on all. 2013-04-09 19:42:12 +00:00
README.txt Revert "Test commit" 2013-02-22 19:19:41 +00:00

Low Level Virtual Machine (LLVM)
================================

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

LLVM is open source software. You may freely distribute it under the terms of
the license agreement found in LICENSE.txt.

Please see the documentation provided in docs/ for further
assistance with LLVM, and in particular docs/GettingStarted.rst for getting
started with LLVM and docs/README.txt for an overview of LLVM's
documentation setup.

If you're writing a package for LLVM, see docs/Packaging.rst for our
suggestions.