Jim Ingham [Fri, 5 Aug 2016 22:06:12 +0000 (22:06 +0000)]
Add a few more needed bits to the scripted thread plans.
llvm-svn: 277879
Justin Bogner [Fri, 5 Aug 2016 21:57:10 +0000 (21:57 +0000)]
CodeView: Remove an unused variable
It was breaking the -Werror build.
llvm-svn: 277878
Michael Zolotukhin [Fri, 5 Aug 2016 21:52:58 +0000 (21:52 +0000)]
[LoopSimplify] Fix updating LCSSA after separating nested loops.
This fixes PR28825. The problem was that we only checked if a value from
a created inner loop is used in the outer loop, and fixed LCSSA for
them. But we missed to fixup LCSSA for values used in exits of the outer
loop.
llvm-svn: 277877
Zachary Turner [Fri, 5 Aug 2016 21:50:02 +0000 (21:50 +0000)]
Fix non portable include path.
llvm-svn: 277876
Justin Bogner [Fri, 5 Aug 2016 21:49:54 +0000 (21:49 +0000)]
PowerPC: Add a triple to this test
This is running opt without specifying a triple, which isn't correct.
llvm-svn: 277875
Reid Kleckner [Fri, 5 Aug 2016 21:47:46 +0000 (21:47 +0000)]
Fix two tests in Win64 ASan
Go back to intercepting kernel32!RaiseException, and only go for
ntdll!RtlRaiseException if that fails. Fixes throw_and_catch.cc test.
Work around an issue in LLVM's win64 epilogues. We end up with an
epilogue that looks like this, and it drives the Win64 unwinder crazy
until stack overflow:
call ill_cc!__asan_handle_no_return
xor eax,eax
add rsp,40h // epilogue starts
pop rbp // CSR
ud2 // Trap here
ret // Ret?
nop word ptr [rax+rax]
sub rsp,28h // Next function
Will file a PR soon.
llvm-svn: 277874
Daniel Berlin [Fri, 5 Aug 2016 21:47:20 +0000 (21:47 +0000)]
[MSSA] Match assert vs llvm_unreachable style in verification functions.
llvm-svn: 277873
Daniel Berlin [Fri, 5 Aug 2016 21:46:52 +0000 (21:46 +0000)]
Rewrite domination verifier to handle local domination as well.
Summary:
Rewrite domination verifier to handle local domination as well.
This catches a bug Geoff Berry noticed.
Reviewers: george.burgess.iv
Subscribers: llvm-commits
Differential Revision: https://reviews.llvm.org/D23184
llvm-svn: 277872
Zachary Turner [Fri, 5 Aug 2016 21:45:34 +0000 (21:45 +0000)]
[CodeView] Decouple record deserialization from visitor dispatch.
Until now, our use case for the visitor has been to take a stream of bytes
representing a type stream, deserialize the records in sequence, and do
something with them, where "something" is determined by how the user
implements a particular set of callbacks on an abstract class.
For actually writing PDBs, however, we want to do the reverse. We have
some kind of description of the list of records in their in-memory format,
and we want to process each one. Perhaps by serializing them to a byte
stream, or perhaps by converting them from one description format (Yaml)
to another (in-memory representation).
This was difficult in the current model because deserialization and
invoking the callbacks were tightly coupled.
With this patch we change this so that TypeDeserializer is itself an
implementation of the particular set of callbacks. This decouples
deserialization from the iteration over a list of records and invocation
of the callbacks. TypeDeserializer is initialized with another
implementation of the callback interface, so that upon deserialization it
can pass the deserialized record through to the next set of callbacks. In
a sense this is like an implementation of the Decorator design pattern,
where the Deserializer is a decorator.
This will be useful for writing Pdbs from yaml, where we have a
description of the type records in Yaml format. In this case, the visitor
implementation would have each visitation callback method implemented in
such a way as to extract the proper set of fields from the Yaml, and it
could maintain state that builds up a list of these records. Finally at
the end we can pass this information through to another set of callbacks
which serializes them into a byte stream.
Reviewed By: majnemer, ruiu, rnk
Differential Revision: https://reviews.llvm.org/D23177
llvm-svn: 277871
Zachary Turner [Fri, 5 Aug 2016 21:45:19 +0000 (21:45 +0000)]
Make YAML support SmallVector
Currently YAML sequences require std::vectors. All of the methods that the
YAML parser accesses though are present in SmallVector, so there's no
reason we can't support SmallVector inherently. This patch does that.
Reviewed By: majnemer
Differential Revision: https://reviews.llvm.org/D23213
llvm-svn: 277870
Pete Cooper [Fri, 5 Aug 2016 21:37:12 +0000 (21:37 +0000)]
ExportTrie nodes need to be visisted in order.
The export trie was being emitted in the order the nodes were
added to the vector, but instead needs to be visited in the order
that the nodes are traversed. This matches the behaviour of ld64.
llvm-svn: 277869
Saleem Abdulrasool [Fri, 5 Aug 2016 21:35:28 +0000 (21:35 +0000)]
unwind: disable executable stacks
Similar to compiler-rt, ensure that we disable executable stacks for the custom
assembly.
llvm-svn: 277868
Marek Olsak [Fri, 5 Aug 2016 21:23:29 +0000 (21:23 +0000)]
AMDGPU/SI: Increase SGPR limit to 96 on Tonga/Iceland
Summary:
This is the setting of the Vulkan closed source driver.
It decreases the max wave count from 10 to 8.
26010 shaders in 14650 tests
Totals:
VGPRS: 829593 -> 808440 (-2.55 %)
Spilled SGPRs: 81878 -> 42226 (-48.43 %)
Spilled VGPRs: 367 -> 358 (-2.45 %)
Scratch VGPRs: 1764 -> 1748 (-0.91 %) dwords per thread
Code Size:
36677864 ->
35923932 (-2.06 %) bytes
There is a massive decrease in SGPR spilling in general and -7.4% spilled
VGPRs for DiRT Showdown (= SGPRs spilled to scratch?)
Reviewers: arsenm, tstellarAMD, nhaehnle
Subscribers: arsenm, llvm-commits, kzhuravl
Differential Revision: https://reviews.llvm.org/D23034
llvm-svn: 277867
Richard Trieu [Fri, 5 Aug 2016 21:02:34 +0000 (21:02 +0000)]
Fix false positive in -Wunsequenced and templates.
For builtin logical operators, there is a well-defined ordering of argument
evaluation. For overloaded operator of the same type, there is no argument
evaluation order, similar to other function calls. When both are present,
uninstantiated templates with an operator&& is treated as an unresolved
function call. Unresolved function calls are treated as normal function calls,
and may result in false positives when the builtin logical operator is used.
Have the unsequenced checker ignore dependent expressions to avoid this
false positive. The check also happens in template instantiations to catch
when the overloaded operator is used.
llvm-svn: 277866
Weiming Zhao [Fri, 5 Aug 2016 20:58:29 +0000 (20:58 +0000)]
[ARM] Constant Materialize: imms with specific value can be encoded into mov.w
Summary: Thumb2 supports encoding immediates with specific patterns into mov.w by splatting the low 8 bits into other bytes.
I'm resubmitting this patch. The test case in the original commit
r277610 does not specify triple, so builds with differnt default triple
will have different output.
This patch fixed trile as thumb-darwin-apple.
Reviewers: john.brawn, jmolloy, bruno
Subscribers: jmolloy, aemerson, rengolin, samparker, llvm-commits
Differential Revision: https://reviews.llvm.org/D23090
llvm-svn: 277865
Davide Italiano [Fri, 5 Aug 2016 20:53:35 +0000 (20:53 +0000)]
[FlattenCFG] Simplify + remove unused variable. NFCI.
llvm-svn: 277864
Dehao Chen [Fri, 5 Aug 2016 20:49:04 +0000 (20:49 +0000)]
Remove cold callsite heuristic that is not necessary because of cold callee heuristic.
llvm-svn: 277863
Mike Aizatsky [Fri, 5 Aug 2016 20:48:48 +0000 (20:48 +0000)]
[sanitizers] remove failing test.
The test often fails on Windows because there are more branches
in the code that is generated.
llvm-svn: 277862
Sanjoy Das [Fri, 5 Aug 2016 20:33:49 +0000 (20:33 +0000)]
[SCEV] Un-grep'ify tests; NFC
llvm-svn: 277861
Dehao Chen [Fri, 5 Aug 2016 20:28:41 +0000 (20:28 +0000)]
Replace hot-callsite based heuristic to use its own threshold parameter instead of share inline-hint parameter
Summary: Hot callsites should have higher threshold than inline hints. This patch uses separate threshold parameter for hot callsites.
Reviewers: davidxl, eraman
Subscribers: Prazek, llvm-commits
Differential Revision: https://reviews.llvm.org/D22368
llvm-svn: 277860
Mike Aizatsky [Fri, 5 Aug 2016 20:09:53 +0000 (20:09 +0000)]
[sanitizers] trace buffer API to use user-allocated buffer.
Differential Revision: https://reviews.llvm.org/D23185
llvm-svn: 277859
Mike Aizatsky [Fri, 5 Aug 2016 20:09:42 +0000 (20:09 +0000)]
[sanitizers] trace buffer API to use user-allocated buffer.
Subscribers: kubabrecka
Differential Revision: https://reviews.llvm.org/D23186
llvm-svn: 277858
Mehdi Amini [Fri, 5 Aug 2016 19:51:00 +0000 (19:51 +0000)]
Update outdated comments in the new PM internals (NFC)
The analysis manager was made not optional and turned into a
reference instead of a pointer in r272978. Some comments were
still refering to the previous behavior.
llvm-svn: 277857
Ivan Krasin [Fri, 5 Aug 2016 19:45:16 +0000 (19:45 +0000)]
WholeProgramDevirt: print remarks with devirtualized method names.
Summary:
Chrome on Linux uses WholeProgramDevirt for speed ups, and it's
important to detect regressions on both sides: the toolchain,
if fewer methods get devirtualized after an update, and Chrome,
if an innocently looking change caused many hot methods become
virtual again.
The need to track devirtualized methods is not Chrome-specific,
but it's probably the only user of the pass at this time.
Reviewers: kcc
Differential Revision: https://reviews.llvm.org/D23219
llvm-svn: 277856
David Callahan [Fri, 5 Aug 2016 19:38:11 +0000 (19:38 +0000)]
[ADCE] Refactoring for new functionality (NFC)
Summary:
This is another refactoring to break up the one function into three logical components functions.
Another non-functional change before we start added in features.
Reviewers: nadav, mehdi_amini, majnemer
Subscribers: twoh, freik, llvm-commits
Differential Revision: https://reviews.llvm.org/D23102
llvm-svn: 277855
Sanjoy Das [Fri, 5 Aug 2016 19:23:29 +0000 (19:23 +0000)]
[ConstantFolding] Don't create illegal (non-integral) inttoptrs
Reviewers: majnemer, arsenm
Subscribers: mcrosier, llvm-commits
Differential Revision: https://reviews.llvm.org/D23182
llvm-svn: 277854
Sanjay Patel [Fri, 5 Aug 2016 19:09:25 +0000 (19:09 +0000)]
fix documentation comments; NFC
llvm-svn: 277853
David Blaikie [Fri, 5 Aug 2016 19:03:01 +0000 (19:03 +0000)]
PR26423: Assert on valid use of using declaration of a function with an undeduced auto return type
For now just disregard the using declaration in this case. Suboptimal,
but wiring up the ability to have declarations of functions that are
separate from their definition (we currently only do that for member
functions) and have differing return types (we don't have any support
for that) is more work than seems reasonable to at least fix this crash.
llvm-svn: 277852
Etienne Bergeron [Fri, 5 Aug 2016 18:49:08 +0000 (18:49 +0000)]
fix random typos [NFC]
llvm-svn: 277850
David Callahan [Fri, 5 Aug 2016 18:38:19 +0000 (18:38 +0000)]
[AutoFDO] Fix handling of empty profiles
Summary:
If a profile has no samples for a function, then the function "entry count" is set to the value 0. Several places in the code test that if the Function::getEntryCount is defined at all. Here we change to treat a 0 entry count the same as undefined.
In particular, this fixes a problem in getLayoutSuccessorProbThreshold in MachineBlockPlacement.cpp where we use a different and inferior heuristic for laying out basic blocks.
Reviewers: danielcdh, dnovillo
Subscribers: llvm-commits
Differential Revision: https://reviews.llvm.org/D23082
llvm-svn: 277849
Sanjoy Das [Fri, 5 Aug 2016 18:34:14 +0000 (18:34 +0000)]
[SCEV] Don't infinitely recurse on unreachable code
llvm-svn: 277848
Lang Hames [Fri, 5 Aug 2016 18:26:56 +0000 (18:26 +0000)]
[ORC] Change LogicalDylib::LogicalModuleHandle from an iterator to an index.
This prevents handles from being invalidated (through iterator invalidation)
when new modules are added.
No test-case yet: This bug was uncovered during work on an upcoming patch for
weak symbol support and the testcase for that feature will implicitly test for
correct behavior here.
llvm-svn: 277847
Saleem Abdulrasool [Fri, 5 Aug 2016 18:20:31 +0000 (18:20 +0000)]
COFF ARM: Apply an existing offset in MOV32T relocations
Don't blindly OR in the new value, but clear the existing one, since it can be
nonzero. Read out the existing value before, and add into the desired offset.
(The add is done outside of the applyMOV, to handle potential overflow between
the two.)
Patch by Martin Storsjö!
llvm-svn: 277846
Kevin Enderby [Fri, 5 Aug 2016 18:19:40 +0000 (18:19 +0000)]
Add the first of what will be a long line of additional error checks for invalid Mach-O files.
This is where an LC_SEGMENT load command has a fileoff field that
extends past the end of the file.
Also fix llvm-nm and llvm-size to remove the errorToErrorCode() call so error messages are printed.
And needed to update a few test cases now that they do print the error messages just a
bit differently.
llvm-svn: 277845
Enrico Granata [Fri, 5 Aug 2016 18:09:50 +0000 (18:09 +0000)]
Tweaks to the reporting of "missing dyld shared cached" that make it easier to grab logs when such issues occur, make the logs more helpful, and also tweaks to the user messaging to make it easier to pinpoint an investigation avenue early on
llvm-svn: 277844
Dehao Chen [Fri, 5 Aug 2016 17:56:49 +0000 (17:56 +0000)]
Do not assign new discriminator for all intrinsics.
Summary: We do not care about intrinsic calls when assigning discriminators.
Reviewers: davidxl, dnovillo
Subscribers: llvm-commits
Differential Revision: https://reviews.llvm.org/D23212
llvm-svn: 277843
Reid Kleckner [Fri, 5 Aug 2016 17:55:00 +0000 (17:55 +0000)]
Fix dumping of process module list and test it
I probably broke this a year ago in r243895.
llvm-svn: 277842
Tim Northover [Fri, 5 Aug 2016 17:50:36 +0000 (17:50 +0000)]
GlobalISel: clear pending phis after MachineFunction translated
Test is just reordering the existing functions (it would trigger for any
function after one with a phi).
llvm-svn: 277841
David Majnemer [Fri, 5 Aug 2016 17:44:54 +0000 (17:44 +0000)]
[SemaOpenMP] Some miscellaneous cleanups
Clean up some typos, follow the coding style a little more rigorously.
No functionality change is intended.
llvm-svn: 277840
Simon Pilgrim [Fri, 5 Aug 2016 17:36:14 +0000 (17:36 +0000)]
[X86][SSE] Add initial support for 2 input target shuffle combining.
At the moment only the INSERTPS matching can actually use 2 inputs but the plumbing is now in place.
llvm-svn: 277839
Saleem Abdulrasool [Fri, 5 Aug 2016 17:33:24 +0000 (17:33 +0000)]
COFF ARM: Error out if 24 bit thumb branches are out of range
In the ELF linker, the same situation already errors out with "relocation
R_ARM_THM_CALL out of range".
Patch by Martin Storsjö!
llvm-svn: 277838
Vedant Kumar [Fri, 5 Aug 2016 17:28:28 +0000 (17:28 +0000)]
[asan] Remove unused include (NFC)
llvm-svn: 277837
Saleem Abdulrasool [Fri, 5 Aug 2016 17:28:21 +0000 (17:28 +0000)]
COFF ARM: Clear the J1 and J2 bits when applying relocations to 24 bit branches
The opcode for the bl branches can initially be F000 F800, i.e.
the J1 and J2 bits are already set. Therefore mask these bits out
before or'ing in the new bits.
Patch by Martin Storsjö!
llvm-svn: 277836
Tim Northover [Fri, 5 Aug 2016 17:16:40 +0000 (17:16 +0000)]
GlobalISel: IRTranslate PHI instructions
llvm-svn: 277835
Saleem Abdulrasool [Fri, 5 Aug 2016 16:53:05 +0000 (16:53 +0000)]
builtins: windows has only one flavour on ARM
Windows on ARM is a hard-float only environment. Don't try to build two copies
of the same library.
llvm-svn: 277834
Igor Kudrin [Fri, 5 Aug 2016 16:48:31 +0000 (16:48 +0000)]
Fix gdb pretty printers to work with Python 3.
Differential Revision: https://reviews.llvm.org/D23202
llvm-svn: 277833
Michael Kruse [Fri, 5 Aug 2016 16:45:51 +0000 (16:45 +0000)]
[CodeGen] Use MapVector instead of DenseMap.
The map is iterated over when generating the values escaping the SCoP. The
indeterministic iteration order of DenseMap causes the output IR to change at
every compilation, adding noise to comparisons.
Replace DenseMap by a MapVector to ensure the same iteration order at every
compilation.
llvm-svn: 277832
Zachary Turner [Fri, 5 Aug 2016 16:45:07 +0000 (16:45 +0000)]
Fix TargetParser unit tests for ARM / AArch64.
String pooling is not guaranteed by the standard, so if
you're comparing two different string literals for equality,
you have to use strcmp.
llvm-svn: 277831
Bruno Cardoso Lopes [Fri, 5 Aug 2016 16:41:00 +0000 (16:41 +0000)]
Revert "[Sema] Add sizeof diagnostics for bzero"
This reverts commit r277787, which caused PR28870.
llvm-svn: 277830
Gor Nishanov [Fri, 5 Aug 2016 16:27:33 +0000 (16:27 +0000)]
opt: Adding -O0 to opt tool
Summary:
Having -O0 in opt allows testing that -O0 optimization
pipeline is built correctly.
Reviewers: majnemer
Subscribers: llvm-commits
Differential Revision: https://reviews.llvm.org/D23208
llvm-svn: 277829
Saleem Abdulrasool [Fri, 5 Aug 2016 16:24:56 +0000 (16:24 +0000)]
builtins: better categorisation of Thumb1 builtins
Adjust the builtins to better annotate the Thumb1 routines and their purpose.
Exclude the remaining thumb1 sources on Windows ARM.
llvm-svn: 277828
Jason Henline [Fri, 5 Aug 2016 16:05:44 +0000 (16:05 +0000)]
[StreamExecutor] Add kernel types
Summary: Add StreamExecutor kernel types.
Reviewers: jlebar, tra
Subscribers: parallel_libs-commits
Differential Revision: https://reviews.llvm.org/D23138
llvm-svn: 277827
Reid Kleckner [Fri, 5 Aug 2016 16:01:57 +0000 (16:01 +0000)]
Print a more useful BP value from MSVC-built ASan runtimes
MSVC doesn't have an exact equivalent for __builtin_frame_address, but
_AddressOfReturnAddress() + sizeof(void*) should be equivalent for all
frames build with -fno-omit-frame-pointer.
llvm-svn: 277826
Andrey Churbanov [Fri, 5 Aug 2016 15:59:11 +0000 (15:59 +0000)]
Fixed x2APIC discovery for 256-processor architectures.
Mask for value read from ebx register returned by CPUID expanded to 0xFFFF.
Differential Revision: https://reviews.llvm.org/D23203
llvm-svn: 277825
Wei Ding [Fri, 5 Aug 2016 15:38:46 +0000 (15:38 +0000)]
AMDGPU : Add Clang builtin intrinsics for compare with the full
wavefront result.
Differential Revision: http://reviews.llvm.org/D22934
llvm-svn: 277824
Ulrich Weigand [Fri, 5 Aug 2016 15:22:05 +0000 (15:22 +0000)]
[PowerPC] Wrong fast-isel codegen for VSX floating-point loads
There were two locations where fast-isel would generate a LFD instruction
with a target register class VSFRC instead of F8RC when VSX was enabled.
This can ccause invalid registers to be used in certain cases, like:
lfd 36, ...
instead of using a VSX load instruction. The wrong register number gets
silently truncated, causing invalid code to be generated.
The first place is PPCFastISel::PPCEmitLoad, which had multiple problems:
1.) The IsVSSRC and IsVSFRC flags are not initialized correctly, since they
are computed from resultReg, which is still zero at this point in many cases.
Fixed by changing the helper routines to operate on a register class instead
of a register and passing in UseRC.
2.) Even with this fixed, Is64VSXLoad is still wrong due to a typo:
bool Is32VSXLoad = IsVSSRC && Opc == PPC::LFS;
bool Is64VSXLoad = IsVSSRC && Opc == PPC::LFD;
The second line needs to use isVSFRC (like PPCEmitStore does).
3.) Once both the above are fixed, we're now generating a VSX instruction --
but an incorrect one, since generation of an indexed instruction with null
index is wrong. Fixed by copying the code handling the same issue in
PPCEmitStore.
The second place is PPCFastISel::PPCMaterializeFP, where we would emit an
LFD to load a constant from the literal pool, and use the wrong result
register class. Fixed by hardcoding a F8RC class even on systems
supporting VSX.
Fixes: https://llvm.org/bugs/show_bug.cgi?id=28630
Differential Revision: https://reviews.llvm.org/D22632
llvm-svn: 277823
Zhan Jun Liau [Fri, 5 Aug 2016 15:14:34 +0000 (15:14 +0000)]
[SystemZ] Add missing classes and instructions
Summary:
Add instruction formats E, RSI, SSd, SSE, and SSF.
Added BRXH, BRXLE, PR, MVCK, STRAG, and ECTG instructions to test out
those formats.
Reviewers: uweigand
Subscribers: llvm-commits
Differential Revision: https://reviews.llvm.org/D23179
llvm-svn: 277822
Benjamin Kramer [Fri, 5 Aug 2016 14:58:34 +0000 (14:58 +0000)]
Actually, r277337 was fine. Just kill the DAGs that made the test allow nondeterminism.
llvm-svn: 277821
Benjamin Kramer [Fri, 5 Aug 2016 14:55:02 +0000 (14:55 +0000)]
[SimplifyCFG] Make range reduction code deterministic.
This generated IR based on the order of evaluation, which is different
between GCC and Clang. With that in mind you get bootstrap miscompares
if you compare a Clang built with GCC-built Clang vs. Clang built with
Clang-built Clang. Diagnosing that made my head hurt.
This also reverts commit r277337, which "fixed" the test case.
llvm-svn: 277820
Sanjay Patel [Fri, 5 Aug 2016 14:50:11 +0000 (14:50 +0000)]
reduce tests; auto-generate checks
llvm-svn: 277819
Kelvin Li [Fri, 5 Aug 2016 14:37:37 +0000 (14:37 +0000)]
[OpenMP] Sema and parsing for 'teams distribute' pragma
This patch is to implement sema and parsing for 'teams distribute' pragma.
Differential Revision: https://reviews.llvm.org/D23189
llvm-svn: 277818
Simon Pilgrim [Fri, 5 Aug 2016 14:33:11 +0000 (14:33 +0000)]
[X86][SSE] Update the the target shuffle matches to use the effective mask's value type directly instead of via the input value type.
Preparation for adding 2 input support so we want to avoid unnecessary references to the input value type.
llvm-svn: 277817
Gor Nishanov [Fri, 5 Aug 2016 13:17:06 +0000 (13:17 +0000)]
testing commit access
llvm-svn: 277816
Simon Pilgrim [Fri, 5 Aug 2016 13:02:53 +0000 (13:02 +0000)]
[X86][SSE] Consistently use the target shuffle root value type for vector size calculations. NFCI.
Preparation for adding 2 input support so we want to avoid unnecessary references to the input value type.
llvm-svn: 277814
NAKAMURA Takumi [Fri, 5 Aug 2016 11:59:49 +0000 (11:59 +0000)]
LLLexer.cpp: Avoid using BitsToDouble() to preserve SNaN like "double 0x7FF4000000000000".
We should not use double (or float) in the LLVM, unless it is really needed. x87 FP register doesn't preserve SNaN to move the value.
FIXME: APFloat() may have the constructor by raw bit.
llvm-svn: 277813
NAKAMURA Takumi [Fri, 5 Aug 2016 11:59:45 +0000 (11:59 +0000)]
Reformat.
llvm-svn: 277812
Haojian Wu [Fri, 5 Aug 2016 11:54:34 +0000 (11:54 +0000)]
[include-fixer] Correct some header mappings.
Reviewers: bkramer
Subscribers: cfe-commits
Differential Revision: https://reviews.llvm.org/D23199
llvm-svn: 277811
Michael Kruse [Fri, 5 Aug 2016 11:31:02 +0000 (11:31 +0000)]
[DependenceInfo] Reset operations counter when setting limit.
When entering the dependence computation and the max_operations is set, the
operations counter may have already exceeded the counter, thus aborting any ISL
computation from the start. The counter is reset at the end of the dependence
calculation such that a follow-up recomputation might succeed, ie. the success
of the first dependence calculation depends on unrelated ISL operations that
happened before, giving it a disadvantage to the following calculations.
This patch resets the operations counter at the beginning of the dependence
recalculation to not depend on previous actions. Otherwise additional
preprocessing of the Scop that aims to improve its schedulability (eg. DeLICM)
do have the effect that DependenceInfo and hence the scheduling fail more
likely, contraproductive to the goal of said preprocessing.
llvm-svn: 277810
John Brawn [Fri, 5 Aug 2016 11:17:43 +0000 (11:17 +0000)]
Add a missing backslash to my previous commit
llvm-svn: 277809
Simon Pilgrim [Fri, 5 Aug 2016 11:16:53 +0000 (11:16 +0000)]
[X86][SSE] Added target shuffle combine binary compute matching function. NFCI.
Added matchBinaryPermuteVectorShuffle and moved the blend+zero and insertps matching code into it.
llvm-svn: 277808
John Brawn [Fri, 5 Aug 2016 11:01:08 +0000 (11:01 +0000)]
Reapply r276973 "Adjust Registry interface to not require plugins to export a registry"
This differs from the previous version by being more careful about template
instantiation/specialization in order to prevent errors when building with
clang -Werror. Specifically:
* begin is not defined in the template and is instead instantiated when Head
is. I think the warning when we don't do that is wrong (PR28815) but for now
at least do it this way to avoid the warning.
* Instead of performing template specializations in LLVM_INSTANTIATE_REGISTRY
instead provide a template definition then do explicit instantiation. No
compiler I've tried has problems with doing it the other way, but strictly
speaking it's not permitted by the C++ standard so better safe than sorry.
Original commit message:
Currently the Registry class contains the vestiges of a previous attempt to
allow plugins to be used on Windows without using BUILD_SHARED_LIBS, where a
plugin would have its own copy of a registry and export it to be imported by
the tool that's loading the plugin. This only works if the plugin is entirely
self-contained with the only interface between the plugin and tool being the
registry, and in particular this conflicts with how IR pass plugins work.
This patch changes things so that instead the add_node function of the registry
is exported by the tool and then imported by the plugin, which solves this
problem and also means that instead of every plugin having to export every
registry they use instead LLVM only has to export the add_node functions. This
allows plugins that use a registry to work on Windows if
LLVM_EXPORT_SYMBOLS_FOR_PLUGINS is used.
llvm-svn: 277806
Strahinja Petrovic [Fri, 5 Aug 2016 08:47:26 +0000 (08:47 +0000)]
[PowerPC] fix passing long double arguments to function (soft-float)
This patch fixes passing long double type arguments to function in
soft float mode. If there is less than 4 argument registers free
(long double type is mapped in 4 gpr registers in soft float mode)
long double type argument must be passed through stack.
Differential Revision: https://reviews.llvm.org/D20114.
llvm-svn: 277804
Tobias Grosser [Fri, 5 Aug 2016 08:27:24 +0000 (08:27 +0000)]
GPGPU: Sort dimension sizes of multi-dimensional shared memory arrays correctly
Before this commit we generated the array type in reverse order and we also
added the outermost dimension size to the new array declaration, which is
incorrect as Polly additionally assumed an additional unsized outermost
dimension, such that we had an off-by-one error in the linearization of access
expressions.
llvm-svn: 277802
Nicolai Haehnle [Fri, 5 Aug 2016 08:22:29 +0000 (08:22 +0000)]
[InstCombine] try to fold (select C, (sext A), B) into logical ops
Summary:
Turn (select C, (sext A), B) into (sext (select C, A, B')) when A is i1 and
B is a compatible constant, also for zext instead of sext. This will then be
further folded into logical operations.
The transformation would be valid for non-i1 types as well, but other parts of
InstCombine prefer to have sext from non-i1 as an operand of select.
Motivated by the shader compiler frontend in Mesa for AMDGPU, which emits i32
for boolean operations. With this change, the boolean logic is fully
recovered.
Reviewers: majnemer, spatel, tstellarAMD
Subscribers: llvm-commits
Differential Revision: https://reviews.llvm.org/D22747
llvm-svn: 277801
Tobias Grosser [Fri, 5 Aug 2016 07:08:45 +0000 (07:08 +0000)]
Add missing 'REQUIRES' line
llvm-svn: 277800
Tobias Grosser [Fri, 5 Aug 2016 06:47:43 +0000 (06:47 +0000)]
GPGPU: Add cuda annotations to specify maximal number of threads per block
These annotations ensure that the NVIDIA PTX assembler limits the number of
registers used such that we can be certain the resulting kernel can be executed
for the number of threads in a thread block that we are planning to use.
llvm-svn: 277799
Ivan Krasin [Fri, 5 Aug 2016 03:18:27 +0000 (03:18 +0000)]
Reverting r277632 as it breaks the build on MacOS.
Reviewers: kcc
Differential Revision: https://reviews.llvm.org/D23190
llvm-svn: 277798
Richard Trieu [Fri, 5 Aug 2016 03:16:36 +0000 (03:16 +0000)]
Fix crash in template type diffing.
When the type being diffed is a type alias, and the orginal type is not a
templated type, then there will be no unsugared TemplateSpecializationType.
When this happens, exit early from the constructor. Also add assertions to
the other iterator accessor to prevent the iterator from being used.
llvm-svn: 277797
Richard Trieu [Fri, 5 Aug 2016 02:39:30 +0000 (02:39 +0000)]
Allow -1 to assign max value to unsigned bitfields.
Silence the -Wbitfield-constant-conversion warning for when -1 or other
negative values are assigned to unsigned bitfields, provided that the bitfield
is wider than the minimum number of bits needed to encode the negative value.
llvm-svn: 277796
Ivan Krasin [Fri, 5 Aug 2016 01:45:54 +0000 (01:45 +0000)]
CFI: add XFAIL test for a future optimization of two vcalls.
Summary:
Often, a code will call multiple virtual methods of a given object.
If they go in a linear block, it should be possible to check vtable
before the first call, then store vtable pointer and reuse it for
the second vcall without any additional checks.
This is expected to have a positive performance impact on a hot
path in Blink, see https://crbug.com/634139.
Reviewers: kcc
Differential Revision: https://reviews.llvm.org/D23151
llvm-svn: 277795
Rui Ueyama [Fri, 5 Aug 2016 01:25:45 +0000 (01:25 +0000)]
Simplify. NFC.
llvm-svn: 277794
Justin Bogner [Fri, 5 Aug 2016 01:09:48 +0000 (01:09 +0000)]
InstCombine: Clean up some trailing whitespace. NFC
llvm-svn: 277793
Justin Bogner [Fri, 5 Aug 2016 01:06:44 +0000 (01:06 +0000)]
InstCombine: Replace some never-null pointers with references. NFC
llvm-svn: 277792
Rui Ueyama [Fri, 5 Aug 2016 01:05:01 +0000 (01:05 +0000)]
Move invariants outside of a lambda. NFC.
llvm-svn: 277791
Rui Ueyama [Fri, 5 Aug 2016 01:04:59 +0000 (01:04 +0000)]
Make combine() non-member function.
Because this function depends only on its arguments.
llvm-svn: 277790
Jason Molenda [Fri, 5 Aug 2016 00:44:34 +0000 (00:44 +0000)]
Change the indexing done for kernel/kext directories to be recursive.
Also re-write how most of the directory indexing is done - as it has
grown over the years, it has become a bit of a mess and was overdue
for a cleanup.
Most importantly, this allows you to specify a directory with the
platform.plugin.darwin-kernel.kext-directories setting and now lldb
will search for kexts and kernels in those directories recursively.
<rdar://problem/
20754467>
llvm-svn: 277789
Bruno Cardoso Lopes [Thu, 4 Aug 2016 23:58:30 +0000 (23:58 +0000)]
[LIT][Darwin] Change %ld64 to be prefixed with DYLD_INSERT_LIBRARIES
Followup from r277778, after Mehdi's comments.
Expand %ld64 to perform the necessary preload instead, that way new
tests do not need to worry about setting up DYLD_INSERT_LIBRARIES
themselves.
rdar://problem/
24300926
llvm-svn: 277788
Bruno Cardoso Lopes [Thu, 4 Aug 2016 23:55:22 +0000 (23:55 +0000)]
[Sema] Add sizeof diagnostics for bzero
For memset (and others) we can get diagnostics like:
struct stat { int x; };
void foo(struct stat *stamps) {
bzero(stamps, sizeof(stamps));
memset(stamps, 0, sizeof(stamps));
}
t.c:7:28: warning: 'memset' call operates on objects of type 'struct stat' while the size is based on a different type 'struct stat *' [-Wsizeof-pointer-memaccess]
memset(stamps, 0, sizeof(stamps));
~~~~~~ ^~~~~~
t.c:7:28: note: did you mean to dereference the argument to 'sizeof' (and multiply it by the number of elements)?
memset(stamps, 0, sizeof(stamps));
^~~~~~
This patch implements the same class of warnings for bzero.
Differential Revision: https://reviews.llvm.org/D22525
rdar://problem/
18963514
llvm-svn: 277787
Sebastian Pop [Thu, 4 Aug 2016 23:49:07 +0000 (23:49 +0000)]
GVN-hoist: enable by default
llvm-svn: 277786
Sebastian Pop [Thu, 4 Aug 2016 23:49:05 +0000 (23:49 +0000)]
GVN-hoist: fix early exit logic
The patch splits a complex && if condition into easier to read and understand
logic. That wrong early exit condition was letting some instructions with not
all operands available pass through when HoistingGeps was true.
Differential Revision: https://reviews.llvm.org/D23174
llvm-svn: 277785
Justin Bogner [Thu, 4 Aug 2016 23:41:01 +0000 (23:41 +0000)]
IR: Provide an IRBuilder Inserter that calls a callback after insertion
Add a generalized IRBuilderCallbackInserter, which is just given a
callback to execute after insertion. This can be used to get rid of
the custom inserter in InstCombine, which will in turn allow me to add
target specific InstCombineCalls API for intrinsics without horrible
layering violations.
llvm-svn: 277784
Tim Shen [Thu, 4 Aug 2016 23:03:44 +0000 (23:03 +0000)]
[ADT] Migrate DepthFirstIterator to use NodeRef
Summary: The corresponding LLVM change is D23146.
Reviewers: dblaikie, chandlerc
Subscribers: cfe-commits
Differential Revision: https://reviews.llvm.org/D23147
llvm-svn: 277783
Michael Kuperstein [Thu, 4 Aug 2016 22:48:03 +0000 (22:48 +0000)]
[LV, X86] Be more optimistic about vectorizing shifts.
Shifts with a uniform but non-constant count were considered very expensive to
vectorize, because the splat of the uniform count and the shift would tend to
appear in different blocks. That made the splat invisible to ISel, and we'd
scalarize the shift at codegen time.
Since r201655, CodeGenPrepare sinks those splats to be next to their use, and we
are able to select the appropriate vector shifts. This updates the cost model to
to take this into account by making shifts by a uniform cheap again.
Differential Revision: https://reviews.llvm.org/D23049
llvm-svn: 277782
Rui Ueyama [Thu, 4 Aug 2016 22:27:00 +0000 (22:27 +0000)]
Split InputSectionDescription::Sort into SortInner and SortOuter.
Summary:
The comparator function to compare input sections as instructed by
SORT command was a bit too complicated because it needed to handle
four different cases. This patch split it into two function calls.
This patch also simplifies the parser.
Reviewers: grimar
Subscribers: llvm-commits
Differential Revision: https://reviews.llvm.org/D23140
llvm-svn: 277780
Sanjay Patel [Thu, 4 Aug 2016 22:19:27 +0000 (22:19 +0000)]
[InstCombine] use m_APInt to allow icmp eq (mul X, C1), C2 folds for splat constant vectors
This concludes the splat vector enhancements for foldICmpEqualityWithConstant().
Other commits in this series:
https://reviews.llvm.org/rL277762
https://reviews.llvm.org/rL277752
https://reviews.llvm.org/rL277738
https://reviews.llvm.org/rL277731
https://reviews.llvm.org/rL277659
https://reviews.llvm.org/rL277638
https://reviews.llvm.org/rL277629
llvm-svn: 277779
Bruno Cardoso Lopes [Thu, 4 Aug 2016 22:01:38 +0000 (22:01 +0000)]
[LIT][Darwin] Preload libclang_rt.asan_osx_dynamic.dylib when necessary
Green Dragon's darwin stage2 asan bot fails on some checks:
http://lab.llvm.org:8080/green/job/clang-stage2-cmake-RgSan_check
test/tools/lto/hide-linkonce-odr.ll
test/tools/lto/opt-level.ll
ERROR: Interceptors are not working. This may be because
AddressSanitizer is loaded too late (e.g. via dlopen)
To fix this, %ld64 needs to load 'libclang_rt.asan_osx_dynamic.dylib'
before libLTO.dylib, via DYLD_INSERT_LIBRARIES. This won't work by
updating config.environment, since some shim binary in the way scrubs
the env vars. Instead, provide the path to this lib through %asanrtlib,
which can then be used by tests directly with DYLD_INSERT_LIBRARIES.
rdar://problem/
24300926
llvm-svn: 277778
Saleem Abdulrasool [Thu, 4 Aug 2016 21:58:39 +0000 (21:58 +0000)]
builtins: split out the EABI and VFP ARM sources
These are meant to only be included on certain targets. This only disables it
for Windows ARM for now. Ideally these would be conditionally included as
appropriate.
llvm-svn: 277777
Kevin Enderby [Thu, 4 Aug 2016 21:54:19 +0000 (21:54 +0000)]
Clean up the logic of the Archive::Child::Child() with an assert to know Err is not a nullptr
when we are pointed at real data.
David Blaikie pointed out some odd logic in the case the Err value was a nullptr and
Lang Hames suggested it could be cleaned it up with an assert to know that Err is
not a nullptr when we are pointed at real data. As only in the case of constructing
the sentinel value by pointing it at null data is Err is permitted to be a nullptr,
since no error could occur in that case.
With this change the testing for “if (Err)” is removed from the constructor’s logic
and *Err is used directly without any check after the assert().
llvm-svn: 277776
Tim Northover [Thu, 4 Aug 2016 21:39:49 +0000 (21:39 +0000)]
GlobalISel: extend add widening to SUB, MUL, OR, AND and XOR.
These are the operations that are trivially identical. Division is omitted for
now because you need to use the correct sign/zero extension.
llvm-svn: 277775
Tim Northover [Thu, 4 Aug 2016 21:39:44 +0000 (21:39 +0000)]
GlobalISel: add support for G_MUL
llvm-svn: 277774