OSDN Git Service
Lang Hames [Sat, 6 Jan 2018 05:19:06 +0000 (05:19 +0000)]
[ORC] Fix the counter type on SymbolStringPool entries.
Hopefully this will fix the build failure in
http://lab.llvm.org:8011/builders/llvm-mips-linux/builds/3417
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@321926
91177308-0d34-0410-b5e6-
96231b3b80d8
Lang Hames [Sat, 6 Jan 2018 04:35:51 +0000 (04:35 +0000)]
[ORC] More debugging output to track down tester failures.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@321925
91177308-0d34-0410-b5e6-
96231b3b80d8
Lang Hames [Sat, 6 Jan 2018 01:06:07 +0000 (01:06 +0000)]
[ORC] Temporarily adding some redundant asserts / debug output to aid in
debugging a tester failure.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@321920
91177308-0d34-0410-b5e6-
96231b3b80d8
Lang Hames [Sat, 6 Jan 2018 01:06:05 +0000 (01:06 +0000)]
[ORC] Fix a think-o in the current AsynchronousSymbolQuery test.
This *should* be a no-op as far as the current failure is concerned, but needs
to be fixed anyway.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@321919
91177308-0d34-0410-b5e6-
96231b3b80d8
Vedant Kumar [Sat, 6 Jan 2018 00:37:01 +0000 (00:37 +0000)]
[Debugify] Handled unsized types
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@321918
91177308-0d34-0410-b5e6-
96231b3b80d8
Vedant Kumar [Fri, 5 Jan 2018 23:27:02 +0000 (23:27 +0000)]
[Utils] Simplify salvageDebugInfo, NFCI
Having a single call to findDbgUsers() allows salvageDebugInfo() to
return earlier.
Differential Revision: https://reviews.llvm.org/D41787
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@321915
91177308-0d34-0410-b5e6-
96231b3b80d8
Craig Topper [Fri, 5 Jan 2018 23:13:54 +0000 (23:13 +0000)]
[X86] Add vcvtsd2sil/vcvtsd2siq etc. InstAliases to the EVEX-encoded instructions.
This matches their VEX equivalents.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@321912
91177308-0d34-0410-b5e6-
96231b3b80d8
Adrian McCarthy [Fri, 5 Jan 2018 23:01:04 +0000 (23:01 +0000)]
Re-land "Fix faulty assertion in debug info"
This had been reverted because the new test failed on non-X86 bots. I moved
the new test to the appropriate subdirectory to correct this.
Differential Revision: https://reviews.llvm.org/D41264
Original submission: r321122 (which was reverted by r321125)
This reverts commit
3c1639b5703c387a0d8cba2862803b4e68dff436.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@321911
91177308-0d34-0410-b5e6-
96231b3b80d8
Lang Hames [Fri, 5 Jan 2018 22:50:43 +0000 (22:50 +0000)]
[ORC] Re-apply just the AsynchronousSymbolLookup class from r321838 while I
investigate builder / test failures.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@321910
91177308-0d34-0410-b5e6-
96231b3b80d8
Krzysztof Parzyszek [Fri, 5 Jan 2018 22:31:11 +0000 (22:31 +0000)]
[Hexagon] Even simpler patterns for sign- and zero-extending HVX vectors
Recommit r321897 with updated testcases.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@321908
91177308-0d34-0410-b5e6-
96231b3b80d8
Bjorn Pettersson [Fri, 5 Jan 2018 22:20:30 +0000 (22:20 +0000)]
[DebugInfo] Align comments in debug_loc section
Summary:
This commit updates the BufferByteStreamer, used by DebugLocStream
to buffer bytes/comments to put in the debug_loc section, to
make sure that the Buffer and Comments vectors are synced.
Previously, when an SLEB128 or ULEB128 was emitted together with
a comment, the vectors could be out-of-sync if the LEB encoding
added several entries to the Buffer vectors, while we only added
a single entry to the Comments vector.
The goal with this is to get the comments in the debug_loc
section in the .s file correctly aligned.
Example (using ARM as target):
Instead of
.byte 144 @ sub-register DW_OP_regx
.byte 128 @ 256
.byte 2 @ DW_OP_piece
.byte 147 @ 8
.byte 8 @ sub-register DW_OP_regx
.byte 144 @ 257
.byte 129 @ DW_OP_piece
.byte 2 @ 8
.byte 147 @
.byte 8 @
we now get
.byte 144 @ sub-register DW_OP_regx
.byte 128 @ 256
.byte 2 @
.byte 147 @ DW_OP_piece
.byte 8 @ 8
.byte 144 @ sub-register DW_OP_regx
.byte 129 @ 257
.byte 2 @
.byte 147 @ DW_OP_piece
.byte 8 @ 8
Reviewers: JDevlieghere, rnk, aprantl
Reviewed By: aprantl
Subscribers: davide, Ka-Ka, uabelho, aemerson, javed.absar, kristof.beyls, llvm-commits, JDevlieghere
Differential Revision: https://reviews.llvm.org/D41763
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@321907
91177308-0d34-0410-b5e6-
96231b3b80d8
Zachary Turner [Fri, 5 Jan 2018 22:05:13 +0000 (22:05 +0000)]
Fix some opt-viewer test issues and disable on Windows.
Differential Revision: https://reviews.llvm.org/D41784
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@321905
91177308-0d34-0410-b5e6-
96231b3b80d8
Krzysztof Parzyszek [Fri, 5 Jan 2018 21:57:43 +0000 (21:57 +0000)]
Revert r321894: it requires a part of another commit that is not ready yet
Commit message:
[Hexagon] Add patterns for sext_inreg of HVX vector types
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@321904
91177308-0d34-0410-b5e6-
96231b3b80d8
Craig Topper [Fri, 5 Jan 2018 21:57:23 +0000 (21:57 +0000)]
[X86] Add InstAliases for 'vmovd' with GR64 registers to select EVEX encoded instructions as well.
Without this we allow "vmovd %rax, %xmm0", but not "vmovd %rax, %xmm16"
This exists due to continue a silly bug where really old versions of the GNU assembler required movd instead of movq on these instructions. This compatibility hack then crept forward to avx version too, but we didn't propagate it to avx512.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@321903
91177308-0d34-0410-b5e6-
96231b3b80d8
Krzysztof Parzyszek [Fri, 5 Jan 2018 21:50:15 +0000 (21:50 +0000)]
Revert r321897: affected testcases were not updated
Commit message:
[Hexagon] Even simpler patterns for sign- and zero-extending HVX vectors
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@321902
91177308-0d34-0410-b5e6-
96231b3b80d8
Adrian Prantl [Fri, 5 Jan 2018 21:44:17 +0000 (21:44 +0000)]
dwarfdump: Match the --uuid output with that of Darwin dwarfdump.
This option is widely used by scripts and there is no reason to break them.
rdar://problem/
36032398
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@321901
91177308-0d34-0410-b5e6-
96231b3b80d8
Craig Topper [Fri, 5 Jan 2018 20:55:12 +0000 (20:55 +0000)]
[X86] Stop printing moves between VR64 and GR64 with 'movd' mnemonic. Use 'movq' instead.
This behavior existed to work with an old version of the gnu assembler on MacOS that only accepted this form. Newer versions of GNU assembler and the current LLVM derived version of the assembler on MacOS support movq as well.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@321898
91177308-0d34-0410-b5e6-
96231b3b80d8
Krzysztof Parzyszek [Fri, 5 Jan 2018 20:49:26 +0000 (20:49 +0000)]
[Hexagon] Even simpler patterns for sign- and zero-extending HVX vectors
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@321897
91177308-0d34-0410-b5e6-
96231b3b80d8
Krzysztof Parzyszek [Fri, 5 Jan 2018 20:48:03 +0000 (20:48 +0000)]
[Hexagon] Add patterns for truncating HVX vector types
Only non-bool vectors.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@321895
91177308-0d34-0410-b5e6-
96231b3b80d8
Krzysztof Parzyszek [Fri, 5 Jan 2018 20:46:41 +0000 (20:46 +0000)]
[Hexagon] Add patterns for sext_inreg of HVX vector types
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@321894
91177308-0d34-0410-b5e6-
96231b3b80d8
Krzysztof Parzyszek [Fri, 5 Jan 2018 20:45:34 +0000 (20:45 +0000)]
[Hexagon] Add a bitcast to required type in LowerHvxMul
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@321893
91177308-0d34-0410-b5e6-
96231b3b80d8
Krzysztof Parzyszek [Fri, 5 Jan 2018 20:43:56 +0000 (20:43 +0000)]
[Hexagon] Add pattern for vsplat to v8i8
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@321892
91177308-0d34-0410-b5e6-
96231b3b80d8
Krzysztof Parzyszek [Fri, 5 Jan 2018 20:41:50 +0000 (20:41 +0000)]
[Hexagon] Set boolean contents in HexagonISelLowering
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@321891
91177308-0d34-0410-b5e6-
96231b3b80d8
Douglas Yung [Fri, 5 Jan 2018 20:00:18 +0000 (20:00 +0000)]
[llvm-cov] Change test to use FileCheck instead of grep.
Reviewed by Paul Robinson
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@321888
91177308-0d34-0410-b5e6-
96231b3b80d8
Reid Kleckner [Fri, 5 Jan 2018 19:53:51 +0000 (19:53 +0000)]
Fix -Wsign-compare warnings on Windows
These arise because enums are 'int' by default.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@321887
91177308-0d34-0410-b5e6-
96231b3b80d8
Serge Guelton [Fri, 5 Jan 2018 19:41:19 +0000 (19:41 +0000)]
Limit size of non-GlobalValue name
Otherwise, in some extreme test case, very long names are created and the
compiler consumes large amount of memory. Size limit is set to a relatively
high value not to disturb debugging.
Compiler flag -non-global-value-max-name-size=<value> can be used to customize
the size.
Differential Revision: https://reviews.llvm.org/D41296
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@321886
91177308-0d34-0410-b5e6-
96231b3b80d8
Jake Ehrlich [Fri, 5 Jan 2018 19:19:09 +0000 (19:19 +0000)]
[llvm-objcopy] Add --localize-hidden option
This change adds support in llvm-objcopy for GNU objcopy's --localize-hidden
option. This option changes every hidden or internal symbol into a local symbol.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@321884
91177308-0d34-0410-b5e6-
96231b3b80d8
Zachary Turner [Fri, 5 Jan 2018 19:12:40 +0000 (19:12 +0000)]
[PDB] Correctly link S_FILESTATIC records.
This is not a record type that clang currently generates,
but it is a record that is encountered in object files generated
by cl. This record is unusual in that it refers directly to
the string table instead of indirectly to the string table via
the FileChecksums table. Because of this, it was previously
overlooked and we weren't remapping the string indices at all.
This would lead to crashes in MSVC when trying to display a
variable whose debug info involved an S_FILESTATIC.
Original bug report by Alexander Ganea
Differential Revision: https://reviews.llvm.org/D41718
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@321883
91177308-0d34-0410-b5e6-
96231b3b80d8
Sanjay Patel [Fri, 5 Jan 2018 19:01:17 +0000 (19:01 +0000)]
[InstCombine] add folds for min(~a, b) --> ~max(a, b)
Besides the bug of omitting the inverse transform of max(~a, ~b) --> ~min(a, b),
the use checking and operand creation were off. We were potentially creating
repeated identical instructions of existing values. This led to infinite
looping after I added the extra folds.
By using the simpler m_Not matcher and not creating new 'not' ops for a and b,
we avoid that problem. It's possible that not using IsFreeToInvert() here is
more limiting than the simpler matcher, but there are no tests for anything
more exotic. It's also possible that we should relax the use checking further
to handle a case like PR35834:
https://bugs.llvm.org/show_bug.cgi?id=35834
...but we can make that a follow-up if it is needed.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@321882
91177308-0d34-0410-b5e6-
96231b3b80d8
Brian Gesiak [Fri, 5 Jan 2018 18:23:22 +0000 (18:23 +0000)]
[llvm-mt] Remove platform-specific path in test
Summary:
Remove a platform-specific path separator added to the llvm-mt help text test
in https://reviews.llvm.org/D41732.
Test Plan: `check-llvm`
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@321881
91177308-0d34-0410-b5e6-
96231b3b80d8
Zachary Turner [Fri, 5 Jan 2018 18:12:14 +0000 (18:12 +0000)]
[MSF] Fix FPM interval calcluation
We have some code to try to determine how many pieces an MSF
Free Page Map is split into, and this code had an off by one
error which would cause the calculation to be incorrect when
there were exactly 4096*k + 1 blocks in an MSF file.
Original investigation and patch outline by Colden Cullen.
Differential Revision: https://reviews.llvm.org/D41742
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@321880
91177308-0d34-0410-b5e6-
96231b3b80d8
Matt Arsenault [Fri, 5 Jan 2018 17:51:36 +0000 (17:51 +0000)]
RegionInfo: Use report_fatal_error instead of llvm_unreachable
Otherwise when using -verify-region-info in a release build the
error won't be emitted.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@321878
91177308-0d34-0410-b5e6-
96231b3b80d8
Brian Gesiak [Fri, 5 Jan 2018 17:10:39 +0000 (17:10 +0000)]
[Option] Add 'findNearest' method to catch typos
Summary:
Add a method `OptTable::findNearest`, which allows users of OptTable to
check user input for misspelled options. In addition, have llvm-mt
check for misspelled options. For example, if a user invokes
`llvm-mt /oyt:foo`, the error message will indicate that while an
option named `/oyt:` does not exist, `/out:` does.
The method ports the functionality of the `LookupNearestOption` method
from LLVM CommandLine to libLLVMOption. This allows tools like Clang
and Swift, which do not use CommandLine, to use this functionality to
suggest similarly spelled options.
As room for future improvement, the new method as-is cannot yet properly suggest
nearby "joined" options -- that is, for an option string "-FozBar", where
"-Foo" is the correct option name and "Bar" is the value being passed along
with the misspelled option, this method will calculate an edit distance of 4,
by deleting "Bar" and changing "z" to "o". It should instead calculate an edit
distance of just 1, by changing "z" to "o" and recognizing "Bar" as a
value. This commit includes a disabled test that expresses this limitation.
Test Plan: `check-llvm`
Reviewers: yamaguchi, v.g.vassilev, teemperor, ruiu, jroelofs
Reviewed By: jroelofs
Subscribers: jroelofs, llvm-commits
Differential Revision: https://reviews.llvm.org/D41732
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@321877
91177308-0d34-0410-b5e6-
96231b3b80d8
Max Moroz [Fri, 5 Jan 2018 16:43:24 +0000 (16:43 +0000)]
[llvm-cov] Temporarily disable multithreaded-report.test on Windows.
Summary: The test is failing because Windows do not support "diff -r".
Reviewers: Dor1s
Reviewed By: Dor1s
Differential Revision: https://reviews.llvm.org/D41768
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@321876
91177308-0d34-0410-b5e6-
96231b3b80d8
Adrian Prantl [Fri, 5 Jan 2018 16:31:22 +0000 (16:31 +0000)]
add 'REQUIRES: object-emission' to test
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@321875
91177308-0d34-0410-b5e6-
96231b3b80d8
Adrian Prantl [Fri, 5 Jan 2018 16:29:24 +0000 (16:29 +0000)]
remove unnecessary target triple from generic test
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@321874
91177308-0d34-0410-b5e6-
96231b3b80d8
Davide Italiano [Fri, 5 Jan 2018 16:18:47 +0000 (16:18 +0000)]
[BasicAA] Fix linearization of shifts beyond the bitwidth.
Thanks to Simon Pilgrim for the reduced testcase.
Fixes PR35821.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@321873
91177308-0d34-0410-b5e6-
96231b3b80d8
Alexey Bataev [Fri, 5 Jan 2018 16:15:17 +0000 (16:15 +0000)]
[SLP] Update more test checks, NFC.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@321872
91177308-0d34-0410-b5e6-
96231b3b80d8
Max Moroz [Fri, 5 Jan 2018 16:15:07 +0000 (16:15 +0000)]
[llvm-cov] Multi-threaded implementation of prepareFileReports method.
Summary:
Local testing has demonstrated a great speed improvement, compare the following:
1) Existing version:
```
$ time llvm-cov show -format=html -output-dir=report -instr-profile=... ...
The tool has been launched: 00:00:00
Loading coverage data: 00:00:00
Get unique source files: 00:00:33
Creating an index out of the source files: 00:00:34
Going into prepareFileReports: 00:00:34
Going to emit summary information for each file: 00:28:55 <-- 28:21 min!
Going to emit links to files with no function: 00:28:55
Launching 32 threads for generating HTML files: 00:28:55
real 37m43.651s
user 112m5.540s
sys 7m39.872s
```
2) Multi-threaded version with 32 CPUs:
```
$ time llvm-cov show -format=html -output-dir=report -instr-profile=... ...
The tool has been launched: 00:00:00
Loading coverage data: 00:00:00
Get unique source files: 00:00:38
Creating an index out of the source files: 00:00:40
Going into prepareFileReports: 00:00:40
Preparing file reports using 32 threads: 00:00:40
# Creating thread tasks for the following number of files: 16422
Going to emit summary information for each file: 00:01:57 <-- 1:17 min!
Going to emit links to files with no function: 00:01:58
Launching 32 threads for generating HTML files: 00:01:58
real 11m2.044s
user 134m48.124s
sys 7m53.388s
```
Reviewers: vsk, morehouse
Reviewed By: vsk
Subscribers: Dor1s, llvm-commits, kcc
Differential Revision: https://reviews.llvm.org/D41206
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@321871
91177308-0d34-0410-b5e6-
96231b3b80d8
Alexey Bataev [Fri, 5 Jan 2018 15:20:40 +0000 (15:20 +0000)]
[SLP] Update test checks, NFC.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@321870
91177308-0d34-0410-b5e6-
96231b3b80d8
Alexey Bataev [Fri, 5 Jan 2018 14:40:04 +0000 (14:40 +0000)]
[SLP] Update tests checks, NFC.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@321869
91177308-0d34-0410-b5e6-
96231b3b80d8
Simon Pilgrim [Fri, 5 Jan 2018 14:24:03 +0000 (14:24 +0000)]
[X86] Regenerate illegal move test
Recommitting after fixing case-sensitive issue in the RUN command
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@321868
91177308-0d34-0410-b5e6-
96231b3b80d8
Momchil Velikov [Fri, 5 Jan 2018 13:28:10 +0000 (13:28 +0000)]
[ARM] Issue an erorr when non-general-purpose registers are used in address operands
Currently the assembler would accept, e.g. `ldr r0, [s0, #12]` and similar.
This patch add checks that only general-purpose registers are used in address
operands, shifted registers, and shift amounts.
Differential revision: https://reviews.llvm.org/D39910
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@321866
91177308-0d34-0410-b5e6-
96231b3b80d8
Florian Hahn [Fri, 5 Jan 2018 11:17:48 +0000 (11:17 +0000)]
[AArch64] Fix -mcpu option in aarch64-combine-fmul-fsub.mir (NFC)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@321865
91177308-0d34-0410-b5e6-
96231b3b80d8
Jonas Devlieghere [Fri, 5 Jan 2018 10:03:02 +0000 (10:03 +0000)]
[DebugInfo] Don't crash when given invalid DWARFv5 line table prologue.
This patch replaces an assertion with an explicit check for the validity
of the FORM parameters. The assertion was triggered when the DWARFv5
line table contained a zero address size.
This fixes OSS-Fuzz Issue 4644
https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=4644
Differential revision: https://reviews.llvm.org/D41615
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@321863
91177308-0d34-0410-b5e6-
96231b3b80d8
Sam Parker [Fri, 5 Jan 2018 08:47:23 +0000 (08:47 +0000)]
[DAGCombine] Fix for PR37563
While searching for loads to be narrowed, equal sized loads were not
added to the list, resulting in anyext loads not being converted to
zext loads.
https://bugs.llvm.org/show_bug.cgi?id=35763
Differential Revision: https://reviews.llvm.org/D41628
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@321862
91177308-0d34-0410-b5e6-
96231b3b80d8
Lang Hames [Fri, 5 Jan 2018 03:10:15 +0000 (03:10 +0000)]
[ORC] Re-revert r321838: Tests are still failing.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@321858
91177308-0d34-0410-b5e6-
96231b3b80d8
Aditya Nandakumar [Fri, 5 Jan 2018 02:56:28 +0000 (02:56 +0000)]
[GISel]: Don't create G_MUL with 1 during translation of GEP
When element size is 1, it's just wasteful to create MUL with 1.
https://reviews.llvm.org/D41738
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@321857
91177308-0d34-0410-b5e6-
96231b3b80d8
Lang Hames [Fri, 5 Jan 2018 02:21:02 +0000 (02:21 +0000)]
[ORC] Re-apply r321838 - Addition of new ORC core APIs.
The original commit broke the builders due to a think-o in an assertion:
AsynchronousSymbolQuery's constructor needs to check the callback member
variables, not the constructor arguments.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@321853
91177308-0d34-0410-b5e6-
96231b3b80d8
Adrian Prantl [Fri, 5 Jan 2018 01:13:37 +0000 (01:13 +0000)]
Debug Info: Support DW_AT_calling_convention on composite types.
This implements the DWARF 5 feature described at
http://www.dwarfstd.org/ShowIssue.php?issue=141215.1
This allows a consumer to understand whether a composite data type is
trivially copyable and thus should be passed by value instead of by
reference. The canonical example is being able to distinguish the
following two types:
// S is not trivially copyable because of the explicit destructor.
struct S {
~S() {}
};
// T is a POD type.
struct T {
~T() = default;
};
This patch adds two new (DI)flags to LLVM metadata: TypePassByValue
and TypePassByReference.
<rdar://problem/
36034922>
Differential Revision: https://reviews.llvm.org/D41743
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@321844
91177308-0d34-0410-b5e6-
96231b3b80d8
Lang Hames [Fri, 5 Jan 2018 00:29:37 +0000 (00:29 +0000)]
Revert r321838 -- It broke some of the builders.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@321842
91177308-0d34-0410-b5e6-
96231b3b80d8
Peter Collingbourne [Fri, 5 Jan 2018 00:27:51 +0000 (00:27 +0000)]
WholeProgramDevirt: Simplify ORE getter mechanism for old PM. NFCI.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@321841
91177308-0d34-0410-b5e6-
96231b3b80d8
Tim Hammerquist [Fri, 5 Jan 2018 00:24:55 +0000 (00:24 +0000)]
remove unreferenced footnotes
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@321840
91177308-0d34-0410-b5e6-
96231b3b80d8
Tim Hammerquist [Fri, 5 Jan 2018 00:24:54 +0000 (00:24 +0000)]
fix invalid footnote syntax
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@321839
91177308-0d34-0410-b5e6-
96231b3b80d8
Lang Hames [Fri, 5 Jan 2018 00:04:16 +0000 (00:04 +0000)]
[ORC] Add new core ORC APIs (Core.h/Core.cpp): VSO, AsynchronousSymbolQuery and
SymbolSource.
These new APIs are a first stab at tackling some current shortcomings of ORC,
especially in performance and threading support.
VSO (Virtual Shared Object) is a symbol table representing the symbol
definitions of a set of modules that behave as if they had been statically
linked together into a shared object or dylib. Symbol definitions, either
pre-defined addresses or lazy definitions, can be added and queries for symbol
addresses made. The table applies the same linkage strength rules that static
linkers do when constructing a dylib or shared object: duplicate definitions
result in errors, strong definitions override weak or common ones. This class
should improve symbol lookup speed by providing centralized symbol tables (as
compared to the findSymbol implementation in the in-tree ORC layers, which
maintain one symbol table per object file / module added).
AsynchronousSymbolQuery is a query for the addresses of a set of symbols.
Query results are returned via a callback once they become available. Querying
for a set of symbols, rather than one symbol at a time (as the current lookup
scheme does) the JIT has the opportunity to make better use of available
resources (e.g. by spawning multiple jobs to materialize the requested symbols
if possible). Returning results via a callback makes queries asynchronous, so
queries from multiple threads of JIT'd code can proceed simultaneously.
SymbolSource represents a source of symbol definitions. It is used when
adding lazy symbol definitions to a VSO. Symbol definitions can be materialized
when needed or discarded if a stronger definition is found. Materializing on
demand via SymbolSources should (eventually) allow us to remove the lazy
materializers from JITSymbol, which will in turn allow the removal of many
current error checks and reduce the number of RPC round-trips involved in
materializing remote symbols. Adding a discard function allows sources to
discard symbol definitions (or mark them as available_externally), reducing the
amount of redundant code generated by the JIT for ODR symbols.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@321838
91177308-0d34-0410-b5e6-
96231b3b80d8
Lang Hames [Fri, 5 Jan 2018 00:04:15 +0000 (00:04 +0000)]
[ORC] Actually compare pointer values as advertised (rather than comparing ref
counts). Oops.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@321837
91177308-0d34-0410-b5e6-
96231b3b80d8
Lang Hames [Fri, 5 Jan 2018 00:04:13 +0000 (00:04 +0000)]
[ORC] Add dereference operator to SymbolStringPtr.
Dereference yields a StringRef.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@321836
91177308-0d34-0410-b5e6-
96231b3b80d8
Alexey Bataev [Thu, 4 Jan 2018 23:50:24 +0000 (23:50 +0000)]
[DEBUG] Fix debug info test for NVPTX, NFC.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@321835
91177308-0d34-0410-b5e6-
96231b3b80d8
Reid Kleckner [Thu, 4 Jan 2018 23:23:46 +0000 (23:23 +0000)]
Revert "[JumpThreading] Preservation of DT and LVI across the pass"
This reverts r321825, it causes crashes in Chromium. Reproducer
forthcoming.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@321832
91177308-0d34-0410-b5e6-
96231b3b80d8
Alexey Bataev [Thu, 4 Jan 2018 23:01:42 +0000 (23:01 +0000)]
[DEBUG] Fix the test for NVPTX, NFC.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@321829
91177308-0d34-0410-b5e6-
96231b3b80d8
Simon Pilgrim [Thu, 4 Jan 2018 22:08:36 +0000 (22:08 +0000)]
[X86] Add srem/udiv/urem by one combine tests
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@321826
91177308-0d34-0410-b5e6-
96231b3b80d8
Brian M. Rzycki [Thu, 4 Jan 2018 21:57:32 +0000 (21:57 +0000)]
[JumpThreading] Preservation of DT and LVI across the pass
Summary:
See D37528 for a previous (non-deferred) version of this
patch and its description.
Preserves dominance in a deferred manner using a new class
DeferredDominance. This reduces the performance impact of
updating the DominatorTree at every edge insertion and
deletion. A user may call DDT->flush() within JumpThreading
for an up-to-date DT. This patch currently has one flush()
at the end of runImpl() to ensure DT is preserved across
the pass.
LVI is also preserved to help subsequent passes such as
CorrelatedValuePropagation. LVI is simpler to maintain and
is done immediately (not deferred). The code to perfom the
preversation was minimally altered and was simply marked
as preserved for the PassManager to be informed.
This extends the analysis available to JumpThreading for
future enhancements. One example is loop boundary threading.
Reviewers: dberlin, kuhar, sebpop
Reviewed By: kuhar, sebpop
Subscribers: hiraditya, llvm-commits
Differential Revision: https://reviews.llvm.org/D40146
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@321825
91177308-0d34-0410-b5e6-
96231b3b80d8
Evandro Menezes [Thu, 4 Jan 2018 21:43:12 +0000 (21:43 +0000)]
[AArch64] Improve code generation of vector build
Instead of using, for example, `dup v0.4s, wzr`, which transfers between
register files, use the more efficient `movi v0.4s, #0` instead.
Differential revision: https://reviews.llvm.org/D41515
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@321824
91177308-0d34-0410-b5e6-
96231b3b80d8
Simon Pilgrim [Thu, 4 Jan 2018 21:33:19 +0000 (21:33 +0000)]
[X86] Add scalar undef sdiv/srem/udiv/urem combine tests
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@321823
91177308-0d34-0410-b5e6-
96231b3b80d8
Alexey Bataev [Thu, 4 Jan 2018 21:07:07 +0000 (21:07 +0000)]
[DEBUG] Add initial tests for debug info for NVPTX target, NFC.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@321822
91177308-0d34-0410-b5e6-
96231b3b80d8
Craig Topper [Thu, 4 Jan 2018 20:56:21 +0000 (20:56 +0000)]
[X86] Correct the execution domain for AVX1 VBROADCASTF128 to be FP instead of integer.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@321821
91177308-0d34-0410-b5e6-
96231b3b80d8
Amara Emerson [Thu, 4 Jan 2018 20:20:44 +0000 (20:20 +0000)]
Revert "[X86] Regenerate test"
This reverts r321814 as it was failing make check.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@321819
91177308-0d34-0410-b5e6-
96231b3b80d8
Max Moroz [Thu, 4 Jan 2018 19:33:29 +0000 (19:33 +0000)]
[llvm-cov] Refactor "export" command implementation and add support for SOURCES.
Summary: Define an interface for Exporter + split JSON exporter into .h and .cpp.
Reviewers: vsk, morehouse
Reviewed By: vsk
Subscribers: llvm-commits, Dor1s, kcc
Differential Revision: https://reviews.llvm.org/D41600
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@321815
91177308-0d34-0410-b5e6-
96231b3b80d8
Simon Pilgrim [Thu, 4 Jan 2018 18:48:42 +0000 (18:48 +0000)]
[X86] Regenerate test
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@321814
91177308-0d34-0410-b5e6-
96231b3b80d8
Amara Emerson [Thu, 4 Jan 2018 18:38:45 +0000 (18:38 +0000)]
[DAGCombine] Ensure SDNode use iterator is incremented properly.
Fixes an ASAN bug found by oss-fuzz.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@321813
91177308-0d34-0410-b5e6-
96231b3b80d8
Kostya Kortchinsky [Thu, 4 Jan 2018 18:31:22 +0000 (18:31 +0000)]
[docs] Update Scudo documentation
Summary:
The documentation has fallen a bit behind, update it with the latest evolution
of the allocator:
- clarify a couple of expectations regarding what is meant to be achieved;
- update the header format;
- document `-fsanitize=scudo`.
Reviewers: alekseyshl, flowerhack
Reviewed By: alekseyshl
Subscribers: llvm-commits
Differential Revision: https://reviews.llvm.org/D41670
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@321811
91177308-0d34-0410-b5e6-
96231b3b80d8
Simon Pilgrim [Thu, 4 Jan 2018 18:23:46 +0000 (18:23 +0000)]
[X86] Add common CHECK prefix for tests without SSE/AVX codegen
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@321810
91177308-0d34-0410-b5e6-
96231b3b80d8
Bjorn Pettersson [Thu, 4 Jan 2018 18:23:40 +0000 (18:23 +0000)]
Teach InlineCost about address spaces
Summary:
I basically copied this patch from here:
https://reviews.llvm.org/D1251
But I skipped some of the refactoring to make the patch more clean.
The new outer3/inner3 test case in ptr-diff.ll triggers the
following assert without this patch:
lib/IR/Constants.cpp:1834: static llvm::Constant *llvm::ConstantExpr::getCompare(unsigned short, llvm::Constant *, llvm::Constant *, bool): Assertion `C1->getType() == C2->getType() && "Op types should be identical!"' failed.
The other new test cases makes sure that there is code coverage
for all modifications in InlineCost.cpp (getting different values
due to not fetching sizes for address space zero). I only guarantee
code coverage for those tests. The tests are not written in a way
that they would break if not having the corrections in
InlineCost.cpp. I found it quite hard to fine tune the tests into
getting different results based on the pointer sizes (except for
the test case where we hit an assert if not teaching InlineCost
about address spaces).
Reviewers: chandlerc, arsenm, haicheng
Reviewed By: arsenm
Subscribers: wdng, eraman, llvm-commits, haicheng
Differential Revision: https://reviews.llvm.org/D40455
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@321809
91177308-0d34-0410-b5e6-
96231b3b80d8
Simon Pilgrim [Thu, 4 Jan 2018 18:21:33 +0000 (18:21 +0000)]
Regenerate broadcast constant comment
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@321808
91177308-0d34-0410-b5e6-
96231b3b80d8
Simon Pilgrim [Thu, 4 Jan 2018 18:20:46 +0000 (18:20 +0000)]
[X86] Show missed combine for X/X for SDIV/UDIV and X%X for SREM/UREM
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@321807
91177308-0d34-0410-b5e6-
96231b3b80d8
Matt Arsenault [Thu, 4 Jan 2018 17:23:24 +0000 (17:23 +0000)]
StructurizeCFG: xfail one of the testcases from r321751
It fails with -verify-region-info. This seems to be a issue
with RegionInfo itself which existed before.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@321806
91177308-0d34-0410-b5e6-
96231b3b80d8
Anna Thomas [Thu, 4 Jan 2018 17:21:15 +0000 (17:21 +0000)]
Add assertion on DT availability during LI update in UpdateAnalysisInformation
This came up during discussions in llvm-commits for
rL321653: Check for unreachable preds before updating LI in
UpdateAnalysisInformation
The assert provides hints to passes to require both DT and LI if we plan on
updating LI through this function.
Tests run: make check
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@321805
91177308-0d34-0410-b5e6-
96231b3b80d8
Florian Hahn [Thu, 4 Jan 2018 17:12:21 +0000 (17:12 +0000)]
[Docs] Add Contributing page.
This new page acts as an entry point for (new) contributors to LLVM and
provides information about
* What to contribute
* How to submit a patch
* Where to start to learn more about LLVM's architecture and internals.
This version of the page duplicates some information from the
DeveloperPolicy and Phabricator pages. Subsequent changes should work
towards moving information for new developers to this page, where it
makes sense.
Reviewers: reames, probinson, kristof.beyls, silvas, rengolin, asb
Reviewed By: silvas
Differential Revision: https://reviews.llvm.org/D41665
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@321804
91177308-0d34-0410-b5e6-
96231b3b80d8
Sanjay Patel [Thu, 4 Jan 2018 14:31:56 +0000 (14:31 +0000)]
[InstCombine] safely create a constant of the right type (PR35794)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@321801
91177308-0d34-0410-b5e6-
96231b3b80d8
Oliver Stannard [Thu, 4 Jan 2018 13:56:40 +0000 (13:56 +0000)]
[ARM] Fix endianness of Thumb .inst.w directive
Wide Thumb2 instructions should be emitted into the object file as pairs of
16-bit words of the appropriate endianness, not one 32-bit word.
Differential revision: https://reviews.llvm.org/D41185
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@321799
91177308-0d34-0410-b5e6-
96231b3b80d8
Krzysztof Parzyszek [Thu, 4 Jan 2018 13:56:04 +0000 (13:56 +0000)]
[Hexagon] Replace INSERTRP/EXTRACTRP with INSERT/EXTRACT in HexagonISD
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@321798
91177308-0d34-0410-b5e6-
96231b3b80d8
Diana Picus [Thu, 4 Jan 2018 13:09:25 +0000 (13:09 +0000)]
[ARM GlobalISel] Select G_PHI
Select G_PHI to PHI and manually constrain the result register. This is
very similar to how COPY is handled, so extract and reuse some of that
code.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@321797
91177308-0d34-0410-b5e6-
96231b3b80d8
Diana Picus [Thu, 4 Jan 2018 13:09:20 +0000 (13:09 +0000)]
[ARM GlobalISel] Add RegBankSelect tests for G_PHI
RegBankSelect already handles G_PHI with some generic code. Add a couple
of tests for it.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@321796
91177308-0d34-0410-b5e6-
96231b3b80d8
Diana Picus [Thu, 4 Jan 2018 13:09:14 +0000 (13:09 +0000)]
[ARM GlobalISel] Legalize scalar G_PHI
Mark G_PHI as Legal for s32 and p0, and also for s64 if we have hard
float. Widen any smaller types.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@321795
91177308-0d34-0410-b5e6-
96231b3b80d8
Diana Picus [Thu, 4 Jan 2018 10:54:57 +0000 (10:54 +0000)]
[ARM GlobalISel] Fix selection of pointer constants
We used to handle G_CONSTANT with pointer type by forcing the type of
the result register to s32 and then letting TableGen handle it.
Unfortunately, setting the type only works for generic virtual
registers, that haven't yet been constrained to a register class (e.g.
those used only by a COPY later on). If the result register has already
been constrained as a use of a previously selected instruction, then
setting the type will assert.
It would be nice to be able to teach TableGen to select pointer
constants the same as integer constants, but since it's such an edge
case (at the moment the only pointer constant that we're generally
interested in is 0, and that is mostly used for comparisons and selects,
which are also not supported by TableGen) it's probably not worth the
effort right now. Instead, handle pointer constants with some trivial
handwritten code.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@321793
91177308-0d34-0410-b5e6-
96231b3b80d8
Nikolai Bozhenov [Thu, 4 Jan 2018 10:02:50 +0000 (10:02 +0000)]
[ValueTracking] Adding missed lit-test for commit r316208
Reviewers: reames, hfinkel
Differential Revision: https://reviews.llvm.org/D34101
Patch by: Olga Chupina <olga.chupina@intel.com>
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@321792
91177308-0d34-0410-b5e6-
96231b3b80d8
Sam Parker [Thu, 4 Jan 2018 09:42:27 +0000 (09:42 +0000)]
[X86] Codegen test for PR37563
Adding test to ease review of D41628.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@321791
91177308-0d34-0410-b5e6-
96231b3b80d8
Aditya Kumar [Thu, 4 Jan 2018 07:47:24 +0000 (07:47 +0000)]
[GVNHoist] Fix: PR35222 gvn-hoist incorrectly erases load in case of a loop
Reviewers:
dberlin
sebpop
eli.friedman
Differential Revision: https://reviews.llvm.org/D41453
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@321789
91177308-0d34-0410-b5e6-
96231b3b80d8
Elena Demikhovsky [Thu, 4 Jan 2018 07:08:45 +0000 (07:08 +0000)]
Changes in the branch relaxation algorithm.
The existing version worked incorrectly when inversion of a branch condintion is impossible.
Changed the "fixupConditionalBranch()" function - a new BB (a trampoline) is created to keep the original branch condition.
Differential Revision: https://reviews.llvm.org/D41634
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@321785
91177308-0d34-0410-b5e6-
96231b3b80d8
Bob Wilson [Thu, 4 Jan 2018 05:04:41 +0000 (05:04 +0000)]
Remove the unit test from r321783.
This test fails when run on the sanitizer bot, and I do not see a good
way to fix it. The existing bogus target in MachineInstrTest.cpp is only
good enough to create instructions but not sufficient to insert them into
basic blocks. The addNodeToList ilist callback dereferences the pointer
to the MachineRegisterInfo. Adding MachineRegisterInfo would also require
TargetRegisterInfo, even a minimal implementation of that would be quite
complicated. I would be glad to add this back if someone can suggest a
better way to do it.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@321784
91177308-0d34-0410-b5e6-
96231b3b80d8
Bob Wilson [Thu, 4 Jan 2018 02:58:15 +0000 (02:58 +0000)]
support phi ranges for machine-level IR
Add iterator ranges for machine instruction phis, similar to the IR-level
phi ranges added in r303964. I updated a few places to use this. Besides
general code simplification, this change will allow removing a non-upstream
change from Swift's copy of LLVM (in a better way than my previous attempt
in http://reviews.llvm.org/D19080).
https://reviews.llvm.org/D41672
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@321783
91177308-0d34-0410-b5e6-
96231b3b80d8
Michael Trent [Wed, 3 Jan 2018 23:28:32 +0000 (23:28 +0000)]
Do not look up symbol names when n_strx == 0
Summary:
Historical tools for working with mach-o binaries verify the nlist field
n_strx has a non-zero value before using that value to retrieve symbol names.
Under some cirumstances, llvm-nm will attempt to display the symbol name at
position 0, even though symbol names at that position are not well defined.
This change addresses this problem by returning an empty string when n_strx
is zero.
rdar://problem/
35750548
Reviewers: enderby, davide
Reviewed By: enderby, davide
Subscribers: davide, llvm-commits, JDevlieghere
Differential Revision: https://reviews.llvm.org/D41657
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@321773
91177308-0d34-0410-b5e6-
96231b3b80d8
Simon Pilgrim [Wed, 3 Jan 2018 22:42:33 +0000 (22:42 +0000)]
[DAGCombine] Handle out of range EXTRACT_VECTOR_ELT indices
Handle this in DAGCombiner::visitEXTRACT_VECTOR_ELT the same as we already do in SelectionDAG::getNode and use APInt instead of getZExtValue.
This should also fix oss-fuzz #4910
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@321767
91177308-0d34-0410-b5e6-
96231b3b80d8
Philip Reames [Wed, 3 Jan 2018 22:28:26 +0000 (22:28 +0000)]
[PRE] Add a bunch of test cases for LICM-like PRE patterns
These were inspired by a very old review I'm about to abandon (https://reviews.llvm.org/D7061). Several of the test cases from that worked without modification and expanding test coverage of such cases is always worthwhile.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@321764
91177308-0d34-0410-b5e6-
96231b3b80d8
Francis Visoiu Mistrih [Wed, 3 Jan 2018 20:56:29 +0000 (20:56 +0000)]
[CodeGen][NFC] Remove unused function declaration
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@321758
91177308-0d34-0410-b5e6-
96231b3b80d8
Sanjay Patel [Wed, 3 Jan 2018 20:02:39 +0000 (20:02 +0000)]
[ExpandMemcmp] rename variables and add hook to override pref for number of loads per block; NFC
The preference only applies to 'memcmp() == 0' expansion, so try to make that clearer.
x86 will likely benefit by increasing the default value from '1' to '2' as seen in PR33325:
https://bugs.llvm.org/show_bug.cgi?id=33325
...so that is the planned follow-up to this clean-up step.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@321756
91177308-0d34-0410-b5e6-
96231b3b80d8
Craig Topper [Wed, 3 Jan 2018 19:15:43 +0000 (19:15 +0000)]
[X86] Remove 'else' after 'return' I forgot to cleanup before committing D41691.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@321755
91177308-0d34-0410-b5e6-
96231b3b80d8
Matt Arsenault [Wed, 3 Jan 2018 18:51:22 +0000 (18:51 +0000)]
Fix missing release metabug in merge-request.sh
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@321753
91177308-0d34-0410-b5e6-
96231b3b80d8
Matt Arsenault [Wed, 3 Jan 2018 18:45:42 +0000 (18:45 +0000)]
AMDGPU: Remove dead file
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@321752
91177308-0d34-0410-b5e6-
96231b3b80d8
Matt Arsenault [Wed, 3 Jan 2018 18:45:37 +0000 (18:45 +0000)]
StructurizeCFG: Fix broken backedge detection
The work order was changed in r228186 from SCC order
to RPO with an arbitrary sorting function. The sorting
function attempted to move inner loop nodes earlier. This
was was apparently relying on an assumption that every block
in a given loop / the same loop depth would be seen before
visiting another loop. In the broken testcase, a block
outside of the loop was encountered before moving onto
another block in the same loop. The testcase would then
structurize such that one blocks unconditional successor
could never be reached.
Revert to plain RPO for the analysis phase. This fixes
detecting edges as backedges that aren't really.
The processing phase does use another visited set, and
I'm unclear on whether the order there is as important.
An arbitrary order doesn't work, and triggers some infinite
loops. The reversed RPO list seems to work and is closer
to the order that was used before, minus the arbitary
custom sorting.
A few of the changed tests now produce smaller code,
and a few are slightly worse looking.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@321751
91177308-0d34-0410-b5e6-
96231b3b80d8