Commit Graph

259456 Commits

Author SHA1 Message Date
Kyle Butt 336c78fdbe CodeGen: BlockPlacement: Add comment about DenseMap Safety.
The use of a DenseMap in precomputeTriangleChains does not cause
non-determinism, even though it is iterated over, as the only thing the
iteration does is to insert entries into a new DenseMap, which is not iterated.
Comment only change.

llvm-svn: 300088
2017-04-12 18:30:32 +00:00
Rui Ueyama 5c5bc7bc0a Accept not only lld-link but also LLD-LINK, for example.
Filenames are case-insensitive on Windows, so when we dispatch based
on argv0, we need to handle it case-insensitively.

Fixes https://bugs.llvm.org/show_bug.cgi?id=32637.

llvm-svn: 300087
2017-04-12 18:29:52 +00:00
Peter Collingbourne 94baec6ee8 llvm-lto2: Add a dump-symtab subcommand.
This allows us to test the symbol table APIs for LTO input files.

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

llvm-svn: 300086
2017-04-12 18:27:00 +00:00
Craig Topper f35a7f7b49 [InstCombine] In SimplifyMultipleUseDemandedBits, use a switch instead of cascaded ifs on opcode. NFC
llvm-svn: 300085
2017-04-12 18:25:25 +00:00
Craig Topper 9a51c7f343 [InstCombine] Teach SimplifyDemandedInstructionBits that even if we reach an instruction that has multiple uses, if we know all the bits for the demanded bits for this context we can go ahead and create a constant.
Currently if we reach an instruction with multiples uses we know we can't do any optimizations to that instruction itself since we only have the demanded bits for one of the users. But if we know all of the bits are zero/one for that one user we can still go ahead and create a constant to give to that user.

This might then reduce the instruction to having a single use and allow additional optimizations on the other path.

This picks up an additional case that r300075 didn't catch.

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

llvm-svn: 300084
2017-04-12 18:17:46 +00:00
Matthias Braun 99551053bd MachineScheduler: Skip acyclic latency heuristic for in-order cores
The current heuristic is triggered on `InFlightCount > BufferLimit`
which isn't really helpful on in-order cores where BufferLimit is zero.

Note that we already get latency hiding effects for in order cores
by instructions staying in the pending queue on stalls; The additional
latency scheduling heuristics only have minimal effects after that while
occasionally increasing register pressure too much resulting in extra
spills.

My motivation here is additional spills/reloads ending up in a loop in
464.h264ref / BlockMotionSearch function resulting in a 4% overal
regression on an in order core. rdar://30264380

llvm-svn: 300083
2017-04-12 18:09:05 +00:00
Craig Topper b0076fe8b4 [InstCombine] Move portion of SimplifyDemandedUseBits that deals with instructions with multiple uses out to a separate method. NFCI
llvm-svn: 300082
2017-04-12 18:05:21 +00:00
Renato Golin af3bc2089e [SystemZ] Fix more target specific tests
llvm-svn: 300081
2017-04-12 18:03:09 +00:00
Francis Ricci e9438b35aa Fix memory leaks in address sanitizer darwin tests
Summary: These leaks are detected by leak sanitizer for darwin.

Reviewers: glider, kubamracek, kcc, alekseyshl

Subscribers: llvm-commits

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

llvm-svn: 300080
2017-04-12 17:31:41 +00:00
Stephan T. Lavavej a4961fe8ef [libcxx] [test] Avoid Clang's -Wunused-const-variable in is_constructible.pass.cpp.
This happens when using Clang with MSVC's STL, so there are no actual uses of this variable.

Fixes D31966.

llvm-svn: 300079
2017-04-12 17:16:38 +00:00
Renato Golin ab85113a93 [SystemZ] Fix target specific tests
llvm-svn: 300078
2017-04-12 17:14:46 +00:00
Krasimir Georgiev 95ef171797 [clangd] Rename ClangDMain.cpp -> ClangdMain.cpp, NFC
llvm-svn: 300077
2017-04-12 17:13:08 +00:00
Dmitry Preobrazhensky 14104e0d0f [AMDGPU][MC] Added support for several VI-specific opcodes (s_wakeup, etc)
Added support for VI:

- s_endpgm_saved
- s_wakeup
- s_rfe_restore_b64
- v_perm_b32

Enabled for VI:

- v_mov_fed_b32
- v_mov_fed_b32_e64

