OSDN Git Service

DAG: Avoid OOB when legalizing vector indexing
authorMatt Arsenault <Matthew.Arsenault@amd.com>
Tue, 10 Jan 2017 22:02:30 +0000 (22:02 +0000)
committerMatt Arsenault <Matthew.Arsenault@amd.com>
Tue, 10 Jan 2017 22:02:30 +0000 (22:02 +0000)
commitfa5aafaac272f060588eb005269d8d818a87b761
tree5b0a11989db7489601ca557da3b19af4000a7d45
parentaca5f1663aa5419799de4783cb453f974e92b3e3
DAG: Avoid OOB when legalizing vector indexing

If a vector index is out of bounds, the result is supposed to be
undefined but is not undefined behavior. Change the legalization
for indexing the vector on the stack so that an out of bounds
index does not create an out of bounds memory access.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@291604 91177308-0d34-0410-b5e6-96231b3b80d8
22 files changed:
include/llvm/Target/TargetLowering.h
lib/CodeGen/SelectionDAG/LegalizeDAG.cpp
lib/CodeGen/SelectionDAG/LegalizeTypes.cpp
lib/CodeGen/SelectionDAG/LegalizeTypes.h
lib/CodeGen/SelectionDAG/LegalizeVectorTypes.cpp
lib/CodeGen/SelectionDAG/TargetLowering.cpp
test/CodeGen/AArch64/arm64-neon-copy.ll
test/CodeGen/AArch64/arm64-nvcast.ll
test/CodeGen/AMDGPU/insert_vector_elt.ll
test/CodeGen/AMDGPU/local-stack-slot-bug.ll
test/CodeGen/ARM/fp16-promote.ll
test/CodeGen/ARM/vdup.ll
test/CodeGen/Mips/llvm-ir/extractelement.ll
test/CodeGen/PowerPC/variable_elem_vec_extracts.ll
test/CodeGen/X86/extractelement-index.ll
test/CodeGen/X86/extractelement-legalization-store-ordering.ll
test/CodeGen/X86/i64-mem-copy.ll
test/CodeGen/X86/vec_ins_extract-1.ll
test/CodeGen/X86/vec_insert-4.ll
test/CodeGen/X86/vec_insert-8.ll
test/CodeGen/X86/vector-shuffle-variable-128.ll
test/CodeGen/X86/vector-shuffle-variable-256.ll