llvm/test/CodeGen
Petar Jovanovic 51d7cb91e6 [mips][msa] Mask vectors holding shift amounts
Masked vectors which hold shift amounts when creating the following nodes:
ISD::SHL, ISD::SRL or ISD::SRA.
Instructions that use said nodes, which have had their arguments altered are
sll, srl, sra, bneg, bclr and bset.

For said instructions, the shift amount or the bit position that is
specified in the corresponding vector elements will be interpreted as the
shift amount/bit position modulo the size of the element in bits.

The problem lies in compiling with -O2 enabled, where the instructions for
formats .w and .d are not generated, but are instead optimized away.
In this case, having shift amounts that are either negative or greater than
the element bit size results in generation of incorrect results when
constant folding.

We remedy this by masking the operands for the nodes mentioned above before
actually creating them, so that the final result is correct before placed
into the constant pool.

Patch by Stefan Maksimovic.

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



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@300839 91177308-0d34-0410-b5e6-96231b3b80d8
2017-04-20 13:26:46 +00:00
..
AArch64 [GlobalISel] Support vector-of-pointers in LLT 2017-04-19 07:23:57 +00:00
AMDGPU AMDGPU: Custom lower illegal small select types 2017-04-19 20:53:07 +00:00
ARM [DAG] add splat vector support for 'xor' in SimplifyDemandedBits 2017-04-19 21:23:09 +00:00
AVR [AVR] Remove the 'multibyte' asm test 2017-04-19 12:13:45 +00:00
BPF [bpf] Fix memory offset check for loads and stores 2017-04-13 22:24:13 +00:00
Generic [Hexagon] Unxfail passing tests 2017-04-13 16:05:35 +00:00
Hexagon [Hexagon] Generate proper offset in opt-addr-mode 2017-04-19 15:15:51 +00:00
Inputs
Lanai
Mips [mips][msa] Mask vectors holding shift amounts 2017-04-20 13:26:46 +00:00
MIR MIR: Allow parsing of empty machine functions 2017-04-11 19:32:41 +00:00
MSP430 In visitSTORE, always use FindBetterChain, rather than only when UseAA is enabled. 2017-03-14 00:34:14 +00:00
NVPTX Add address space mangling to lifetime intrinsics 2017-04-10 20:18:21 +00:00
PowerPC [DAG] add splat vector support for 'xor' in SimplifyDemandedBits 2017-04-19 21:23:09 +00:00
SPARC [Sparc] Check register use with isPhysRegUsed() instead of reg_nodbg_empty() 2017-03-08 15:23:10 +00:00
SystemZ Add address space mangling to lifetime intrinsics 2017-04-10 20:18:21 +00:00
Thumb Add address space mangling to lifetime intrinsics 2017-04-10 20:18:21 +00:00
Thumb2 Add address space mangling to lifetime intrinsics 2017-04-10 20:18:21 +00:00
WebAssembly [WebAssembly] Fix WebAssemblyOptimizeReturned after r300367 2017-04-17 21:40:28 +00:00
WinEH
X86 Temporarily revert r299221 to fix nondeterminism in ThinLTO builder. 2017-04-19 23:16:14 +00:00
XCore In visitSTORE, always use FindBetterChain, rather than only when UseAA is enabled. 2017-03-14 00:34:14 +00:00