llvm-6502/test
Michael J. Spencer d4b4f2d340 [IR] Make {extract,insert}element accept an index of any integer type.
Given the following C code llvm currently generates suboptimal code for
x86-64:

__m128 bss4( const __m128 *ptr, size_t i, size_t j )
{
    float f = ptr[i][j];
    return (__m128) { f, f, f, f };
}

=================================================

define <4 x float> @_Z4bss4PKDv4_fmm(<4 x float>* nocapture readonly %ptr, i64 %i, i64 %j) #0 {
  %a1 = getelementptr inbounds <4 x float>* %ptr, i64 %i
  %a2 = load <4 x float>* %a1, align 16, !tbaa !1
  %a3 = trunc i64 %j to i32
  %a4 = extractelement <4 x float> %a2, i32 %a3
  %a5 = insertelement <4 x float> undef, float %a4, i32 0
  %a6 = insertelement <4 x float> %a5, float %a4, i32 1
  %a7 = insertelement <4 x float> %a6, float %a4, i32 2
  %a8 = insertelement <4 x float> %a7, float %a4, i32 3
  ret <4 x float> %a8
}

=================================================

        shlq    $4, %rsi
        addq    %rdi, %rsi
        movslq  %edx, %rax
        vbroadcastss    (%rsi,%rax,4), %xmm0
        retq

=================================================

The movslq is uneeded, but is present because of the trunc to i32 and then
sext back to i64 that the backend adds for vbroadcastss.

We can't remove it because it changes the meaning. The IR that clang
generates is already suboptimal. What clang really should emit is:

  %a4 = extractelement <4 x float> %a2, i64 %j

This patch makes that legal. A separate patch will teach clang to do it.

Differential Revision: http://reviews.llvm.org/D3519

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@207801 91177308-0d34-0410-b5e6-96231b3b80d8
2014-05-01 22:12:39 +00:00
..
Analysis Reapply "blockfreq: Approximate irreducible control flow" 2014-04-28 20:02:29 +00:00
Assembler Reject alias to undefined symbols in the verifier. 2014-03-12 20:15:49 +00:00
Bindings Fix the ocaml test to not create a alias to a declaration. 2014-03-12 21:20:42 +00:00
Bitcode Add 'musttail' marker to call instructions 2014-04-24 20:14:34 +00:00
BugPoint Revert r206989, "Mark llvm/test/BugPoint/compile-custom.ll as XFAIL:vg_leak." It has been fixed since r207265. 2014-04-27 11:59:33 +00:00
CodeGen [IR] Make {extract,insert}element accept an index of any integer type. 2014-05-01 22:12:39 +00:00
DebugInfo DebugInfo: Correct the attribute type kind. 2014-05-01 18:31:21 +00:00
ExecutionEngine [ARM64] Disable regression tests for the old JIT. 2014-04-29 15:02:40 +00:00
Feature [IR] Make {extract,insert}element accept an index of any integer type. 2014-05-01 22:12:39 +00:00
FileCheck
Instrumentation [asan] Fix instrumentation of x86 intel syntax inline assembly. 2014-04-24 09:56:15 +00:00
Integer
JitListener
Linker Fix DataLayout::operator==(). 2014-04-22 17:47:03 +00:00
LTO Add an -mattr option to the gold plugin to support subtarget features in LTO 2014-04-25 21:46:51 +00:00
MC Don't propagate StorageClass and ComplexType to aliases. 2014-05-01 19:02:03 +00:00
Object [llvm-readobj] Add support for Mips specific ELF header e_flags. 2014-05-01 11:07:19 +00:00
Other [PM] Add a new-PM-style CGSCC pass manager using the newly added 2014-04-21 11:12:00 +00:00
TableGen
tools ProfileData: Treat missing function counts as malformed 2014-04-25 02:45:33 +00:00
Transforms Add an optimization that does CSE in a group of similar GEPs. 2014-05-01 18:38:36 +00:00
Unit With rpaths being set correctly, SHLIBPATH_VAR is not needed anymore. 2014-02-28 16:16:51 +00:00
Verifier IR: Conservatively verify inalloca arguments 2014-04-30 17:22:00 +00:00
YAMLParser
.clang-format
CMakeLists.txt [CMake] check-llvm: Include "bugpoint" in dependent list. 2014-03-04 16:13:30 +00:00
lit.cfg Don't expect to find fpcmp and PerfectShuffle when running lit tests 2014-04-30 21:26:35 +00:00
lit.site.cfg.in
Makefile With rpaths being set correctly, SHLIBPATH_VAR is not needed anymore. 2014-02-28 16:16:51 +00:00
Makefile.tests
TestRunner.sh