llvm-6502/lib/IR
Pawel Bylica 59764b94a7 Constfold insertelement to undef when index is out-of-bounds
Summary:
This patch adds constant folding of insertelement instruction to undef value when index operand is constant and is not less than vector size or is undef.

InstCombine does not support this case, but I'm happy to add it there also if this change is accepted.

Test Plan: Unittests and regression tests for ConstProp pass.

Reviewers: majnemer

Reviewed By: majnemer

Subscribers: llvm-commits

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@235854 91177308-0d34-0410-b5e6-96231b3b80d8
2015-04-27 09:30:49 +00:00
..
AsmWriter.cpp IR: Add assembly/bitcode support for function metadata attachments 2015-04-24 22:04:41 +00:00
AttributeImpl.h [IR] Introduce a dereferenceable_or_null(N) attribute. 2015-04-16 20:29:50 +00:00
Attributes.cpp [IR] Introduce a dereferenceable_or_null(N) attribute. 2015-04-16 20:29:50 +00:00
AutoUpgrade.cpp [opaque pointer type] Verifier/AutoUpgrade: Remove a few uses of PointerType::getElementType 2015-04-24 21:16:07 +00:00
BasicBlock.cpp Return iterator from BasicBlock::eraseFromParent 2015-04-03 01:20:33 +00:00
CMakeLists.txt uselistorder: Remove the global bits 2015-04-15 03:14:06 +00:00
Comdat.cpp
ConstantFold.cpp Constfold insertelement to undef when index is out-of-bounds 2015-04-27 09:30:49 +00:00
ConstantFold.h
ConstantRange.cpp [ConstantRange] Split makeICmpRegion in two. 2015-03-18 00:41:24 +00:00
Constants.cpp IR: Add ConstantFP::getNaN() 2015-04-20 19:38:24 +00:00
ConstantsContext.h Removing LLVM_DELETED_FUNCTION, as MSVC 2012 was the last reason for requiring the macro. NFC; LLVM edition. 2015-02-15 22:54:22 +00:00
Core.cpp Add the i128 builtin type to LLVM. 2015-04-17 15:32:15 +00:00
DataLayout.cpp COFF: Let globals with private linkage reside in their own section 2015-03-17 23:54:51 +00:00
DebugInfo.cpp DebugInfo: Remove DIArray and DITypeArray typedefs 2015-04-21 20:07:38 +00:00
DebugInfoMetadata.cpp DebugInfo: Remove 'inlinedAt:' field from MDLocalVariable 2015-04-15 22:29:27 +00:00
DebugLoc.cpp DebugInfo: Delete subclasses of DIScope 2015-04-20 22:10:08 +00:00
DiagnosticInfo.cpp DebugInfo: Gut DILocation 2015-04-14 01:35:55 +00:00
DiagnosticPrinter.cpp
DIBuilder.cpp DebugInfo: Remove DIArray and DITypeArray typedefs 2015-04-21 20:07:38 +00:00
Dominators.cpp
Function.cpp IR: Add Function metadata attachments 2015-04-24 21:51:02 +00:00
GCOV.cpp Remove more superfluous .str() and replace std::string concatenation with Twine. 2015-03-30 15:42:36 +00:00
Globals.cpp Remove getDataLayout() from Instruction/GlobalValue/BasicBlock/Function 2015-03-03 22:01:13 +00:00
GVMaterializer.cpp
InlineAsm.cpp Silence sign compare warning. NFC. 2015-03-29 20:49:03 +00:00
Instruction.cpp Return iterator from Instruction::eraseFromParent. 2015-04-02 00:03:07 +00:00
Instructions.cpp Recommit r235458: [opaque pointer type] Avoid using PointerType::getElementType for a few cases of CallInst 2015-04-23 21:36:23 +00:00
IntrinsicInst.cpp
IRBuilder.cpp [opaque pointer type] More GEP IRBuilder API migrations... 2015-04-03 21:33:42 +00:00
IRPrintingPasses.cpp uselistorder: Pull the bit through PrintModulePass 2015-04-15 02:38:06 +00:00
LegacyPassManager.cpp Use 'override/final' instead of 'virtual' for overridden methods 2015-04-11 02:11:45 +00:00
LLVMBuild.txt
LLVMContext.cpp
LLVMContextImpl.cpp Add the i128 builtin type to LLVM. 2015-04-17 15:32:15 +00:00
LLVMContextImpl.h IR: Add Function metadata attachments 2015-04-24 21:51:02 +00:00
Makefile
Mangler.cpp Revert "Address review comments" 2015-03-17 20:40:21 +00:00
MDBuilder.cpp [IC] Turn non-null MD on pointer loads to range MD on integer loads. 2015-02-25 05:10:25 +00:00
Metadata.cpp IR: Add Function metadata attachments 2015-04-24 21:51:02 +00:00
MetadataImpl.h
MetadataTracking.cpp
Module.cpp Be lazy about loading metadata in IRObjectFile. 2015-03-13 21:54:20 +00:00
module.modulemap
Pass.cpp
PassManager.cpp
PassRegistry.cpp Revert r231276 (including r231277): Add a lock() function in PassRegistry to speed up multi-thread synchronization. 2015-03-05 17:53:00 +00:00
Statepoint.cpp Add invoke related functionality into StatepointSite classes. 2015-02-19 11:02:11 +00:00
SymbolTableListTraitsImpl.h
Type.cpp Add the i128 builtin type to LLVM. 2015-04-17 15:32:15 +00:00
TypeFinder.cpp Fix Value dangling reference debug output 2015-03-10 23:55:38 +00:00
Use.cpp
User.cpp
Value.cpp Move Value.isDereferenceablePointer to ValueTracking [NFC] 2015-04-23 17:36:48 +00:00
ValueSymbolTable.cpp
ValueTypes.cpp Add support for v1i128 type. 2015-04-17 16:11:05 +00:00
Verifier.cpp Verifier: Function metadata attachments require a body 2015-04-24 21:53:27 +00:00