See bug 32593: https://bugs.llvm.org//show_bug.cgi?id=32593

Reviewers: artem.tamazov, vpykhtin

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

llvm-svn: 300076
2017-04-12 17:10:07 +00:00
Craig Topper 845033a6c9 Teach SimplifyDemandedUseBits that adding or subtractings 0s from every bit below the highest demanded bit can be simplified
If we are adding/subtractings 0s below the highest demanded bit we can just use the other operand and remove the operation.

My primary motivation is observing that we can call ShrinkDemandedConstant for the add/sub and create a 0 constant, rather than removing the add completely. In the case I saw, we modified the constant on an add instruction to a 0, but the add is not put into the worklist. So we didn't revisit it until the next InstCombine iteration. This caused an IR modification to remove add and a subsequent iteration to be ran.

With this change we get bypass the add in the first iteration and prevent the second iteration from changing anything.

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

llvm-svn: 300075
2017-04-12 16:49:59 +00:00
Hans Wennborg 227077613a Revert r300001 "Revert r298824 & r298816, recommit r298742 & r298754"
It caused PR32640.

llvm-svn: 300074
2017-04-12 16:40:26 +00:00
Dmitry Preobrazhensky 5ac9fd64a3 [AMDGPU][MC] Corrected parsing of v_cmp_class* and v_cmpx_class*
Fixed bug 32565: https://bugs.llvm.org//show_bug.cgi?id=32565

Reviewers: vpykhtin

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

llvm-svn: 300073
2017-04-12 16:31:18 +00:00
Derek Schuff 0db0ca3837 [WebAssembly] Update use of Attributes after r299875
This fixes the failing WebAssemblyLowerEmscriptenEHSjLj tests

llvm-svn: 300072
2017-04-12 16:03:00 +00:00
Aaron Ballman 58e0806443 Moving a C++ test out of Sema and into SemaCXX; NFC.
llvm-svn: 300071
2017-04-12 15:56:02 +00:00
Dmitry Preobrazhensky 3bff0c8c59 [AMDGPU][MC] Corrected encoding of V_MQSAD_U32_U8 for CI
Corrected encoding of V_MQSAD_U32_U8 for CI

See bug 32552: https://bugs.llvm.org//show_bug.cgi?id=32552

Reviewers: vpykhtin

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

