OSDN Git Service
Wei Mi [Tue, 29 Aug 2017 21:45:11 +0000 (21:45 +0000)]
[LoopUnswitch] Fix a simple bug which disables loop unswitch for select statement
This is to fix PR34257. rL309059 takes an early return when FindLIVLoopCondition
fails to find a loop invariant condition. This is wrong and it will disable loop
unswitch for select. The patch fixes the bug.
Differential Revision: https://reviews.llvm.org/D36985
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@312045
91177308-0d34-0410-b5e6-
96231b3b80d8
Reid Kleckner [Tue, 29 Aug 2017 21:44:46 +0000 (21:44 +0000)]
Fix indentation of find_first_existing_vc_file
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@312044
91177308-0d34-0410-b5e6-
96231b3b80d8
Reid Kleckner [Tue, 29 Aug 2017 21:44:21 +0000 (21:44 +0000)]
[cmake] Stop putting the revision info in LLVM_VERSION_STRING
Summary:
This reduces the number of build actions after a no-op commit from
thousands to about six, which should be acceptable. If six actions is
still too many, developers can disable the LLVM_APPEND_VC_REV cmake
option.
llvm-config.h is a widely included header that should rarely change.
Before this patch, it would change after every re-configure. Very few
users of llvm-config.h need to know the precise version, and those that
do can migrate to incorporating LLVM_REVISION as provided by
llvm/Support/VCSRevision.h.
This should bring LLVM back to the behavior that it had before r306858
from June 30 2017. Most LLVM tools will now print a version string like
"6.0.0svn" instead of "6.0.0-git-
c40c2a23de4".
Fixes PR34308
Reviewers: pcc, rafael, hans
Subscribers: mgorny, llvm-commits
Differential Revision: https://reviews.llvm.org/D37272
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@312043
91177308-0d34-0410-b5e6-
96231b3b80d8
Reid Kleckner [Tue, 29 Aug 2017 21:41:21 +0000 (21:41 +0000)]
[dwarfdump] Pretty print location expressions and location lists
Summary:
Based on Fred's patch here: https://reviews.llvm.org/D6771
I can't seem to commandeer the old review, so I'm creating a new one.
With that change the locations exrpessions are pretty printed inline in the
DIE tree. The output looks like this for debug_loc entries:
DW_AT_location [DW_FORM_data4] (0x00000000
0x0000000000000001 - 0x000000000000000b: DW_OP_consts +3
0x000000000000000b - 0x0000000000000012: DW_OP_consts +7
0x0000000000000012 - 0x000000000000001b: DW_OP_reg0 RAX, DW_OP_piece 0x4
0x000000000000001b - 0x0000000000000024: DW_OP_breg5 RDI+0)
And like this for debug_loc.dwo entries:
DW_AT_location [DW_FORM_sec_offset] (0x00000000
Addr idx 2 (w/ length 190): DW_OP_consts +0, DW_OP_stack_value
Addr idx 3 (w/ length 23): DW_OP_reg0 RAX, DW_OP_piece 0x4)
Simple locations without ranges are printed inline:
DW_AT_location [DW_FORM_block1] (DW_OP_reg4 RSI, DW_OP_piece 0x4, DW_OP_bit_piece 0x20 0x0)
The debug_loc(.dwo) dumping in changed accordingly to factor the code.
Reviewers: dblaikie, aprantl, friss
Subscribers: mgorny, javed.absar, hiraditya, llvm-commits, JDevlieghere
Differential Revision: https://reviews.llvm.org/D37123
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@312042
91177308-0d34-0410-b5e6-
96231b3b80d8
Matt Arsenault [Tue, 29 Aug 2017 21:25:51 +0000 (21:25 +0000)]
AMDGPU: Fix typo
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@312040
91177308-0d34-0410-b5e6-
96231b3b80d8
Joerg Sonnenberger [Tue, 29 Aug 2017 21:18:07 +0000 (21:18 +0000)]
Simplify test case, so that it works for both trunk and release-5.0.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@312038
91177308-0d34-0410-b5e6-
96231b3b80d8
Bob Haarman [Tue, 29 Aug 2017 21:01:55 +0000 (21:01 +0000)]
[NFC] clang-format llvm/lib/CodeGen/AsmPrinter/CodeViewDebug.cpp
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@312035
91177308-0d34-0410-b5e6-
96231b3b80d8
Bob Haarman [Tue, 29 Aug 2017 20:59:25 +0000 (20:59 +0000)]
Reland r311957 [codeview] support more DW_OPs for more complete debug info
Summary:
Some variables show up in Visual Studio as "optimized out" even in -O0
-Od builds. This change fixes two issues that would cause this to
happen. The first issue is that not all DIExpressions we generate were
recognized by the CodeView writer. This has been addressed by adding
support for DW_OP_constu, DW_OP_minus, and DW_OP_plus. The second
issue is that we had no way to encode DW_OP_deref in CodeView. We get
around that by changinge the type we encode in the debug info to be
a reference to the type in the source code.
This fixes PR34261.
The reland adds two extra checks to the original: It checks if the
DbgVariableLocation is valid before checking any of its fields, and
it only emits ranges with nonzero registers.
Reviewers: aprantl, rnk, zturner
Reviewed By: rnk
Subscribers: mgorny, llvm-commits, aprantl, hiraditya
Differential Revision: https://reviews.llvm.org/D36907
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@312034
91177308-0d34-0410-b5e6-
96231b3b80d8
Benjamin Kramer [Tue, 29 Aug 2017 20:24:39 +0000 (20:24 +0000)]
[FunctionImport] Avoid unused variable warnings in Release builds
Just skip the entire block in NDEBUG. No functionality change intended.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@312031
91177308-0d34-0410-b5e6-
96231b3b80d8
Alexey Bataev [Tue, 29 Aug 2017 20:06:24 +0000 (20:06 +0000)]
[SimplifyCFG] Fix for PR34219: Preserve alignment after merging conditional stores.
Summary:
If SimplifyCFG pass is able to merge conditional stores into single one,
it loses the alignment. This may lead to incorrect codegen. Patch
sets the alignment of the new instruction if it is set in the original
one.
Reviewers: jmolloy
Subscribers: llvm-commits
Differential Revision: https://reviews.llvm.org/D36841
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@312030
91177308-0d34-0410-b5e6-
96231b3b80d8
Marek Sokolowski [Tue, 29 Aug 2017 20:03:18 +0000 (20:03 +0000)]
[llvm-rc] Fix DIALOG(EX) parsing ability (parser, pt 5/8).
This fixes a use-after-free bug that was noticed by a sanitizer buildbot
(http://lab.llvm.org:8011/builders/sanitizer-x86_64-linux-fast/builds/7502).
Differential Revision: https://reviews.llvm.org/D37271
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@312028
91177308-0d34-0410-b5e6-
96231b3b80d8
Kostya Kortchinsky [Tue, 29 Aug 2017 19:54:19 +0000 (19:54 +0000)]
[docs] Fix Scudo documentation error
Summary: No Pygments lexer found for "none".
Reviewers: flowerhack
Reviewed By: flowerhack
Differential Revision: https://reviews.llvm.org/D37270
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@312027
91177308-0d34-0410-b5e6-
96231b3b80d8
Matt Morehouse [Tue, 29 Aug 2017 19:48:12 +0000 (19:48 +0000)]
[SanitizeCoverage] Enable stack-depth coverage for -fsanitize=fuzzer
Summary:
- Don't sanitize __sancov_lowest_stack.
- Don't instrument leaf functions.
- Add CoverageStackDepth to Fuzzer and FuzzerNoLink.
- Disable stack depth tracking on Mac.
Reviewers: vitalybuka, kcc, george.karpenkov
Reviewed By: kcc
Subscribers: kubamracek, cfe-commits, llvm-commits, hiraditya
Differential Revision: https://reviews.llvm.org/D37156
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@312026
91177308-0d34-0410-b5e6-
96231b3b80d8
Kostya Kortchinsky [Tue, 29 Aug 2017 19:42:50 +0000 (19:42 +0000)]
Update Scudo allocator documentation.
Summary:
QuarantineSizeMb is deprecated, and QuarantineChunksUpToSize has been added as a new tunable option.
Reviewers: cryptoad
Reviewed By: cryptoad
Differential Revision: https://reviews.llvm.org/D37238
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@312025
91177308-0d34-0410-b5e6-
96231b3b80d8
Craig Topper [Tue, 29 Aug 2017 18:58:13 +0000 (18:58 +0000)]
[InstCombine] Support vector splats in transformZExtICmp
This patch adds splat support to transformZExtICmp. The test cases are vector versions of tests that failed when commenting out parts of the existing scalar code.
One test didn't vectorize optimize properly due to another bug so a TODO has been added.
Differential Revision: https://reviews.llvm.org/D37253
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@312023
91177308-0d34-0410-b5e6-
96231b3b80d8
Hans Wennborg [Tue, 29 Aug 2017 18:41:00 +0000 (18:41 +0000)]
[DAG] Bound loop dependence check in merge optimization.
The loop dependence check looks for dependencies between store merge
candidates not captured by the chain sub-DAG doing a check of
predecessors which may be very large. Conservatively bound number of
nodes checked for compilation time. (Resolves PR34326).
Landing on behalf of Nirav Dave to unblock the 5.0.0 release.
Differential Revision: https://reviews.llvm.org/D37220
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@312022
91177308-0d34-0410-b5e6-
96231b3b80d8
Teresa Johnson [Tue, 29 Aug 2017 18:15:34 +0000 (18:15 +0000)]
[ThinLTO] Clean up stale alias import handling
Summary:
Remove some code that was no longer needed. The first FIXME is
stale since we long ago started using the index to drive importing,
rather than doing force importing based on linkage type. And
now with r309278, we no longer import any aliases.
Reviewers: dblaikie
Subscribers: inglorion, llvm-commits
Differential Revision: https://reviews.llvm.org/D37266
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@312019
91177308-0d34-0410-b5e6-
96231b3b80d8
Davide Italiano [Tue, 29 Aug 2017 17:24:09 +0000 (17:24 +0000)]
[LoopUnroll] Make the test for PR33437 actually useful.
I forgot to specify -unroll-loop-peel, making this test not
really effective. While here, adjust some details (naming and
run line). Thanks to Sanjoy and Michael Z. for pointing out in
their post-commit reviews.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@312015
91177308-0d34-0410-b5e6-
96231b3b80d8
Ana Pazos [Tue, 29 Aug 2017 17:13:24 +0000 (17:13 +0000)]
[PGO] Fixed non-determinism with DenseSet storing function importing info.
Summary:
r296498 introduced a DenseSet to store function importing info.
Using this container causes a test failure in
test/Transform/SampleProfile/import.ll when in Reverse Iteration mode.
This patch orders IDs before iterating through this container.
Reviewers: danielcdh, mgrang
Reviewed By: danielcdh
Subscribers: llvm-commits
Differential Revision: https://reviews.llvm.org/D37246
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@312012
91177308-0d34-0410-b5e6-
96231b3b80d8
Justin Bogner [Tue, 29 Aug 2017 17:08:44 +0000 (17:08 +0000)]
Fix build of llvm-mc-assemble/disassemble-fuzzer
Since these aren't built by default unless building with coverage (and
even then they aren't built for the check target) they've managed to
bit rot a little.
This just fixes the build. See llvm.org/pr34314 for the plan on making
sure these don't bit rot again.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@312011
91177308-0d34-0410-b5e6-
96231b3b80d8
Marek Sokolowski [Tue, 29 Aug 2017 16:49:59 +0000 (16:49 +0000)]
[llvm-rc] Add DIALOG(EX) parsing ability (parser, pt 5/8).
This extends the set of resources parsed by llvm-rc by DIALOG and
DIALOGEX.
Additionally, three optional resource statements specific to these two
resources are added: CAPTION, FONT, and STYLE.
Thanks for Nico Weber for his original work in this area.
Differential Revision: https://reviews.llvm.org/D36905
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@312009
91177308-0d34-0410-b5e6-
96231b3b80d8
Craig Topper [Tue, 29 Aug 2017 15:29:36 +0000 (15:29 +0000)]
[X86] Fix copy pasto from r311841. Call getOnesVector instead of getZeroVector.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@312006
91177308-0d34-0410-b5e6-
96231b3b80d8
Dehao Chen [Tue, 29 Aug 2017 15:28:12 +0000 (15:28 +0000)]
Add null check for promoted direct call
Summary: We originally assume that in pgo-icp, the promoted direct call will never be null after strip point casts. However, stripPointerCasts is so smart that it could possibly return the value of the function call if it knows that the return value is always an argument. In this case, the returned value cannot cast to Instruction. In this patch, null check is added to ensure null pointer will not be accessed.
Reviewers: tejohnson, xur, davidxl, djasper
Reviewed By: tejohnson
Subscribers: llvm-commits, sanjoy
Differential Revision: https://reviews.llvm.org/D37252
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@312005
91177308-0d34-0410-b5e6-
96231b3b80d8
Alexey Bataev [Tue, 29 Aug 2017 14:37:23 +0000 (14:37 +0000)]
[SimplifyCFG] Update initial test for better testing of the fix for
PR34219, NFC.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@312002
91177308-0d34-0410-b5e6-
96231b3b80d8
Sanjay Patel [Tue, 29 Aug 2017 14:07:48 +0000 (14:07 +0000)]
[Instruction] add moveAfter() convenience function; NFCI
As suggested in D37121, here's a wrapper for removeFromParent() + insertAfter(),
but implemented using moveBefore() for symmetry/efficiency.
Differential Revision: https://reviews.llvm.org/D37239
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@312001
91177308-0d34-0410-b5e6-
96231b3b80d8
Guy Blank [Tue, 29 Aug 2017 11:58:03 +0000 (11:58 +0000)]
[X86] Add a test cases to demonstrate selecting GPR instructions when
using mask based ones are more appropriate.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@311996
91177308-0d34-0410-b5e6-
96231b3b80d8
Jatin Bhateja [Tue, 29 Aug 2017 10:49:33 +0000 (10:49 +0000)]
[X86] Adding a test to demonstrate aggressive folding for LEA facotrization.
Differential Revision: https://reviews.llvm.org/D37257
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@311994
91177308-0d34-0410-b5e6-
96231b3b80d8
Javed Absar [Tue, 29 Aug 2017 10:04:18 +0000 (10:04 +0000)]
[ARM] - Tidy-up ARMAsmPrinter.cpp
Change to range-loop where missing.
Reviwewed by: @fhahn, @asb
Differential Revision: https://reviews.llvm.org/D37199
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@311993
91177308-0d34-0410-b5e6-
96231b3b80d8
Diana Picus [Tue, 29 Aug 2017 09:47:55 +0000 (09:47 +0000)]
[ARM] GlobalISel: Select globals in PIC mode
Support the selection of G_GLOBAL_VALUE in the PIC relocation model. For
simplicity we use the same pseudoinstructions for both Darwin and ELF:
(MOV|LDRLIT)_ga_pcrel(_ldr).
This is new for ELF, so it requires a small update to the ARM pseudo
expansion pass to make sure it adds the correct constant pool modifier
and add-current-address in the case of ELF.
Differential Revision: https://reviews.llvm.org/D36507
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@311992
91177308-0d34-0410-b5e6-
96231b3b80d8
Diana Picus [Tue, 29 Aug 2017 09:00:58 +0000 (09:00 +0000)]
[ARM] GlobalISel: Rename tests. NFC.
The checks are complicated enough as it is, there's no use cramming PIC
in there as well...
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@311989
91177308-0d34-0410-b5e6-
96231b3b80d8
Eric Christopher [Tue, 29 Aug 2017 08:23:46 +0000 (08:23 +0000)]
Revert "The current version of LLVM X86 disassembler incorrectly interprets some possible sets of x86 prefixes. This patch is the first step to close PR7709 and PR17697. There will be next patch(es) to close relative PRs." temporarily while some regressions are addressed.
This reverts commit r311882.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@311987
91177308-0d34-0410-b5e6-
96231b3b80d8
Max Kazantsev [Tue, 29 Aug 2017 07:32:20 +0000 (07:32 +0000)]
[LSR] Fix Shadow IV in case of integer overflow
When LSR processes code like
int accumulator = 0;
for (int i = 0; i < N; i++) {
accummulator += i;
use((double) accummulator);
}
It may decide to replace integer `accumulator` with a double Shadow IV to get rid
of casts. The problem with that is that the `accumulator`'s value may overflow.
Starting from this moment, the behavior of integer and double accumulators
will differ.
This patch strenghtens up the conditions of Shadow IV mechanism applicability.
We only allow it for IVs that are proved to be `AddRec`s with `nsw`/`nuw` flag.
Differential Revision: https://reviews.llvm.org/D37209
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@311986
91177308-0d34-0410-b5e6-
96231b3b80d8
Craig Topper [Tue, 29 Aug 2017 07:08:39 +0000 (07:08 +0000)]
[InstCombine] Uncomment two test cases that were commented out with a TODO about them not optimizing.
If we can't see the current code how will we ever know if they get fixed or even what the problem is?
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@311985
91177308-0d34-0410-b5e6-
96231b3b80d8
Max Kazantsev [Tue, 29 Aug 2017 05:30:58 +0000 (05:30 +0000)]
[NFC] Fix indents in test
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@311982
91177308-0d34-0410-b5e6-
96231b3b80d8
Max Kazantsev [Tue, 29 Aug 2017 05:20:56 +0000 (05:20 +0000)]
[NFC] Refactor ShadowIV test to use FileCheck
Also get rid of unnamed values that make the test hard to read.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@311980
91177308-0d34-0410-b5e6-
96231b3b80d8
Craig Topper [Tue, 29 Aug 2017 05:14:27 +0000 (05:14 +0000)]
Mark Knights Landing as having slow two memory operand instructions
Summary: Knights Landing, because it is Atom derived, has slow two memory operand instructions. Mark the Knights Landing CPU model accordingly.
Patch by David Zarzycki.
Reviewers: craig.topper
Reviewed By: craig.topper
Subscribers: llvm-commits
Differential Revision: https://reviews.llvm.org/D37224
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@311979
91177308-0d34-0410-b5e6-
96231b3b80d8
Bob Haarman [Tue, 29 Aug 2017 04:08:31 +0000 (04:08 +0000)]
Revert "[codeview] support more DW_OPs for more complete debug info"
This reverts commit
e160912f53f047bc97e572add179e08e33f4df48.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@311977
91177308-0d34-0410-b5e6-
96231b3b80d8
Bob Haarman [Tue, 29 Aug 2017 04:08:16 +0000 (04:08 +0000)]
Revert "[codeview] don't try to emit variable locations without registers"
This reverts commit
a256fbcacf448ee793d23552c46ed2971bf9eff5.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@311976
91177308-0d34-0410-b5e6-
96231b3b80d8
Petr Hosek [Tue, 29 Aug 2017 02:12:03 +0000 (02:12 +0000)]
Reland "[llvm] Add symbol table support to llvm-objcopy"
This change adds support for SHT_SYMTAB sections.
Patch by Jake Ehrlich
Differential Revision: https://reviews.llvm.org/D34167
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@311974
91177308-0d34-0410-b5e6-
96231b3b80d8
Stephen Hines [Tue, 29 Aug 2017 02:07:28 +0000 (02:07 +0000)]
Enable building LLVMgold.dll under mingw.
Summary:
Plugins can (and should) be enabled under mingw if we are building
libLLVM.dll, so this is just a missed case. This allows LLVMgold.dll to
be built now under mingw.
Reviewers: llvm-commits, pirama, beanz, chapuni
Reviewed By: chapuni
Subscribers: chapuni, mgorny
Differential Revision: https://reviews.llvm.org/D37116
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@311973
91177308-0d34-0410-b5e6-
96231b3b80d8
Yuka Takahashi [Tue, 29 Aug 2017 02:01:56 +0000 (02:01 +0000)]
[Bash-autocompletion] Add support for -std=
Summary:
Add support for autocompleting values of -std= by including
LangStandards.def. This patch relies on D36782, and is using two-stage
code generation.
Reviewers: v.g.vassilev, teemperor, ruiu
Subscribers: cfe-commits
Differential Revision: https://reviews.llvm.org/D36820
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@311971
91177308-0d34-0410-b5e6-
96231b3b80d8
Bob Haarman [Tue, 29 Aug 2017 01:45:54 +0000 (01:45 +0000)]
[codeview] don't try to emit variable locations without registers
This fixes a problem introduced 311957, where the compiler would crash
with "fatal error: error in backend: unknown codeview register".
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@311969
91177308-0d34-0410-b5e6-
96231b3b80d8
Kostya Serebryany [Tue, 29 Aug 2017 01:14:05 +0000 (01:14 +0000)]
fix llvm-dwarfdump-fuzzer.cpp to use the current libFuzzer API
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@311968
91177308-0d34-0410-b5e6-
96231b3b80d8
Juergen Ributzka [Tue, 29 Aug 2017 00:34:56 +0000 (00:34 +0000)]
Re-apply "Fix cmake check for futimens when deploying to earlier macOS releases."
This fixes an issue with the use of LLVM_PARALLEL_LINK_JOBS.
Original commit message:
macOS 10.13 added a new API (futimens). This API is only available on macOS 10.13
and later, but the cmake check we have in place only tests if the symbol is
present and ignores the availability attribute. Luckily we have new warning for
this and by making this warning an error the cmake check will return the correct
result.
See also rdar://problem/
33992750.
Differential Revision: https://reviews.llvm.org/D37027
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@311965
91177308-0d34-0410-b5e6-
96231b3b80d8
Justin Bogner [Tue, 29 Aug 2017 00:22:08 +0000 (00:22 +0000)]
Implement llvm-isel-fuzzer for fuzzing instruction selection
This implements a fuzzer tool for instruction selection, as described
in my [EuroLLVM 2017 talk][1].
The fuzzer must be given both libFuzzer args and llc-like args to
configure the backend. For example, to fuzz AArch64 GlobalISel at -O0,
you could invoke like so:
llvm-isel-fuzzer <corpus dirs> -ignore_remaining_args=1 \
-mtriple arm64-apple-ios -global-isel -O0
If you would like to seed the fuzzer with an initial corpus, simply
provide a directory of valid LLVM bitcode (not textual IR) as one of
the corpus dirs.
[1]: http://llvm.org/devmtg/2017-03//2017/02/20/accepted-sessions.html#2
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@311964
91177308-0d34-0410-b5e6-
96231b3b80d8
Craig Topper [Tue, 29 Aug 2017 00:13:49 +0000 (00:13 +0000)]
[InstCombine] Teach foldSelectICmpAndOr to handle vector splats
This was pretty close to working already. While I was here I went ahead and passed the ICmpInst pointer from the caller instead of doing a dyn_cast that can never fail.
Differential Revision: https://reviews.llvm.org/D37237
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@311960
91177308-0d34-0410-b5e6-
96231b3b80d8
Justin Bogner [Tue, 29 Aug 2017 00:11:05 +0000 (00:11 +0000)]
[sanitizer-coverage] Mark the guard and 8-bit counter arrays as used
In r311742 we marked the PCs array as used so it wouldn't be dead
stripped, but left the guard and 8-bit counters arrays alone since
these are referenced by the coverage instrumentation. This doesn't
quite work if we want the indices of the PCs array to match the other
arrays though, since elements can still end up being dead and
disappear.
Instead, we mark all three of these arrays as used so that they'll be
consistent with one another.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@311959
91177308-0d34-0410-b5e6-
96231b3b80d8
Yuka Takahashi [Tue, 29 Aug 2017 00:09:31 +0000 (00:09 +0000)]
Revert "Revert r311552: [Bash-autocompletion] Add support for static analyzer flags"
This reverts commit
7c46b80c022e18d43c1fdafb117b0c409c5a6d1e.
r311552 broke lld buildbot because I've changed OptionInfos type from
ArrayRef to vector. However the bug is fixed, so I'll commit this again.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@311958
91177308-0d34-0410-b5e6-
96231b3b80d8
Bob Haarman [Tue, 29 Aug 2017 00:06:59 +0000 (00:06 +0000)]
[codeview] support more DW_OPs for more complete debug info
Summary:
Some variables show up in Visual Studio as "optimized out" even in -O0
-Od builds. This change fixes two issues that would cause this to
happen. The first issue is that not all DIExpressions we generate were
recognized by the CodeView writer. This has been addressed by adding
support for DW_OP_constu, DW_OP_minus, and DW_OP_plus. The second
issue is that we had no way to encode DW_OP_deref in CodeView. We get
around that by changinge the type we encode in the debug info to be
a reference to the type in the source code.
This fixes PR34261.
Reviewers: aprantl, rnk, zturner
Reviewed By: rnk
Subscribers: mgorny, llvm-commits, aprantl, hiraditya
Differential Revision: https://reviews.llvm.org/D36907
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@311957
91177308-0d34-0410-b5e6-
96231b3b80d8
Marek Sokolowski [Mon, 28 Aug 2017 23:46:30 +0000 (23:46 +0000)]
[llvm-rc] Add MENU parsing ability (parser, pt 4/8).
This extends llvm-rc parsing tool by MENU resource
(msdn.microsoft.com/en-us/library/windows/desktop/
aa381025(v=vs.85).aspx).
As for now, MENUEX
(msdn.microsoft.com/en-us/library/windows/desktop/
aa381023(v=vs.85).aspx)
seems unnecessary.
Thanks for Nico Weber for his original work in this area.
Differential Revision: https://reviews.llvm.org/D36898
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@311956
91177308-0d34-0410-b5e6-
96231b3b80d8
Justin Bogner [Mon, 28 Aug 2017 23:46:11 +0000 (23:46 +0000)]
[sanitizer-coverage] Return the array from CreatePCArray. NFC
Be more consistent with CreateFunctionLocalArrayInSection in the API
of CreatePCArray, and assign the member variable in the caller like we
do for the guard and 8-bit counter arrays.
This also tweaks the order of method declarations to match the order
of definitions in the file.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@311955
91177308-0d34-0410-b5e6-
96231b3b80d8
Justin Bogner [Mon, 28 Aug 2017 23:38:12 +0000 (23:38 +0000)]
[sanitizer-coverage] Clean up trailing whitespace. NFC
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@311954
91177308-0d34-0410-b5e6-
96231b3b80d8
Juergen Ributzka [Mon, 28 Aug 2017 23:24:03 +0000 (23:24 +0000)]
Revert "Fix cmake check for futimens when deploying to earlier macOS releases."
This reverts r311949. The ARM bots don't like it.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@311953
91177308-0d34-0410-b5e6-
96231b3b80d8
Adrian Prantl [Mon, 28 Aug 2017 23:07:43 +0000 (23:07 +0000)]
Fix a logic error in DwarfExpression::addMachineReg()
This fixes PR34323 and thus splitting undescribable registers into
smaller, describable sub-registers.
https://bugs.llvm.org/show_bug.cgi?id=34323
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@311951
91177308-0d34-0410-b5e6-
96231b3b80d8
Juergen Ributzka [Mon, 28 Aug 2017 23:04:38 +0000 (23:04 +0000)]
Fix cmake check for futimens when deploying to earlier macOS releases.
macOS 10.13 added a new API (futimens). This API is only available on macOS 10.13
and later, but the cmake check we have in place only tests if the symbol is
present and ignores the availability attribute. Luckily we have new warning for
this and by making this warning an error the cmake check will return the correct
result.
See also rdar://problem/
33992750.
Differential Revision: https://reviews.llvm.org/D37027
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@311949
91177308-0d34-0410-b5e6-
96231b3b80d8
Adam Nemet [Mon, 28 Aug 2017 23:00:13 +0000 (23:00 +0000)]
Remove an unnecessary const_cast.
I think that this is dating back to when emit used to take a const reference.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@311948
91177308-0d34-0410-b5e6-
96231b3b80d8
Marek Sokolowski [Mon, 28 Aug 2017 22:58:31 +0000 (22:58 +0000)]
[llvm-rc] Add ACCELERATORS parsing ability. (parser, pt 3/8).
This improves the current llvm-rc parser by the ability of parsing
ACCELERATORS statement.
Moreover, some small improvements to the original parsing commit
were made.
Thanks for Nico Weber for his original work in this area.
Differential Revision: https://reviews.llvm.org/D36894
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@311946
91177308-0d34-0410-b5e6-
96231b3b80d8
Evandro Menezes [Mon, 28 Aug 2017 22:51:52 +0000 (22:51 +0000)]
[AArch64] Adjust the cost model for Exynos M1 and M2
Add new predicate to more accurately model the scheduling around branches
and function calls and of loads and stores of pairs and integer
multiplications.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@311944
91177308-0d34-0410-b5e6-
96231b3b80d8
Evandro Menezes [Mon, 28 Aug 2017 22:51:32 +0000 (22:51 +0000)]
[AArch64] Adjust the cost model for Exynos M1 and M2
Add new predicate to more accurately model the cost of arithmetic and
logical operations shifted left.
Differential revision: https://reviews.llvm.org/D37151
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@311943
91177308-0d34-0410-b5e6-
96231b3b80d8
Kamil Rytarowski [Mon, 28 Aug 2017 22:13:52 +0000 (22:13 +0000)]
Define NetBSD/amd64 ASAN Shadow Offset
Summary:
Catch up after compiler-rt changes and define kNetBSD_ShadowOffset64
as (1ULL << 46).
Sponsored by <The NetBSD Foundation>
Reviewers: kcc, joerg, filcab, vitalybuka, eugenis
Reviewed By: eugenis
Subscribers: llvm-commits, #sanitizers
Tags: #sanitizers
Differential Revision: https://reviews.llvm.org/D37234
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@311941
91177308-0d34-0410-b5e6-
96231b3b80d8
Craig Topper [Mon, 28 Aug 2017 22:00:27 +0000 (22:00 +0000)]
[InstCombine] Teach select01 helper of foldSelectIntoOp to handle vector splats
We were handling some vectors in foldSelectIntoOp, but not if the operand of the bin op was any kind of vector constant. This patch fixes it to treat vector splats the same as scalars.
Differential Revision: https://reviews.llvm.org/D37232
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@311940
91177308-0d34-0410-b5e6-
96231b3b80d8
Marek Sokolowski [Mon, 28 Aug 2017 21:59:54 +0000 (21:59 +0000)]
[llvm-rc] Add ICON and HTML parsing ability (parser, pt 2/8).
This extends the current llvm-rc parser by ICON and HTML resources.
Moreover, some tests have been slightly rewritten.
Thanks for Nico Weber for his original work in this area.
Differential Revision: https://reviews.llvm.org/D36891
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@311939
91177308-0d34-0410-b5e6-
96231b3b80d8
Sanjay Patel [Mon, 28 Aug 2017 21:14:26 +0000 (21:14 +0000)]
[InstCombine] add tests to show failure of SimplifyDemandedVectorElts + shuffle combining; NFC
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@311934
91177308-0d34-0410-b5e6-
96231b3b80d8
Geoff Berry [Mon, 28 Aug 2017 20:48:43 +0000 (20:48 +0000)]
[AArch64][Falkor] Avoid generating STRQro* instructions
Summary:
STRQro* instructions are slower than the alternative ADD/STRQui expanded
instructions on Falkor, so avoid generating them unless we're optimizing
for code size.
Reviewers: t.p.northover, mcrosier
Subscribers: aemerson, rengolin, javed.absar, kristof.beyls, llvm-commits
Differential Revision: https://reviews.llvm.org/D37020
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@311931
91177308-0d34-0410-b5e6-
96231b3b80d8
Davide Italiano [Mon, 28 Aug 2017 20:29:33 +0000 (20:29 +0000)]
[LoopUnroll] Properly update loop structure in case of successful peeling.
When peeling kicks in, it updates the loop preheader.
Later, a successful full unroll of the loop needs to update a PHI
which i-th argument comes from the loop preheader, so it'd better look
at the correct block. Fixes PR33437.
Differential Revision: https://reviews.llvm.org/D37153
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@311922
91177308-0d34-0410-b5e6-
96231b3b80d8
Joerg Sonnenberger [Mon, 28 Aug 2017 20:20:47 +0000 (20:20 +0000)]
Fix ARMv4 support
ARMv4 doesn't support the "BX" instruction, which has been introduced
with ARMv4t. Adjust the call lowering and tail call implementation
accordingly.
Further changes are necessary to ensure that presence of the v4t feature
is correctly set. Most importantly, the "generic" CPU for thumb-*
triples should include ARMv4t, since thumb mode without thumb support
would naturally be pointless.
Add a couple of asserts to ensure thumb instructions are not emitted
without CPU support.
Differential Revision: https://reviews.llvm.org/D37030
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@311921
91177308-0d34-0410-b5e6-
96231b3b80d8
Matthias Braun [Mon, 28 Aug 2017 20:11:28 +0000 (20:11 +0000)]
Try to fix compilation problem with libstdc++
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@311918
91177308-0d34-0410-b5e6-
96231b3b80d8
Matthias Braun [Mon, 28 Aug 2017 20:11:27 +0000 (20:11 +0000)]
Address r311914 review comments
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@311917
91177308-0d34-0410-b5e6-
96231b3b80d8
Davide Italiano [Mon, 28 Aug 2017 19:50:55 +0000 (19:50 +0000)]
[LoopUnroll] Add a cl::opt to force peeling, for testing purposes.
Will be used to test the patch proposed in D37153.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@311915
91177308-0d34-0410-b5e6-
96231b3b80d8
Matthias Braun [Mon, 28 Aug 2017 19:48:42 +0000 (19:48 +0000)]
TableGen: Fix subreg composition/concatenation
This fixes 2 problems in subregister hierarchies with multiple levels
and tuples:
1) For bigger tuples computing secondary subregs would miss 2nd order
effects. In the test case a register like `S10_S11_S12_S13_S14` with D5
= S10_S11, D6 = S12_S13 we would correctly compute sub0 = D5, sub1 = D6
but would miss the fact that we could now form ssub0_ssub1_ssub2_ssub3
(aka sub0_sub1) = D5_D6. This is fixed by changing
computeSecondarySubRegs() to compute a fixpoint.
2) Fixing 1) exposed a problem where TableGen would create multiple
names for effectively the same subregister index. In the test case
the subregister index sub0 is composed from ssub0 and ssub1, and sub1 is
composed from ssub2 and ssub3. TableGen should not create both sub0_sub1
and ssub0_ssub1_ssub2_ssub3 as infered subregister indexes. This changes
the code to build a transitive closure of the subregister components
before forming new concatenated subregister indexes.
This fix was developed for an out of tree target. For the in-tree
targets the only change is in the register information computed for ARM.
There is a slight chance this fixed/improved some register coalescing
around the QQQQ/QQ register classes there but I couldn't see/provoke any
code generation differences.
Differential Revision: https://reviews.llvm.org/D36913
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@311914
91177308-0d34-0410-b5e6-
96231b3b80d8
Matthias Braun [Mon, 28 Aug 2017 19:48:40 +0000 (19:48 +0000)]
TableGen: Add -gen-register-info-debug-dump
Adds a new --gen-register-info-debug-dump mode to tablegen that dumps various register related information:
- List of register classes with super and subclasses
- List of subregister indexes with lanemasks
- List of registers with subregisters
I will use this in an upcoming commit to create a test.
It may also be useful for target developers wanting to get an overview
of all the register related information, esp. the things inferred by
tablegen and not directly visible in the .td file.
Differential Revision: https://reviews.llvm.org/D36911
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@311913
91177308-0d34-0410-b5e6-
96231b3b80d8
Geoff Berry [Mon, 28 Aug 2017 19:03:45 +0000 (19:03 +0000)]
[ARM] Fix bug in ARMLoadStoreOptimizer when kill flags are missing.
Summary:
ARMLoadStoreOpt::FixInvalidRegPairOp() was only checking if one of the
load destination registers to be split overlapped with the base register
if the base register was marked as killed. Since kill flags may not
always be present, this can lead to incorrect code.
This bug was exposed by my MachineCopyPropagation change D30751 breaking
the sanitizer-x86_64-linux-android buildbot.
Also clean up some dead code and add an assert that a register offset is
never encountered by this code, since it does not handle them correctly.
Reviewers: MatzeB, qcolombet, t.p.northover
Subscribers: aemerson, javed.absar, kristof.beyls, mcrosier, llvm-commits
Differential Revision: https://reviews.llvm.org/D37164
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@311907
91177308-0d34-0410-b5e6-
96231b3b80d8
Taewook Oh [Mon, 28 Aug 2017 18:57:00 +0000 (18:57 +0000)]
Create PHI node for the return value only when the return value has uses.
Summary:
Currently, a phi node is created in the normal destination to unify the return values from promoted calls and the original indirect call. This patch makes this phi node to be created only when the return value has uses.
This patch is necessary to generate valid code, as compiler crashes with the attached test case without this patch. Without this patch, an illegal phi node that has no incoming value from `entry`/`catch` is created in `cleanup` block.
I think existing implementation is good as far as there is at least one use of the original indirect call. `insertCallRetPHI` creates a new phi node in the normal destination block only when the original indirect call dominates its use and the normal destination block. Otherwise, `fixupPHINodeForNormalDest` will handle the unification of return values naturally without creating a new phi node. However, if there's no use, `insertCallRetPHI` still creates a new phi node even when the original indirect call does not dominate the normal destination block, because `getCallRetPHINode` returns false.
Reviewers: xur, davidxl, danielcdh
Reviewed By: xur
Subscribers: llvm-commits
Differential Revision: https://reviews.llvm.org/D37176
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@311906
91177308-0d34-0410-b5e6-
96231b3b80d8
Zachary Turner [Mon, 28 Aug 2017 18:49:04 +0000 (18:49 +0000)]
[CodeView] Don't output S_UDT symbols for forward decls.
S_UDT symbols are the debugger's "index" for all the structs,
typedefs, classes, and enums in a program. If any of those
structs/classes don't have a complete declaration, or if there
is a typedef to something that doesn't have a complete definition,
then emitting the S_UDT is unhelpful because it doesn't give
the debugger enough information to do anything useful. On the
other hand, it results in a huge size blow-up in the resulting
PDB, which is exacerbated by an order of magnitude when linking
with /DEBUG:FASTLINK.
With this patch, we drop S_UDT records for types that refer either
directly or indirectly (e.g. through a typedef, pointer, etc) to
a class/struct/union/enum without a complete definition. This
brings us about 50% of the way towards parity with /DEBUG:FASTLINK
PDBs generated from cl-compiled object files.
Differential Revision: https://reviews.llvm.org/D37162
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@311904
91177308-0d34-0410-b5e6-
96231b3b80d8
Stefan Pintilie [Mon, 28 Aug 2017 18:46:01 +0000 (18:46 +0000)]
[Power9] Add new instructions for floating point status and control registers.
Added the following P9 instructions: mffsce, mffscdrn, mffscdrni, mffscrn,
mffscrni, mffsl
Differential Revision: https://reviews.llvm.org/D37167
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@311903
91177308-0d34-0410-b5e6-
96231b3b80d8
Craig Topper [Mon, 28 Aug 2017 18:44:28 +0000 (18:44 +0000)]
[InstCombine] Call hasNoSignedWrap instead of hasNoUnsignedWrap to get the NSW flag when handling Add in SimplifyDemandedUseBits.
This is a typo from r311789.
This should fix PR34349.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@311902
91177308-0d34-0410-b5e6-
96231b3b80d8
Krzysztof Parzyszek [Mon, 28 Aug 2017 18:36:21 +0000 (18:36 +0000)]
[Hexagon] Check for potential bank conflicts in post-RA scheduling
Insert artificial edges between loads that could cause a cache bank
conflict.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@311901
91177308-0d34-0410-b5e6-
96231b3b80d8
Stanislav Mekhanoshin [Mon, 28 Aug 2017 18:00:08 +0000 (18:00 +0000)]
[AMDGPU] Fix regression in AMDGPULibCalls allowing native for doubles
Under -cl-fast-relaxed-math we could use native_sqrt, but f64 was
allowed to produce HSAIL's nsqrt instruction. HSAIL is not here
and we stick with non-existing native_sqrt(double) as a result.
Add check for f64 to not return native functions and also remove
handling of f64 case for fold_sqrt.
Differential Revision: https://reviews.llvm.org/D37223
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@311900
91177308-0d34-0410-b5e6-
96231b3b80d8
Stanislav Mekhanoshin [Mon, 28 Aug 2017 16:35:37 +0000 (16:35 +0000)]
[AMDGPU] computeKnownBitsForTargetNode for 24 bit mul
Differential Revision: https://reviews.llvm.org/D37168
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@311896
91177308-0d34-0410-b5e6-
96231b3b80d8
Krzysztof Parzyszek [Mon, 28 Aug 2017 16:24:22 +0000 (16:24 +0000)]
[Hexagon] Break up DAG mutations into separate classes, move to subtarget
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@311895
91177308-0d34-0410-b5e6-
96231b3b80d8
Krzysztof Parzyszek [Mon, 28 Aug 2017 15:52:54 +0000 (15:52 +0000)]
[Hexagon] Move pre-RA DAG mutations to scheduler constructor
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@311894
91177308-0d34-0410-b5e6-
96231b3b80d8
Craig Topper [Mon, 28 Aug 2017 15:32:50 +0000 (15:32 +0000)]
[X86] Make 128/256-bit extract_subvector Legal instead of Custom. Move combining with BUILD_VECTOR from Legalization to DAG combine
EXTRACT_SUBVECTOR was marked Custom solely so we could combine it with BUILD_VECTOR operations to create smaller BUILD_VECTORS during Legalization. But that sort of combining should really be done by the DAG combiner.
This patch adds the last piece of needed supported DAG combine to handle this. Once that's done we can make the EXTRACT_SUBVECTOR operations Legal.
Differential Revision: https://reviews.llvm.org/D37197
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@311893
91177308-0d34-0410-b5e6-
96231b3b80d8
Craig Topper [Mon, 28 Aug 2017 15:28:33 +0000 (15:28 +0000)]
[DAGCombiner] Teach visitEXTRACT_SUBVECTOR to turn extracts of BUILD_VECTOR into smaller BUILD_VECTORs
Only do this before operations are legalized of BUILD_VECTOR is Legal for the target.
Differential Revision: https://reviews.llvm.org/D37186
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@311892
91177308-0d34-0410-b5e6-
96231b3b80d8
Ilya Biryukov [Mon, 28 Aug 2017 15:12:24 +0000 (15:12 +0000)]
Changed Dockerfiles to install LLVM into /usr/local
Summary:
Previously, the installation path was simply '/'.
Using '/usr/local' would ensure that LLVM installation does not
conflict with software installed via package managers.
Reviewers: mehdi_amini, klimek
Reviewed By: klimek
Subscribers: llvm-commits
Differential Revision: https://reviews.llvm.org/D37213
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@311890
91177308-0d34-0410-b5e6-
96231b3b80d8
Evgeny Mankov [Mon, 28 Aug 2017 13:39:43 +0000 (13:39 +0000)]
[Support][CommandLine] Add cl::Option::setDefault()
Add abstract virtual method setDefault() to class Option and implement it in its inheritors in order to be able to set all the options to its default values in user's code without actually knowing all these options. For instance:
for (auto &OM : cl::getRegisteredOptions(*cl::TopLevelSubCommand)) {
cl::Option *O = OM.second;
O->setDefault();
}
Reviewed by: rampitec, Eugene.Zelenko, kasaurov
Differential Revision: http://reviews.llvm.org/D36877
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@311887
91177308-0d34-0410-b5e6-
96231b3b80d8
Andrew V. Tischenko [Mon, 28 Aug 2017 10:43:14 +0000 (10:43 +0000)]
The current version of LLVM X86 disassembler incorrectly interprets some possible sets of x86 prefixes. This patch is the first step to close PR7709 and PR17697. There will be next patch(es) to close relative PRs.
Differential Revision: https://reviews.llvm.org/D36788
M lib/Target/X86/Disassembler/X86DisassemblerDecoder.cpp
M lib/Target/X86/Disassembler/X86DisassemblerDecoder.h
A test/MC/Disassembler/X86/prefixes-i386.s
A test/MC/Disassembler/X86/prefixes-x86_64.s
M test/MC/Disassembler/X86/prefixes.txt
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@311882
91177308-0d34-0410-b5e6-
96231b3b80d8
Gadi Haber [Mon, 28 Aug 2017 10:04:16 +0000 (10:04 +0000)]
[X86][Haswell] Updating HSW instruction scheduling information
This patch completely replaces the instruction scheduling information for the Haswell architecture target by modifying the file X86SchedHaswell.td located under the X86 Target.
We used the scheduling information retrieved from the Haswell architects in order to replace and modify the existing scheduling.
The patch continues the scheduling replacement effort started with the SNB target in r307529 and r310792.
Information includes latency, number of micro-Ops and used ports by each HSW instruction.
Please expect some performance fluctuations due to code alignment effects.
Reviewers: RKSimon, zvi, aymanmus, craig.topper, m_zuckerman, igorb, dim, chandlerc, aaboud
Differential Revision: https://reviews.llvm.org/D36663
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@311879
91177308-0d34-0410-b5e6-
96231b3b80d8
NAKAMURA Takumi [Mon, 28 Aug 2017 07:48:37 +0000 (07:48 +0000)]
Prune whitespaces in blank lines.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@311876
91177308-0d34-0410-b5e6-
96231b3b80d8
NAKAMURA Takumi [Mon, 28 Aug 2017 06:47:47 +0000 (06:47 +0000)]
Untabify.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@311875
91177308-0d34-0410-b5e6-
96231b3b80d8
Craig Topper [Mon, 28 Aug 2017 05:14:38 +0000 (05:14 +0000)]
[X86] Use getUnpackl helper to create an ISD::VECTOR_SHUFFLE instead of using X86ISD::UNPCKL in reduceVMULWidth.
This runs fairly early, we should use target independent nodes if possible.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@311873
91177308-0d34-0410-b5e6-
96231b3b80d8
Craig Topper [Mon, 28 Aug 2017 04:29:08 +0000 (04:29 +0000)]
[X86] Add an early out to combineLoopMAddPattern and combineLoopSADPattern when SSE2 is disabled.
Without this the madd.ll and sad.ll test cases both throw assertions if you run them with SSE2 disabled.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@311872
91177308-0d34-0410-b5e6-
96231b3b80d8
Lang Hames [Mon, 28 Aug 2017 03:36:46 +0000 (03:36 +0000)]
[Error] Add a handleExpected utility.
handleExpected is similar to handleErrors, but takes an Expected<T> as its first
input value and a fallback functor as its second, followed by an arbitary list
of error handlers (equivalent to the handler list of handleErrors). If the first
input value is a success value then it is returned from handleErrors
unmodified. Otherwise the contained error(s) are passed to handleErrors, along
with the handlers. If handleErrors returns success (indicating that all errors
have been handled) then handleExpected runs the fallback functor and returns its
result. If handleErrors returns a failure value then the failure value is
returned and the fallback functor is never run.
This simplifies the process of re-trying operations that return Expected values.
Without this utility such retry logic is cumbersome as the internal Error must
be explicitly extracted from the Expected value, inspected to see if its
handleable and then consumed:
enum FooStrategy { Aggressive, Conservative };
Expected<Foo> tryFoo(FooStrategy S);
Expected<Foo> Result;
(void)!!Result; // "Check" Result so that it can be safely overwritten.
if (auto ValOrErr = tryFoo(Aggressive))
Result = std::move(ValOrErr);
else {
auto Err = ValOrErr.takeError();
if (Err.isA<HandleableError>()) {
consumeError(std::move(Err));
Result = tryFoo(Conservative);
} else
return std::move(Err);
}
with handleExpected, this can be re-written as:
auto Result =
handleExpected(
tryFoo(Aggressive),
[]() { return tryFoo(Conservative); },
[](HandleableError&) { /* discard to handle */ });
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@311870
91177308-0d34-0410-b5e6-
96231b3b80d8
Dehao Chen [Sun, 27 Aug 2017 22:22:39 +0000 (22:22 +0000)]
revert r310985 which breaks for the following case:
struct string {
~string();
};
void f2();
void f1(int) { f2(); }
void run(int c) {
string body;
while (true) {
if (c)
f1(c);
else
f1(c);
}
}
Will recommit once the issue is fixed.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@311864
91177308-0d34-0410-b5e6-
96231b3b80d8
Petar Jovanovic [Sun, 27 Aug 2017 21:07:24 +0000 (21:07 +0000)]
[mips] Generate NMADD and NMSUB instructions when fneg node is present
This patch enables generation of NMADD and NMSUB instructions when fneg node
is present. These instructions are currently only generated if fsub node is
present.
Patch by Stanislav Ocovaj.
Differential Revision: https://reviews.llvm.org/D34507
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@311862
91177308-0d34-0410-b5e6-
96231b3b80d8
Javed Absar [Sun, 27 Aug 2017 20:38:28 +0000 (20:38 +0000)]
[ARM] Tidy-up condition-code support functions
Move condition code support functions to Utils and remove code duplication.
Reviewed by: @fhahn, @asb
Differential Revision: https://reviews.llvm.org/D37179
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@311860
91177308-0d34-0410-b5e6-
96231b3b80d8
Craig Topper [Sun, 27 Aug 2017 19:03:36 +0000 (19:03 +0000)]
[AVX512] Add more patterns for using masked moves for subvector extracts of the lowest subvector. This time with bitcasts between the vselect and the extract.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@311856
91177308-0d34-0410-b5e6-
96231b3b80d8
Sanjay Patel [Sun, 27 Aug 2017 17:29:30 +0000 (17:29 +0000)]
[DAGCombiner] allow undef shuffle operands when eliminating bitcasts (PR34111)
As noted in the FIXME, this could be improved more, but this is the smallest fix
that helps:
https://bugs.llvm.org/show_bug.cgi?id=34111
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@311853
91177308-0d34-0410-b5e6-
96231b3b80d8
Sanjay Patel [Sun, 27 Aug 2017 17:15:49 +0000 (17:15 +0000)]
[x86] add haddps test for PR34111; NFC
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@311852
91177308-0d34-0410-b5e6-
96231b3b80d8
Javed Absar [Sun, 27 Aug 2017 14:46:57 +0000 (14:46 +0000)]
[ARM] Tidy-up ARMAsmParser. NFC.
Simplify getDRegFromQReg function
Reviewed by: @fhahn, @asb
Differential Revision: https://reviews.llvm.org/D37118
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@311850
91177308-0d34-0410-b5e6-
96231b3b80d8
Ayal Zaks [Sun, 27 Aug 2017 12:55:46 +0000 (12:55 +0000)]
[LV] Fix PR34248 - recommit D32871 after revert r311304
Original commit r311077 of D32871 was reverted in r311304 due to failures
reported in PR34248.
This recommit fixes PR34248 by restricting the packing of predicated scalars
into vectors only when vectorizing, avoiding doing so when unrolling w/o
vectorizing. Added a test derived from the reproducer of PR34248.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@311849
91177308-0d34-0410-b5e6-
96231b3b80d8