llvm-6502/lib
Benjamin Kramer c37cb66e6e 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!

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@179291 91177308-0d34-0410-b5e6-96231b3b80d8
2013-04-11 15:10:09 +00:00
..
Analysis RegionInfo: Add helpers to replace entry/exit recursively 2013-04-10 06:54:49 +00:00
Archive Fix auto_ptr is deprecated warnings 2013-02-26 21:20:35 +00:00
AsmParser Rationalize the formatting of these case labels. Having two sorted 2013-04-09 19:46:46 +00:00
Bitcode Whitespace cleanup 2013-04-01 02:28:07 +00:00
CodeGen Add braces around || in && to pacify GCC. 2013-04-11 11:57:01 +00:00
DebugInfo Rename the C function to create a SLPVectorizerPass to something sane and expose it in the header file. 2013-04-11 11:36:36 +00:00
ExecutionEngine Respect Addend when processing MCJIT relocations to local/global symbols. 2013-04-05 13:29:04 +00:00
IR Measure time that IR parsing took as part of the -time-passes measurement. 2013-04-03 15:33:45 +00:00
IRReader Measure time that IR parsing took as part of the -time-passes measurement. 2013-04-03 15:33:45 +00:00
Linker Specutively revert r178130. 2013-03-27 17:54:41 +00:00
MC MC: Support COFF image-relative MCSymbolRefs 2013-04-10 23:28:17 +00:00
Object Fix MachO's getRelocationAdditionalInfo. 2013-04-11 02:21:31 +00:00
Option Resort the #include lines in include/... and lib/... with the 2013-01-02 10:22:59 +00:00
Support Add a function to check if an argument list is too long. 2013-04-11 14:06:34 +00:00
TableGen Allow TableGen DAG arguments to be just a name. 2013-03-24 19:36:51 +00:00
Target Optimize vector select from all 0s or all 1s 2013-04-11 05:15:54 +00:00
Transforms Fix for wrong instcombine on vector insert/extract 2013-04-11 15:10:09 +00:00
CMakeLists.txt Split out the IRReader header and the utility functions it provides into 2013-03-26 02:25:37 +00:00
LLVMBuild.txt Split out the IRReader header and the utility functions it provides into 2013-03-26 02:25:37 +00:00
Makefile Split out the IRReader header and the utility functions it provides into 2013-03-26 02:25:37 +00:00