llvm-project/llvm/test
Jinsong Ji 0776da5236 [PeepholeOptimizer] Don't assume bitcast def always has input
Summary:
If we have a MI marked with bitcast bits, but without input operands,
PeepholeOptimizer might crash with assert.

eg:
If we apply the changes in PPCInstrVSX.td as in this patch:

[(set v4i32:$XT, (bitconvert (v16i8 immAllOnesV)))]>;

We will get assert in PeepholeOptimizer.

```
llvm-lit llvm-project/llvm/test/CodeGen/PowerPC/build-vector-tests.ll -v

llvm-project/llvm/include/llvm/CodeGen/MachineInstr.h:417: const
llvm::MachineOperand &llvm::MachineInstr::getOperand(unsigned int)
const: Assertion `i < getNumOperands() && "getOperand() out of range!"'
failed.
```

The fix is to abort if we found out of bound access.

Reviewers: qcolombet, MatzeB, hfinkel, arsenm

Reviewed By: qcolombet

Subscribers: wdng, arsenm, steven.zhang, wuzish, nemanjai, hiraditya, kbarton, MaskRay, llvm-commits

Tags: #llvm

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

llvm-svn: 369261
2019-08-19 14:19:04 +00:00
..
Analysis [ARM] MVE sext costs 2019-08-19 09:13:22 +00:00
Assembler [DataLayout] Check StackNatural and FunctionPtr alignments. 2019-08-07 17:20:55 +00:00
Bindings Revert "Expose TailCallKind via the LLVM C API" 2019-08-15 03:49:51 +00:00
Bitcode [Intrinsics] Add a 'NoAlias' intrinsic property; annotate llvm.memcpy 2019-08-14 08:33:07 +00:00
BugPoint
CodeGen [PeepholeOptimizer] Don't assume bitcast def always has input 2019-08-19 14:19:04 +00:00
DebugInfo [DebugInfo] Make postra sinking of DBG_VALUEs subregister-safe 2019-08-19 09:53:07 +00:00
Demangle
Examples
ExecutionEngine [ORC] Refactor definition-generation, add a generator for static libraries. 2019-08-13 16:05:18 +00:00
Feature IR: print value numbers for unnamed function arguments 2019-08-03 14:28:34 +00:00
FileCheck [FileCheck] Move -dump-input diagnostic to first line 2019-08-14 02:56:09 +00:00
Instrumentation hwasan: Instrument globals. 2019-08-06 22:07:29 +00:00
Integer
JitListener
LTO [MC] Don't emit .symver redirected symbols to the symbol table 2019-08-19 06:17:30 +00:00
Linker IR: print value numbers for unnamed function arguments 2019-08-03 14:28:34 +00:00
MC [RISCV] Don't force absolute FK_Data_X fixups to relocs 2019-08-19 13:23:02 +00:00
MachineVerifier [GlobalISel]: Fix lowering of G_SHUFFLE_VECTOR with scalar sources 2019-08-13 21:49:11 +00:00
Object Recommit r369190 "[llvm-readobj/llvm-readelf] - Improve/cleanup the error reporting API." 2019-08-17 16:07:18 +00:00
ObjectYAML
Other [BuildLibCalls] Noalias annotation 2019-08-14 16:50:06 +00:00
Reduce [Bugpoint redesign] Added Pass to Remove Global Variables 2019-08-15 22:54:09 +00:00
SafepointIRVerifier
Support
SymbolRewriter
TableGen MVT: Add v3i16/v3f16 vectors 2019-08-15 18:58:25 +00:00
ThinLTO/X86 [NewPM][PassInstrumentation] Fix test added in r369024. 2019-08-15 23:24:14 +00:00
Transforms [SLP] add test that requires shuffle of scalars; NFC 2019-08-19 12:41:09 +00:00
Unit
Verifier IR: Disable verifier check for GlobalValues with private linkage named after a comdat for non-COFF. 2019-08-06 21:47:18 +00:00
YAMLParser
tools Revert r369230 and r369231 2019-08-19 06:45:48 +00:00
.clang-format
CMakeLists.txt Added Delta IR Reduction Tool 2019-08-08 22:16:33 +00:00
TestRunner.sh
lit.cfg.py
lit.site.cfg.py.in