1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2024-10-21 20:12:56 +02:00
llvm-mirror/test
Jakub Kuderski 25279a5d22 [InstCombine] Insert instructions before adding them to worklist
Summary:
This patch adds instructions to the InstCombine worklist after they are properly inserted. This way we don't get `<badref>`s printed when logging added instructions.
It also adds a check in `Worklist::Add` that ensures that all added instructions have parents.

Simple test case that illustrates the difference when run with `--debug-only=instcombine`:

```
define i32 @test35(i32 %a, i32 %b) {
  %1 = or i32 %a, 1135
  %2 = or i32 %1, %b
  ret i32 %2
}
```

Before this patch:
```
INSTCOMBINE ITERATION #1 on test35
IC: ADDING: 3 instrs to worklist
IC: Visiting:   %1 = or i32 %a, 1135
IC: Visiting:   %2 = or i32 %1, %b
IC: ADD:   %2 = or i32 %a, %b
IC: Old =   %3 = or i32 %1, %b
    New =   <badref> = or i32 %2, 1135
IC: ADD:   <badref> = or i32 %2, 1135
...
```

With this patch:
```
INSTCOMBINE ITERATION #1 on test35
IC: ADDING: 3 instrs to worklist
IC: Visiting:   %1 = or i32 %a, 1135
IC: Visiting:   %2 = or i32 %1, %b
IC: ADD:   %2 = or i32 %a, %b
IC: Old =   %3 = or i32 %1, %b
    New =   <badref> = or i32 %2, 1135
IC: ADD:   %3 = or i32 %2, 1135
...
```

Reviewers: fhahn, davide, spatel, foad, grosser, nikic

Reviewed By: nikic

Subscribers: nikic, lebedev.ri, hiraditya, llvm-commits

Tags: #llvm

Differential Revision: https://reviews.llvm.org/D71093
2019-12-18 14:55:41 -05:00
..
Analysis [AMDGPU] Fixed cost model for packed 16 bit ops 2019-12-17 15:14:17 -08:00
Assembler
Bindings
Bitcode
BugPoint [Bugpoint] Do not create illegal function attribute combos 2019-12-16 10:32:35 -06:00
CodeGen Revert "[AArch64][SVE] Replace integer immediate intrinsics with splat vector variant" 2019-12-18 14:14:10 -05:00
DebugInfo Reapply: [DebugInfo] Correctly handle salvaged casts and split fragments at ISel 2019-12-18 16:26:42 +00:00
Demangle
Examples
ExecutionEngine
Feature This adds constrained intrinsics for the signed and unsigned conversions 2019-12-17 10:06:51 -05:00
FileCheck
Instrumentation hwasan: add tag_offset DWARF attribute to optimized debug info 2019-12-12 16:18:54 -08:00
Integer
JitListener
Linker
LTO [LTO] Support for embedding bitcode section during LTO 2019-12-12 12:34:19 -08:00
MachineVerifier
MC [ MC ] Match labels to existing fragments even when switching sections. 2019-12-18 09:55:54 -08:00
Object [llvm-readelf/llvm-readobj] - Improved the error reporting in a few method related to versioning. 2019-12-10 13:08:18 +03:00
ObjectYAML
Other Revert "[VectorUtils] Introduce the Vector Function Database (VFDatabase)." 2019-12-13 19:42:04 +00:00
Reduce
SafepointIRVerifier
Support
SymbolRewriter
TableGen Revert "Temporarily Revert "[gicombiner] Add the MatchDag structure and parse instruction DAG's from the input"" 2019-12-18 11:37:12 +00:00
ThinLTO/X86 [ThinLTO] Show preserved symbols in DOT files 2019-12-18 18:33:15 +03:00
tools [llvm-exegesis][mips] Add lit test 2019-12-18 10:21:06 +01:00
Transforms [InstCombine] Insert instructions before adding them to worklist 2019-12-18 14:55:41 -05:00
Unit
Verifier Verifier: Check frame-pointer attribute values 2019-12-11 19:53:49 +05:30
YAMLParser
.clang-format
CMakeLists.txt [cmake] Add llvm-locstats to LLVM_TEST_DEPENDS 2019-12-18 09:54:21 +01:00
lit.cfg.py
lit.site.cfg.py.in
TestRunner.sh