llvm-svn: 300070
2017-04-12 15:36:09 +00:00
Easwaran Raman 02a0e91831 Fix the bootstrap failure caused by r299986.
llvm-svn: 300069
2017-04-12 15:26:15 +00:00
Sanjay Patel bd0d0068ef [x86] fix AVX FP cmp intrinsic documentation (PR28110)
This copies the text used in the #define statements to the code comments. 
The conflicting text comes from AMD manuals, but those are wrong. Sadly, 
that FP cmp text has not been updated even after some docs were updated 
for Zen:
http://support.amd.com/en-us/search/tech-docs 
( AMD64 Architecture Programmer's Manual Volume 4 )

See PR28110 for more discussion:
https://bugs.llvm.org/show_bug.cgi?id=28110

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

llvm-svn: 300068
2017-04-12 15:19:08 +00:00
Sanjay Patel 33439f982b [InstCombine] morph an existing instruction instead of creating a new one
One potential way to make InstCombine (very slightly?) faster is to recycle instructions 
when possible instead of creating new ones. It's not explicitly stated AFAIK, but we don't
consider this an "InstSimplify". We could, however, make a new layer to house transforms 
like this if that makes InstCombine more manageable (just throwing out an idea; not sure 
how much opportunity is actually here).

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

llvm-svn: 300067
2017-04-12 15:11:33 +00:00
Dmitry Preobrazhensky 7184c44d66 [AMDGPU][MC] Corrected ds_wrxchg2* to support two offsets
Fixed bug 28227: https://bugs.llvm.org//show_bug.cgi?id=28227

Reviewers: vpykhtin

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

llvm-svn: 300066
2017-04-12 14:29:45 +00:00
Francis Ricci f518c75641 Use 0-padding for i386 and arm print format specifiers
Summary:
This is used for the other architectures in print_address, but is
missing from i386 and arm.

Reviewers: m.ostapenko, spetrovic

Subscribers: aemerson, rengolin, llvm-commits, kubamracek

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

llvm-svn: 300065
2017-04-12 14:25:28 +00:00
Jonas Paulsson 4707015d46 Fix a RUN line in new test.
Use '2>&1 |' and not '|&' to pipe debug output to FileCheck

Hopefully handles a "shell parser error" on
llvm-clang-x86_64-expensive-checks-win

test/Transforms/SLPVectorizer/SystemZ/SLP-cmp-cost-query.ll

llvm-svn: 300064
2017-04-12 14:25:08 +00:00
Serge Pavlov 2757afdb85 Remove redundant type casts
llvm-svn: 300063
2017-04-12 14:13:00 +00:00
Ed Maste e544379b30 Fix detection of backtrace() availability on FreeBSD
On FreeBSD backtrace is not part of libc and depends on libexecinfo
being available. Instead of using manual checks we can use the builtin
CMake module FindBacktrace.cmake to detect availability of backtrace()
in a portable way.

Patch By:	Alex Richardson
Differential Revision:	https://reviews.llvm.org/D27143

llvm-svn: 300062
2017-04-12 13:51:00 +00:00
Jonas Paulsson 22776892c9 [SLPVectorizer] Pass the right type argument to getCmpSelInstrCost()
In getEntryCost(), make the scalar type for a compare instruction that of the
operands, not i1. This is needed in order to call getCmpSelInstrCost() for a
compare in a sensible way, the same way as the LoopVectorizer does.

New test: test/Transforms/SLPVectorizer/SystemZ/SLP-cmp-cost-query.ll

Review: Matthew Simpson
https://reviews.llvm.org/D31601

llvm-svn: 300061
2017-04-12 13:29:25 +00:00
Benjamin Kramer 33580692f6 [MachineBlockPlacment] Add an assert to ensure there is no order dependency on DenseMap iteration order.
llvm-svn: 300060
2017-04-12 13:26:31 +00:00
Benjamin Kramer d71461c209 [MachineBlockPlacement] Clean up data structures a bit.
No functionality change intended.

llvm-svn: 300059
2017-04-12 13:26:28 +00:00
Jonas Paulsson 592dbea779 [LoopVectorizer] Improve handling of branches during cost estimation.
The cost for a branch after vectorization is very different depending on if
the vectorizer will if-convert the block (branch is eliminated), or if
scalarized and predicated blocks will be produced (branch duplicated before
each block). There is also the case of remaining scalar branches, such as the
back-edge branch.

This patch handles these cases differently with TTI based cost estimates.

Review: Matthew Simpson
https://reviews.llvm.org/D31175

llvm-svn: 300058
2017-04-12 13:13:15 +00:00
Igor Breger 3b97ea39e7 [GlobalIsel][X86] support G_CONSTANT selection.
Summary: [GlobalISel][X86] support G_CONSTANT selection. Add regbank select tests.

Reviewers: zvi, guyblank

Reviewed By: guyblank

Subscribers: llvm-commits, dberris, rovka, kristof.beyls

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

llvm-svn: 300057
2017-04-12 12:54:54 +00:00
Jonas Paulsson da74ed42da [LoopVectorizer, TTI] New method supportsEfficientVectorElementLoadStore()
Since SystemZ supports vector element load/store instructions, there is no
need for extracts/inserts if a vector load/store gets scalarized.

This patch lets Target specify that it supports such instructions by means of
a new TTI hook that defaults to false.

The use for this is in the LoopVectorizer getScalarizationOverhead() method,
which will with this patch produce a smaller sum for a vector load/store on
SystemZ.

New test: test/Transforms/LoopVectorize/SystemZ/load-store-scalarization-cost.ll

Review: Adam Nemet
https://reviews.llvm.org/D30680

llvm-svn: 300056
2017-04-12 12:41:37 +00:00
Dmitry Preobrazhensky 12194e9bec [AMDGPU][MC] Corrected src0 size for s_cbranch_join
Fix for bug 28159: https://bugs.llvm.org//show_bug.cgi?id=28159

Reviewers: vpykhtin, arsenm

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

llvm-svn: 300055
2017-04-12 12:40:19 +00:00
Pavel Labath f0565cc84a Add libc++ category to the remaining libc++ data formatters
llvm-svn: 300054
2017-04-12 12:32:58 +00:00
Jonas Paulsson 9b4875434e [SystemZ] Updated test fp-cast.ll
This did not get included in the previous commit for SystemZ cost functions.

llvm-svn: 300053
2017-04-12 12:11:41 +00:00
Jonas Paulsson fccc7d66c3 [SystemZ] TargetTransformInfo cost functions implemented.
getArithmeticInstrCost(), getShuffleCost(), getCastInstrCost(),
getCmpSelInstrCost(), getVectorInstrCost(), getMemoryOpCost(),
getInterleavedMemoryOpCost() implemented.

Interleaved access vectorization enabled.

BasicTTIImpl::getCastInstrCost() improved to check for legal extending loads,
in which case the cost of the z/sext instruction becomes 0.

Review: Ulrich Weigand, Renato Golin.
https://reviews.llvm.org/D29631

llvm-svn: 300052
2017-04-12 11:49:08 +00:00
Krasimir Georgiev 4ed589d8d6 [DWARF] Fix compiler warnings in DWARFContext.cpp, NFCi
llvm-svn: 300051
2017-04-12 11:33:26 +00:00
Piotr Padlewski aa1b24124e [LangRef] fix documentation
llvm-svn: 300050
2017-04-12 11:18:19 +00:00
Alex Lorenz 53b4b1846d Add support for __builtin_available to __has_builtin
rdar://31576715

llvm-svn: 300049
2017-04-12 11:03:25 +00:00
Pavel Labath da7b15df70 Fix TestCppIncompleteTypes for android/clang
LDFLAGS contains some .a files. If it is specified before the relevant
object files, undefined symbol errors occur.

llvm-svn: 300048
2017-04-12 10:59:34 +00:00
Pavel Labath d3656a03ab Fix libc++ vector<bool> data formatter (bug #32553)
Summary:
The iteration list through the available data formatters was undefined,
which meant that the vector<bool> formatter kicked in only in cases
where it happened to be queried before the general vector formatter. To
fix this, I merge the two data formatter entries into one, and select
which implementation to use in the factory function.

Reviewers: jasonmolenda, tberghammer, EricWF

Subscribers: lldb-commits

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

llvm-svn: 300047
2017-04-12 10:59:24 +00:00
Pavel Labath 74207ad7ba Fix TestGuessLanguage for gcc
gcc emits DW_LANG_C89 even if we specify -std=c99 during compilation.
Since this isn't an lldb bug, but just the way the compiler happens to
be implemented, I teach the test to expect this situation correctly.

llvm-svn: 300046
2017-04-12 10:13:50 +00:00
Pavel Labath efe4e412ad Android.rules: setup correct objcopy path
This fixes a couple of tests when using android clang as a compiler.

llvm-svn: 300045
2017-04-12 10:13:47 +00:00
Renato Golin baf04f92bc [LSAN] Disable on ARM/Thumb for good
I didn't pay enough attention to the patch I reverted, now I'm going to
hit it with a bigger hammer until we can understand what the problems
are.

llvm-svn: 300044
2017-04-12 10:12:49 +00:00
Yaron Keren 31bde5863f Rangify for loop, NFC.
llvm-svn: 300043
2017-04-12 10:05:48 +00:00
Renato Golin c6c8f09e49 Revert "[lsan] Fix typo in test/lsan/lit.common.cfg"
This reverts commit r299957. It broke the Thumb bots. We need to make
sure why and maybe stop it from being tested on Thumb environments. But
for now, let's get the bots green.

llvm-svn: 300042
2017-04-12 09:45:08 +00:00
Ismail Donmez d063db71e3 Fix compile error
llvm-svn: 300041
2017-04-12 09:42:46 +00:00
Sam Kolton aff8341da2 [AMDGPU] SDWA: make pass global
Summary: Remove checks for basic blocks.

Reviewers: vpykhtin, rampitec, arsenm

Subscribers: kzhuravl, wdng, nhaehnle, yaxunl, dstuttard, tpr, t-tye

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

llvm-svn: 300040
2017-04-12 09:36:05 +00:00
George Rimar 702dac6d35 [DWARF] - Refactoring of DWARFContextInMemory implementation.
This change is basically relative to D31136, where I initially wanted to
implement some relocations handling optimization which shows it can give
significant boost. Though even without any caching algorithm looks
code can have some cleanup at first.

Refactoring separates out code for taking symbol address, used in relocations
computation.

Differential revision: https://reviews.llvm.org/D31747

llvm-svn: 300039
2017-04-12 08:59:15 +00:00