1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2024-11-23 11:13:28 +01:00
llvm-mirror/lib
Jinsong Ji af77a2caf6 [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 [CaptureTracking] Allow null to be in either icmp operand 2019-08-16 21:53:49 +00:00
AsmParser [llvm] Migrate llvm::make_unique to std::make_unique 2019-08-15 15:54:37 +00:00
BinaryFormat [Dwarf] Complete the list of type tags. 2019-08-13 17:00:54 +00:00
Bitcode [llvm] Migrate llvm::make_unique to std::make_unique 2019-08-15 15:54:37 +00:00
Bitstream [Bitcode] Move Bitstream to a separate library 2019-07-03 22:40:07 +00:00
CodeGen [PeepholeOptimizer] Don't assume bitcast def always has input 2019-08-19 14:19:04 +00:00
DebugInfo Remove the temporary code. NFC. 2019-08-16 03:40:04 +00:00
Demangle llvm-undname: Correctly demangle vararg parameters 2019-06-04 19:10:08 +00:00
ExecutionEngine [ORC] Remove some stray debugging output accidentally left in r368707 2019-08-16 19:33:37 +00:00
Fuzzer
FuzzMutate [llvm] Migrate llvm::make_unique to std::make_unique 2019-08-15 15:54:37 +00:00
IR Link libpthread into LLVMCore.so 2019-08-15 18:06:30 +00:00
IRReader
LineEditor [CMake] Delete redundant DEPENDS/LINK_LIBS from LineEditor/XRay 2019-06-22 01:50:21 +00:00
Linker Linker: Add support for GlobalIFunc. 2019-08-08 22:09:18 +00:00
LTO [NewPM][PassInstrumentation] IR printing support for (Thin)LTO 2019-08-15 17:47:44 +00:00
MC [MC] Simplify ELFObjectWriter::recordRelocation. NFC 2019-08-19 10:05:59 +00:00
MCA [llvm] Migrate llvm::make_unique to std::make_unique 2019-08-15 15:54:37 +00:00
Object [BPF] Fix bpf llvm-objdump issues. 2019-08-17 22:12:00 +00:00
ObjectYAML [llvm] Migrate llvm::make_unique to std::make_unique 2019-08-15 15:54:37 +00:00
Option [llvm] Migrate llvm::make_unique to std::make_unique 2019-08-15 15:54:37 +00:00
Passes Title: Loop Cache Analysis 2019-08-09 13:56:29 +00:00
ProfileData [llvm] Migrate llvm::make_unique to std::make_unique 2019-08-15 15:54:37 +00:00
Remarks [llvm] Migrate llvm::make_unique to std::make_unique 2019-08-15 15:54:37 +00:00
Support [RWMutex] Simplify availability check 2019-08-16 21:25:40 +00:00
TableGen [llvm] Migrate llvm::make_unique to std::make_unique 2019-08-15 15:54:37 +00:00
Target [PeepholeOptimizer] Don't assume bitcast def always has input 2019-08-19 14:19:04 +00:00
Testing [Testing] Move clangd::Annotations to llvm testing support 2019-04-25 10:08:31 +00:00
TextAPI [TextAPI] Update reader to be supported by lib/Object 2019-08-16 15:30:48 +00:00
ToolDrivers [llvm-dlltool] Clarify an error message. NFC. 2019-08-02 11:20:03 +00:00
Transforms [SLP] reduce duplicated code; NFC 2019-08-19 11:39:56 +00:00
WindowsManifest [llvm] Migrate llvm::make_unique to std::make_unique 2019-08-15 15:54:37 +00:00
XRay [llvm] Migrate llvm::make_unique to std::make_unique 2019-08-15 15:54:37 +00:00
CMakeLists.txt Fix build errors LLVM tests are disabled. 2019-07-11 22:08:35 +00:00
LLVMBuild.txt [Bitcode] Move Bitstream to a separate library 2019-07-03 22:40:07 +00:00