1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2024-10-25 05:52:53 +02:00
llvm-mirror/test/CodeGen/Mips/llvm-ir
Daniel Sanders 37f2fd9046 Fix vector splitting for extract_vector_elt and vector elements of <8-bits.
Summary:
One of the vector splitting paths for extract_vector_elt tries to lower:
    define i1 @via_stack_bug(i8 signext %idx) {
      %1 = extractelement <2 x i1> <i1 false, i1 true>, i8 %idx
      ret i1 %1
    }
to:
    define i1 @via_stack_bug(i8 signext %idx) {
      %base = alloca <2 x i1>
      store <2 x i1> <i1 false, i1 true>, <2 x i1>* %base
      %2 = getelementptr <2 x i1>, <2 x i1>* %base, i32 %idx
      %3 = load i1, i1* %2
      ret i1 %3
    }
However, the elements of <2 x i1> are not byte-addressible. The result of this
is that the getelementptr expands to '%base + %idx * (1 / 8)' which simplifies
to '%base + %idx * 0', and then simply '%base' causing all values of %idx to
extract element zero.

This commit fixes this by promoting the vector elements of <8-bits to i8 before
splitting the vector.

This fixes a number of test failures in pocl.

Reviewers: pekka.jaaskelainen

Subscribers: pekka.jaaskelainen, llvm-commits

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

llvm-svn: 247128
2015-09-09 09:53:20 +00:00
..
add.ll [mips] Add backend support for Mips32r[35] and Mips64r[35]. 2015-02-18 16:24:50 +00:00
addrspacecast.ll [mips] Reserve address spaces 1-255 for software use. 2015-09-08 09:07:03 +00:00
and.ll Revert r229675 - [mips] Avoid redundant sign extension of the result of binary bitwise instructions. 2015-08-04 14:26:35 +00:00
ashr.ll Revert r237789 - [mips] The naming convention for private labels is ABI dependant. 2015-05-20 14:18:59 +00:00
call.ll [mips] Add backend support for Mips32r[35] and Mips64r[35]. 2015-02-18 16:24:50 +00:00
extractelement.ll Fix vector splitting for extract_vector_elt and vector elements of <8-bits. 2015-09-09 09:53:20 +00:00
indirectbr.ll Revert r237789 - [mips] The naming convention for private labels is ABI dependant. 2015-05-20 14:18:59 +00:00
lshr.ll Revert r237789 - [mips] The naming convention for private labels is ABI dependant. 2015-05-20 14:18:59 +00:00
mul.ll [mips] Add backend support for Mips32r[35] and Mips64r[35]. 2015-02-18 16:24:50 +00:00
or.ll Revert r229675 - [mips] Avoid redundant sign extension of the result of binary bitwise instructions. 2015-08-04 14:26:35 +00:00
ret.ll [mips] Add backend support for Mips32r[35] and Mips64r[35]. 2015-02-18 16:24:50 +00:00
sdiv.ll [mips] Add backend support for Mips32r[35] and Mips64r[35]. 2015-02-18 16:24:50 +00:00
select.ll Revert r237789 - [mips] The naming convention for private labels is ABI dependant. 2015-05-20 14:18:59 +00:00
shl.ll Revert r237789 - [mips] The naming convention for private labels is ABI dependant. 2015-05-20 14:18:59 +00:00
srem.ll [mips] Add backend support for Mips32r[35] and Mips64r[35]. 2015-02-18 16:24:50 +00:00
sub.ll [mips] Add backend support for Mips32r[35] and Mips64r[35]. 2015-02-18 16:24:50 +00:00
udiv.ll [mips] Add backend support for Mips32r[35] and Mips64r[35]. 2015-02-18 16:24:50 +00:00
urem.ll [mips] Add backend support for Mips32r[35] and Mips64r[35]. 2015-02-18 16:24:50 +00:00
xor.ll Revert r229675 - [mips] Avoid redundant sign extension of the result of binary bitwise instructions. 2015-08-04 14:26:35 +00:00