Artem Dergachev [Wed, 17 Aug 2016 15:37:52 +0000 (15:37 +0000)]
[analyzer] Add LocationContext information to SymbolMetadata.
Like SymbolConjured, SymbolMetadata also needs to be uniquely
identified by the moment of its birth.
Such moments are coded by the (Statement, LocationContext, Block count) triples.
Each such triple represents the moment of analyzing a statement with a certain
call backtrace, with corresponding CFG block having been entered a given amount
of times during analysis of the current code body.
The LocationContext information was accidentally omitted for SymbolMetadata,
which leads to reincarnation of SymbolMetadata upon re-entering a code body
with a different backtrace; the new symbol is incorrectly unified with
the old symbol, which leads to unsound assumptions.
Patch by Alexey Sidorin!
Differential Revision: https://reviews.llvm.org/D21978
llvm-svn: 278937
Michael Kruse [Wed, 17 Aug 2016 15:24:45 +0000 (15:24 +0000)]
Update ISL to
isl-0.17.1-200-gd8de4ea.
This version fixes a bug in set coalescing.
llvm-svn: 278936
Sanjay Patel [Wed, 17 Aug 2016 15:24:30 +0000 (15:24 +0000)]
[InstCombine] use m_APInt to allow icmp (add X, Y), C folds for splat constant vectors
This is a sibling of:
https://reviews.llvm.org/rL278859
llvm-svn: 278935
Martin Bohme [Wed, 17 Aug 2016 15:00:22 +0000 (15:00 +0000)]
Adapt to TraverseLambdaCapture interface change from D23204
Summary:
Depends on D23204.
This is intended to be submitted immediately after D23204 lands.
Reviewers: jdennett, alexfh
Subscribers: cfe-commits
Differential Revision: https://reviews.llvm.org/D23543
llvm-svn: 278934
Martin Bohme [Wed, 17 Aug 2016 14:59:53 +0000 (14:59 +0000)]
Visit lambda capture inits from RecursiveASTVisitor::TraverseLambdaCapture().
Summary:
rL277342 made RecursiveASTVisitor visit lambda capture initialization
expressions (these are the Exprs in LambdaExpr::capture_inits()).
jdennett identified two issues with rL277342 (see comments there for details):
- It visits initialization expressions for implicit lambda captures, even if
shouldVisitImplicitCode() returns false.
- It visits initialization expressions for init captures twice (because these
were already traveresed in TraverseLambdaCapture() before rL277342)
This patch fixes these issues and moves the code for traversing initialization
expressions into TraverseLambdaCapture().
This patch also makes two changes required for the tests:
- It adds Lang_CXX14 to the Language enum in TestVisitor.
- It adds a parameter to ExpectedLocationVisitor::ExpectMatch() that specifies
the number of times a match is expected to be seen.
Reviewers: klimek, jdennett, alexfh
Subscribers: cfe-commits
Differential Revision: https://reviews.llvm.org/D23204
llvm-svn: 278933
Andrey Bokhanko [Wed, 17 Aug 2016 14:53:18 +0000 (14:53 +0000)]
Clarify the statement on using #if 0 ... #endif in CodingStandards.
The statement on using #if 0 ... #endif is not very clear (for people like me
:-)). This patch clarifies it a bit to avoid confusion.
Differential Revision: https://reviews.llvm.org/D23404
llvm-svn: 278932
George Rimar [Wed, 17 Aug 2016 14:48:17 +0000 (14:48 +0000)]
[ELF] - Linkerscript: make readAt() signature to be consistent with others read*(). NFC.
llvm-svn: 278931
Simon Dardis [Wed, 17 Aug 2016 14:45:09 +0000 (14:45 +0000)]
[mips] Add l.[sd] and s.[sd] instruction aliases
Reviewers: dsanders, vkalintiris
Differential Review: https://reviews.llvm.org/D23121
llvm-svn: 278930
Chad Rosier [Wed, 17 Aug 2016 14:31:34 +0000 (14:31 +0000)]
Revert "[Reassociate] Avoid iterator invalidation when negating value."
This reverts commit r278928 due to lit test failures.
llvm-svn: 278929
Chad Rosier [Wed, 17 Aug 2016 14:16:45 +0000 (14:16 +0000)]
[Reassociate] Avoid iterator invalidation when negating value.
Differential Revision: https://reviews.llvm.org/D23464
PR28367
llvm-svn: 278928
Jonas Paulsson [Wed, 17 Aug 2016 13:24:19 +0000 (13:24 +0000)]
[LoopStrenghtReduce] Refactoring and addition of a new target cost function.
Refactored so that a LSRUse owns its fixups, as oppsed to letting the
LSRInstance own them. This makes it easier to rate formulas for
LSRUses, since the fixups are available directly. The Offsets vector
has been removed since it was no longer necessary.
New target hook isFoldableMemAccessOffset(), which is used during formula
rating.
For SystemZ, this is useful to express that loads and stores with
float or vector types with a big/negative offset should be avoided in
loops. Without this, LSR will generate a lot of negative offsets that
would require extra instructions for loading the address.
Updated tests:
test/CodeGen/SystemZ/loop-01.ll
Reviewed by: Quentin Colombet and Ulrich Weigand.
https://reviews.llvm.org/D19152
llvm-svn: 278927
Aaron Ballman [Wed, 17 Aug 2016 13:10:42 +0000 (13:10 +0000)]
Add an AST matcher for external formal linkage.
Patch by Visoiu Mistrih
llvm-svn: 278926
Pavel Labath [Wed, 17 Aug 2016 12:00:19 +0000 (12:00 +0000)]
Fix unittests on windows after r278915
Apparently clang will happily capture a const variable in a lambda without it being specified in
the capture clause. MSVC does not like that.
llvm-svn: 278925
Pavel Labath [Wed, 17 Aug 2016 11:55:50 +0000 (11:55 +0000)]
Remove cmake legacy code
Summary: Cmake 2.8 support is gone and not coming back. We can remove a bit of legacy code now.
Reviewers: zturner
Subscribers: lldb-commits
Differential Revision: https://reviews.llvm.org/D23554
llvm-svn: 278924
Marina Yatsina [Wed, 17 Aug 2016 11:40:21 +0000 (11:40 +0000)]
Fixing bug committed in rev. 278321
In theory the indices of RC (and thus the index used for LiveRegs) may differ from the indices of OpRC.
Fixed the code to extract the correct RC index.
OpRC contains the first X consecutive elements of RC, and thus their indices are currently de facto the same, therefore a test cannot be added at this point.
Differential Revision: https://reviews.llvm.org/D23491
llvm-svn: 278923
Haojian Wu [Wed, 17 Aug 2016 11:31:19 +0000 (11:31 +0000)]
[include-fixer] Update -help message.
llvm-svn: 278922
Sam Kolton [Wed, 17 Aug 2016 10:17:57 +0000 (10:17 +0000)]
[AMDGPU] llvm-objdump: Skip amd_kernel_code_t only at the begining of kernel symbol.
Summary: This change fix bug in AMDGPU disassembly. Previously, presence of symbols other than kernel symbols caused objdump to skip begining of those symbols.
Reviewers: tstellarAMD, vpykhtin, Bigcheese, ruiu
Subscribers: kzhuravl, arsenm
Differential Revision: http://reviews.llvm.org/D21966
llvm-svn: 278921
Nicolai Haehnle [Wed, 17 Aug 2016 09:34:55 +0000 (09:34 +0000)]
LiveIntervals: add removeRegUnit
Summary:
See D22198 for the motivation: We have a pass that uses LiveIntervals anyway,
and there is now a requirement to track a physical register that is not
usually tracked at this point of the compilation. The pass also introduces
instructions that affect this physical register, but we want to preserve
LiveIntervals.
Rather than add brittle and rarely exercised code to keep the tracking of
the physical register intact, we want to just remove the corresponding
LiveRange -- it didn't exist before anyway, and subsequent passes don't
expect it to be there.
Reviewers: MatzeB, arsenm
Subscribers: llvm-commits, MatzeB
Differential Revision: https://reviews.llvm.org/D22801
llvm-svn: 278920
Filipe Cabecinhas [Wed, 17 Aug 2016 09:24:33 +0000 (09:24 +0000)]
Deal with buildbot fallout from r278917: s/AllocType()/GetAllocType()/ (had the same name as the enum)
llvm-svn: 278919
Pavel Labath [Wed, 17 Aug 2016 09:17:08 +0000 (09:17 +0000)]
Fix unittest compilation error in r278915
llvm-svn: 278918
Filipe Cabecinhas [Wed, 17 Aug 2016 09:16:08 +0000 (09:16 +0000)]
Rename DescribeHeapAddress to DescribeAddressIfHeap and split it into a function to get all the information about the address, and one to print it.
Summary:
Replacement for part of D23518
This deals with heap addresses, and renames DescribeHeapAddress.
Requires D23520, which moves code around to make it accessible in asan_describers.cc (and still accessible in asan_report.cc if needed).
Reviewers: kcc, samsonov
Subscribers: kubabrecka, llvm-commits
Differential Revision: https://reviews.llvm.org/D23569
llvm-svn: 278917
Pavel Labath [Wed, 17 Aug 2016 09:12:21 +0000 (09:12 +0000)]
Remove manual packet construction from GDBRemoteRegisterContext::SetPrimordialRegister
llvm-svn: 278916
Pavel Labath [Wed, 17 Aug 2016 08:53:31 +0000 (08:53 +0000)]
Move packet construction from GDBRemoteRegisterContext go the communication class
Summary:
When saving/restoring registers the GDBRemoteRegisterContext class was manually constructing
the register save/restore packets. This creates appropriate helper functions in
GDBRemoteCommunicationClient, and switches the class to use those. It also removes what a
duplicate packet send in some of those functions, a thing that I can only attribute to a bad
merge artefact.
I also add a test framework for testing gdb-remote client functionality and add tests for the new
functions I introduced. I'd like to be able to test the register context changes in isolation as
well, but currently there doesn't seem to be a way to reasonably construct a standalone register
context object, so we'll have to rely on the end-to-end tests to verify that.
Reviewers: clayborg
Subscribers: lldb-commits
Differential Revision: https://reviews.llvm.org/D23553
llvm-svn: 278915
George Rimar [Wed, 17 Aug 2016 08:16:57 +0000 (08:16 +0000)]
Attemp to fix linux build bot after r278911 ("[ELF] - linkerscript AT keyword (in output section description) implemented.")
http://lab.llvm.org:8011/builders/lld-x86_64-darwin13/builds/26289/steps/build_Lld/logs/stdio
llvm-svn: 278914
Ayman Musa [Wed, 17 Aug 2016 07:52:15 +0000 (07:52 +0000)]
Fix bug in DAGBuilder for getelementptr with expanded vector.
Replacing the usage of MVT with EVT in case the vector type is expanded.
Differential Revision: https://reviews.llvm.org/D23306
llvm-svn: 278913
Chandler Carruth [Wed, 17 Aug 2016 07:48:34 +0000 (07:48 +0000)]
[LTO] Fix a use-after-free introduced in r278907 and caught by ASan.
The ASan build bot caught this right away:
http://lab.llvm.org:8011/builders/sanitizer-x86_64-linux-fast/builds/15580/steps/check-llvm%20asan/logs/stdio
This was also breaking a Windows build bot I'm pretty sure.
llvm-svn: 278912
George Rimar [Wed, 17 Aug 2016 07:44:19 +0000 (07:44 +0000)]
[ELF] - linkerscript AT keyword (in output section description) implemented.
The linker will normally set the LMA equal to the VMA.
You can change that by using the AT keyword.
The expression lma that follows the AT keyword specifies
the load address of the section.
Patch implements this keyword.
Differential revision: https://reviews.llvm.org/D19272
llvm-svn: 278911
Ayman Musa [Wed, 17 Aug 2016 07:37:34 +0000 (07:37 +0000)]
First commit (test commit) - Adding empty line.
llvm-svn: 278910
Chandler Carruth [Wed, 17 Aug 2016 07:18:44 +0000 (07:18 +0000)]
Restrict the use of the C++17 attribute to C++17 (at least as best we
can given the current __cplusplus definitions).
Without this, Clang triggers TONS of warnings about using a C++17
extension. I tried using LLVM_EXTENSION to turn these off and it doesn't
work.
Suggestions on a better approach are welcome, but at least this makes
the build usable for me again.
llvm-svn: 278909
Roger Ferrer Ibanez [Wed, 17 Aug 2016 06:52:15 +0000 (06:52 +0000)]
Add missing tests
Change r278483 was missing the tests
Differential Revision: https://reviews.llvm.org/D20561
llvm-svn: 278908
Mehdi Amini [Wed, 17 Aug 2016 06:23:09 +0000 (06:23 +0000)]
[LTO] Introduce an Output class to wrap the output stream creation (NFC)
Summary:
While NFC for now, this will allow more flexibility on the client side
to hold state necessary to back up the stream.
Also when adding caching, this class will grow in complexity.
Note I blindly modified the gold-plugin as I can't compile it.
Reviewers: tejohnson
Subscribers: mehdi_amini, llvm-commits
Differential Revision: https://reviews.llvm.org/D23542
llvm-svn: 278907
Mehdi Amini [Wed, 17 Aug 2016 06:23:08 +0000 (06:23 +0000)]
[ThinLTO] Adapt backend invocation to llvm API changes.
Reviewers: tejohnson
Subscribers: mehdi_amini, llvm-commits
Differential Revision: https://reviews.llvm.org/D23579
llvm-svn: 278906
Marshall Clow [Wed, 17 Aug 2016 05:58:40 +0000 (05:58 +0000)]
Support allocators with explicit conversion constructors. Fixes bug #29000
llvm-svn: 278904
Justin Bogner [Wed, 17 Aug 2016 05:25:38 +0000 (05:25 +0000)]
Fix a use of LLVM_FALLTHROUGH that wasn't even in a switch.
I was over-aggressive in my conversions from comments to the
fallthrough attribute.
llvm-svn: 278903
Justin Bogner [Wed, 17 Aug 2016 05:10:15 +0000 (05:10 +0000)]
Replace "fallthrough" comments with LLVM_FALLTHROUGH
This is a mechanical change of comments in switches like fallthrough,
fall-through, or fall-thru to use the LLVM_FALLTHROUGH macro instead.
llvm-svn: 278902
Jason Molenda [Wed, 17 Aug 2016 03:56:04 +0000 (03:56 +0000)]
Fix the RangeMapVector::FindEntryThatContainsOrFollows method to
back up the iterator, as long as it still contains the address.
std::lower_bound will point us to the entry after the one we
are really interested in, leading to problems with backtracing
in corefiles.
<rdar://problem/
27823549>
llvm-svn: 278901
Chuang-Yu Cheng [Wed, 17 Aug 2016 03:17:44 +0000 (03:17 +0000)]
[ppc64] Don't apply sibling call optimization if callee has any byval arg
This is a quick work around, because in some cases, e.g. caller's stack
size > callee's stack size, we are still able to apply sibling call
optimization even callee has any byval arg.
This patch fix: https://llvm.org/bugs/show_bug.cgi?id=28328
Reviewers: hfinkel kbarton nemanjai amehsan
Subscribers: hans, tjablin
https://reviews.llvm.org/D23441
llvm-svn: 278900
Zijiao Ma [Wed, 17 Aug 2016 03:17:07 +0000 (03:17 +0000)]
Remove the Triple tests that stressing the TargetParser's behaviour.
Now the tests of TargetParser is in place:
unittests/Support/TargetParserTest.cpp.
So the tests in TripleTest.cpp which actually stressing TargetParser's behavior could be removed.
llvm-svn: 278899
Duncan P. N. Exon Smith [Wed, 17 Aug 2016 03:15:29 +0000 (03:15 +0000)]
CodeGen: Avoid dereferencing end() in ScalarExprEmitter::EmitOverflowCheckedBinOp
Use BB.getNextNode(), which returns nullptr on end(), instead of
&*BB.getIterator(), which is UB on end().
CodeGenFunction::createBasicBlock expects nullptr in this case already.
llvm-svn: 278898
Chandler Carruth [Wed, 17 Aug 2016 03:09:11 +0000 (03:09 +0000)]
[PM] Update Clang for LLVM's r278896 which re-organized a header.
(sorry this didn't get landed closer in time...)
llvm-svn: 278897
Chandler Carruth [Wed, 17 Aug 2016 02:56:20 +0000 (02:56 +0000)]
[PM] Port the always inliner to the new pass manager in a much more
minimal and boring form than the old pass manager's version.
This pass does the very minimal amount of work necessary to inline
functions declared as always-inline. It doesn't support a wide array of
things that the legacy pass manager did support, but is alse ... about
20 lines of code. So it has that going for it. Notably things this
doesn't support:
- Array alloca merging
- To support the above, bottom-up inlining with careful history
tracking and call graph updates
- DCE of the functions that become dead after this inlining.
- Inlining through call instructions with the always_inline attribute.
Instead, it focuses on inlining functions with that attribute.
The first I've omitted because I'm hoping to just turn it off for the
primary pass manager. If that doesn't pan out, I can add it here but it
will be reasonably expensive to do so.
The second should really be handled by running global-dce after the
inliner. I don't want to re-implement the non-trivial logic necessary to
do comdat-correct DCE of functions. This means the -O0 pipeline will
have to be at least 'always-inline,global-dce', but that seems
reasonable to me. If others are seriously worried about this I'd like to
hear about it and understand why. Again, this is all solveable by
factoring that logic into a utility and calling it here, but I'd like to
wait to do that until there is a clear reason why the existing
pass-based factoring won't work.
The final point is a serious one. I can fairly easily add support for
this, but it seems both costly and a confusing construct for the use
case of the always inliner running at -O0. This attribute can of course
still impact the normal inliner easily (although I find that
a questionable re-use of the same attribute). I've started a discussion
to sort out what semantics we want here and based on that can figure out
if it makes sense ta have this complexity at O0 or not.
One other advantage of this design is that it should be quite a bit
faster due to checking for whether the function is a viable candidate
for inlining exactly once per function instead of doing it for each call
site.
Anyways, hopefully a reasonable starting point for this pass.
Differential Revision: https://reviews.llvm.org/D23299
llvm-svn: 278896
Matthias Braun [Wed, 17 Aug 2016 02:52:01 +0000 (02:52 +0000)]
IfConversion: Use references instead of pointers where possible; NFC
Also put some commonly used subexpressions into variables.
llvm-svn: 278895
Matthias Braun [Wed, 17 Aug 2016 02:51:59 +0000 (02:51 +0000)]
IfConversion: Use range based for; NFC
Also avoid some pointless use of auto! Because that's friendlier to
readers and avoids several types accidentally resolving to unnecessary
references here (MachineInstr *&, unsigned &).
llvm-svn: 278894
Matthias Braun [Wed, 17 Aug 2016 02:51:57 +0000 (02:51 +0000)]
IfConversion: Improve doxygen comments
llvm-svn: 278893
Chandler Carruth [Wed, 17 Aug 2016 02:40:23 +0000 (02:40 +0000)]
[Inliner] Add a flag to disable manual alloca merging in the Inliner.
This is off for now while testing can take place to make sure that in
fact we do sufficient stack coloring to fully obviate the manual alloca
array merging.
Some context on why we should be using stack coloring rather than
merging allocas in this way:
LLVM relies very heavily on analyzing pointers as coming from different
allocas in order to make aliasing decisions. These are some of the most
powerful aliasing signals available in LLVM. So merging allocas is an
extremely destructive operation on the LLVM IR -- it takes away highly
valuable and hard to reconstruct information.
As a consequence, inlined functions which happen to have array allocas
that this pattern matches will fail to be properly interleaved unless
SROA manages to hoist everything to an SSA register. Instead, the
inliner will have added an unnecessary dependence that one inlined
function execute after the other because they will have been rewritten
to refer to the same memory.
All that said, folks will reasonably want some time to experiment here
and make sure there are no significant regressions. A flag should give
us an easy knob to test.
For more context, see the thread here:
http://lists.llvm.org/pipermail/llvm-dev/2016-July/103277.html
http://lists.llvm.org/pipermail/llvm-dev/2016-August/103285.html
Differential Revision: https://reviews.llvm.org/D23052
llvm-svn: 278892
Richard Smith [Wed, 17 Aug 2016 02:22:39 +0000 (02:22 +0000)]
Add missing close brace to fix Windows bots. Oops :(
llvm-svn: 278891
Zijiao Ma [Wed, 17 Aug 2016 02:13:33 +0000 (02:13 +0000)]
Some missing usage of TargetParser. NFC.
llvm-svn: 278890
Michael J. Spencer [Wed, 17 Aug 2016 02:10:51 +0000 (02:10 +0000)]
[ELF] Set MAXPAGESIZE to 2MiB on x86-64 to match bfd and gold.
The FreeBSD kernel relies on this behavior to not overwrite the boot loader.
llvm-svn: 278889
Zijiao Ma [Wed, 17 Aug 2016 02:08:28 +0000 (02:08 +0000)]
Some places that could using TargetParser in LLVM. NFC.
llvm-svn: 278888
Duncan P. N. Exon Smith [Wed, 17 Aug 2016 02:08:08 +0000 (02:08 +0000)]
ADT: Add some missing coverage for iplist::splice
These splices are interesting because they involve swapping two nodes in
the same list. There are two ways to do this. Assuming:
A -> B -> [Sentinel]
You can either:
- splice B before A, with: L.splice(A, L, B) or
- splice A before Sentinel, with: L.splice(L.end(), L, A) to create:
B -> A -> [Sentinel]
These two swapping-splices are somewhat interesting corner cases for
maintaining the list invariants. The tests pass even with my new ilist
implementation, but I had some doubts about the latter when I was
looking at weird UB effects. Since I can't find equivalent explicit
test coverage elsewhere it seems prudent to commit.
llvm-svn: 278887
Duncan P. N. Exon Smith [Wed, 17 Aug 2016 01:54:41 +0000 (01:54 +0000)]
Scalar: Avoid dereferencing end() in IndVarSimplify
IndVarSimplify::sinkUnusedInvariants calls
BasicBlock::getFirstInsertionPt on the ExitBlock and moves instructions
before it. This can return end(), so it's not safe to dereference. Add
an iterator-based overload to Instruction::moveBefore to avoid the UB.
llvm-svn: 278886
George Burgess IV [Wed, 17 Aug 2016 01:50:54 +0000 (01:50 +0000)]
[Docs] Fix post-review comments on MemorySSA's docs.
Thanks to Sean Silva for bringing these up. :)
llvm-svn: 278885
Duncan P. N. Exon Smith [Wed, 17 Aug 2016 01:23:58 +0000 (01:23 +0000)]
IPO: Swap || operands to avoid dereferencing end()
IsOperandBundleUse conveniently indicates whether
std::next(F->arg_begin(),UseIndex) will get to (or past) end(). Check
it first to avoid dereferencing end().
llvm-svn: 278884
Duncan P. N. Exon Smith [Wed, 17 Aug 2016 01:16:17 +0000 (01:16 +0000)]
Scalar: Avoid dereferencing end() in InductiveRangeCheckElimination
BasicBlock::Create isn't designed to take iterators (which might be
end()), but pointers (which might be nullptr). Fix the UB that was
converting end() to a BasicBlock* by calling BasicBlock::getNextNode()
in the first place.
llvm-svn: 278883
Richard Smith [Wed, 17 Aug 2016 01:05:07 +0000 (01:05 +0000)]
If possible, set the stack rlimit to at least 8MiB on cc1 startup, and work
around a Linux kernel bug where the actual amount of available stack may be a
*lot* lower than the rlimit.
GCC also sets a higher stack rlimit on startup, but it goes all the way to
64MiB. We can increase this limit if it proves necessary.
The kernel bug is as follows: Linux kernels prior to version 4.1 may choose to
map the process's heap as little as 128MiB before the process's stack for a PIE
binary, even in a 64-bit virtual address space. This means that allocating more
than 128MiB before you reach the process's stack high water mark can lead to
crashes, even if you don't recurse particularly deeply.
We work around the kernel bug by touching a page deep within the stack (after
ensuring that we know how big it is), to preallocate virtual address space for
the stack so that the kernel doesn't allow the brk() area to wander into it,
when building clang as a Linux PIE binary.
llvm-svn: 278882
Duncan P. N. Exon Smith [Wed, 17 Aug 2016 01:02:18 +0000 (01:02 +0000)]
ObjCARC: Don't increment or dereference end() when scanning args
When there's only one argument and it doesn't match one of the known
functions, return ARCInstKind::CallOrUser rather than falling through
to the two argument case. The old behaviour both incremented past and
dereferenced end().
llvm-svn: 278881
Duncan P. N. Exon Smith [Wed, 17 Aug 2016 00:53:04 +0000 (00:53 +0000)]
ARM: Avoid dereferencing end() in ARMFrameLowering::emitPrologue
llvm::tryFoldSPUpdateIntoPushPop assumes its arguments are valid
MachineInstrs. Update ARMFrameLowering::emitPrologue to respect that;
when LastPush==end(), it can't possibly be a push instruction anyway.
llvm-svn: 278880
Duncan P. N. Exon Smith [Wed, 17 Aug 2016 00:43:59 +0000 (00:43 +0000)]
CodeGen: Avoid dereferencing end() in OptimizePHIs::OptimizeBB
llvm-svn: 278879
Duncan P. N. Exon Smith [Wed, 17 Aug 2016 00:34:00 +0000 (00:34 +0000)]
Hexagon: Avoid dereferencing end() in HexagonInstrInfo::InsertBranch
llvm-svn: 278878
George Burgess IV [Wed, 17 Aug 2016 00:17:29 +0000 (00:17 +0000)]
[Docs] Add initial MemorySSA documentation.
Patch partially by Danny.
Differential Revision: https://reviews.llvm.org/D23535
llvm-svn: 278875
Duncan P. N. Exon Smith [Wed, 17 Aug 2016 00:06:43 +0000 (00:06 +0000)]
AMDGPU: Avoid looking for the DebugLoc in end()
The end() iterator isn't a safe thing to dereference. Pass the DebugLoc
into EmitFetchClause and EmitALUClause to avoid it.
llvm-svn: 278873
Duncan P. N. Exon Smith [Tue, 16 Aug 2016 23:57:56 +0000 (23:57 +0000)]
SimplifyCFG: Avoid dereferencing end()
When comparing a User* to a BasicBlock::iterator in
passingValueIsAlwaysUndefined, don't dereference the iterator in case it
is end().
llvm-svn: 278872
Justin Bogner [Tue, 16 Aug 2016 23:37:10 +0000 (23:37 +0000)]
Revert "Write the TPI stream from a PDB to Yaml."
This is hitting a "use of undeclared identifier 'skipPadding' error
locally and on some bots.
This reverts r278869.
llvm-svn: 278871
Duncan P. N. Exon Smith [Tue, 16 Aug 2016 23:34:07 +0000 (23:34 +0000)]
CodeGen: Avoid dereferencing end() when unconstifying iterators
Rather than doing a funny dance that relies on dereferencing end() not
crashing, add some API to MachineInstrBundleIterator to get a non-const
version of the iterator.
llvm-svn: 278870
Zachary Turner [Tue, 16 Aug 2016 23:28:54 +0000 (23:28 +0000)]
Write the TPI stream from a PDB to Yaml.
Reviewed By: ruiu, rnk
Differential Revision: https://reviews.llvm.org/D23226
llvm-svn: 278869
Justin Bogner [Tue, 16 Aug 2016 23:24:13 +0000 (23:24 +0000)]
Introduce LLVM_FALLTHROUGH, which expands to the C++17 attribute.
This allows you to annotate switch case fallthrough in a better way
than a "// FALLTHROUGH" comment. Eventually it would be nice to turn
on -Wimplicit-fallthrough, if we can get the code base clean.
llvm-svn: 278868
Sanjay Patel [Tue, 16 Aug 2016 23:18:42 +0000 (23:18 +0000)]
[InstCombine] add tests for fold with no coverage and missing vector fold
llvm-svn: 278867
Kyle Butt [Tue, 16 Aug 2016 22:56:14 +0000 (22:56 +0000)]
Codegen: Don't tail-duplicate blocks with un-analyzable fallthrough.
If AnalyzeBranch can't analyze a block and it is possible to
fallthrough, then duplicating the block doesn't make sense, as only one
block can be the layout predecessor for the un-analyzable fallthrough.
Submitted wit a test case, but NOTE: the test case doesn't currently
fail. However, the test case fails with D20505 and would have saved me
some time debugging.
llvm-svn: 278866
Sanjay Patel [Tue, 16 Aug 2016 22:34:42 +0000 (22:34 +0000)]
[InstCombine] clean up foldICmpAddConstant(); NFCI
1. Fix variable names
2. Add local variables to reduce code
3. Fix code comments
4. Add early exit to reduce indentation
5. Remove 'else' after if -> return
6. Hoist common predicate
llvm-svn: 278864
Konstantin Zhuravlyov [Tue, 16 Aug 2016 22:30:11 +0000 (22:30 +0000)]
[AMDGPU] Remove duplicate initialization of SIDebuggerInsertNops pass
Differential Revision: https://reviews.llvm.org/D23556
llvm-svn: 278863
Chris Bieneman [Tue, 16 Aug 2016 22:16:29 +0000 (22:16 +0000)]
[CMake] Workflow improvements to PGO generation
This patch adds a few new convenience options used by the PGO CMake cache to setup options on bootstrap stages. The new options are:
PGO_INSTRUMENT_LTO - Builds the instrumented and final builds with LTO
PGO_BUILD_CONFIGURATION - Accepts a CMake cache script that can be used for complex configuration of the stage2-instrumented and stage2 builds.
The patch also includes a fix for bootstrap dependencies so that the instrumented LTO tools don't get used when building the final stage, and it adds distribution targets to the passthrough.
llvm-svn: 278862
Adrian McCarthy [Tue, 16 Aug 2016 22:11:18 +0000 (22:11 +0000)]
Emit debug info for dynamic classes if they are imported from a DLL.
With -debug-info-kind=limited, we omit debug info for dynamic classes that live in other TUs. This reduces duplicate type information. When statically linked, the type information comes together. But if your binary has a class derived from a base in a DLL, the base class info is not available to the debugger.
The decision is made in shouldOmitDefinition (CGDebugInfo.cpp). Per a suggestion from rnk, I've tweaked the decision so that we do include definitions for classes marked as DLL imports. This should be a relatively small number of classes, so we don't pay a large price for duplication of the type info, yet it should cover most cases on Windows.
Essentially this makes debug info for DLLs independent, but we still assume that all TUs within the same DLL will be consistently built with (or without) debug info and the debugger will be able to search across the debug info within that scope to resolve any declarations into definitions, etc.
llvm-svn: 278861
David Majnemer [Tue, 16 Aug 2016 22:07:32 +0000 (22:07 +0000)]
Preserve the assumption cache more often
We were clearing it out in LoopUnswitch and InlineFunction instead of
attempting to preserve it.
llvm-svn: 278860
Sanjay Patel [Tue, 16 Aug 2016 21:53:19 +0000 (21:53 +0000)]
[InstCombine] use m_APInt to allow icmp (sub X, Y), C folds for splat constant vectors
llvm-svn: 278859
Duncan P. N. Exon Smith [Tue, 16 Aug 2016 21:46:03 +0000 (21:46 +0000)]
CodeGen: Don't dereference end() in MachineBasicBlock::CorrectExtraCFGEdges
The current MachineBasicBlock might be the last block, so FallThru may
be past the end(). Use getNextNode(), which will convert to nullptr,
rather than &*++, which is invalid if we reach the end().
llvm-svn: 278858
Sanjay Patel [Tue, 16 Aug 2016 21:35:16 +0000 (21:35 +0000)]
[x86] Allow merging multiple instances of an immediate within a basic block for code size savings, for 64-bit constants.
This patch handles 64-bit constants which can be encoded as 32-bit immediates.
It extends the functionality added by https://reviews.llvm.org/D11363 for 32-bit constants to 64-bit constants.
Patch by Sunita Marathe!
Differential Revision: https://reviews.llvm.org/D23391
llvm-svn: 278857
Kostya Serebryany [Tue, 16 Aug 2016 21:28:05 +0000 (21:28 +0000)]
[libFuzzer] minor speed improvement
llvm-svn: 278856
Sanjay Patel [Tue, 16 Aug 2016 21:26:10 +0000 (21:26 +0000)]
[InstCombine] fix variable names to match formula comments; NFC
llvm-svn: 278855
David Majnemer [Tue, 16 Aug 2016 21:09:46 +0000 (21:09 +0000)]
[LoopUnroll] Don't clear out the AssumptionCache on each loop
Clearing out the AssumptionCache can cause us to rescan the entire
function for assumes. If there are many loops, then we are scanning
over the entire function many times.
Instead of clearing out the AssumptionCache, register all cloned
assumes.
llvm-svn: 278854
Reid Kleckner [Tue, 16 Aug 2016 21:02:04 +0000 (21:02 +0000)]
Revert "Enhance SCEV to compute the trip count for some loops with unknown stride."
This reverts commit r278731. It caused http://crbug.com/638314
llvm-svn: 278853
Francis Ricci [Tue, 16 Aug 2016 20:52:22 +0000 (20:52 +0000)]
Revert "[compiler-rt] Allow c++ abi to be explictly disabled in cmake configuration"
This reverts commit
dbb6e905684e2e9488887b26c02ee8881849f09f.
llvm-svn: 278852
Yaxun Liu [Tue, 16 Aug 2016 20:49:49 +0000 (20:49 +0000)]
[OpenCL] AMDGPU: Add extensions cl_amd_media_ops and cl_amd_media_ops2
Differential Revision: https://reviews.llvm.org/D23322
llvm-svn: 278851
Chris Bieneman [Tue, 16 Aug 2016 20:49:49 +0000 (20:49 +0000)]
[CMake] Fixing typo in Info.plist generation
This is causing an error in the generation of the clang info plist.
llvm-svn: 278850
Chris Bieneman [Tue, 16 Aug 2016 20:44:58 +0000 (20:44 +0000)]
[CMake] [Apple Cache] Set CLANG_VENDOR_UTI for Apple builds
This is just a minor update to the Apple packaging configuration.
llvm-svn: 278849
Francis Ricci [Tue, 16 Aug 2016 20:39:10 +0000 (20:39 +0000)]
[compiler-rt] Allow c++ abi to be explictly disabled in cmake configuration
Summary: This will allow for the sanitizers to be used when c++ abi is unavailable.
Reviewers: samsonov, beanz, pcc, rnk
Subscribers: llvm-commits, kubabrecka, compnerd, dberris
Differential Revision: https://reviews.llvm.org/D23376
llvm-svn: 278848
Matt Arsenault [Tue, 16 Aug 2016 20:38:05 +0000 (20:38 +0000)]
TailDuplicator: Use range loops
llvm-svn: 278847
Evandro Menezes [Tue, 16 Aug 2016 20:35:01 +0000 (20:35 +0000)]
[AArch64] Adjust the scheduling model for Exynos M1.
Refine the model for the FP division unit.
llvm-svn: 278846
Evandro Menezes [Tue, 16 Aug 2016 20:34:58 +0000 (20:34 +0000)]
[AArch64] Adjust the scheduling model for Exynos M1.
Refine the model for the integer division unit.
llvm-svn: 278845
Matt Arsenault [Tue, 16 Aug 2016 20:28:06 +0000 (20:28 +0000)]
AMDGPU: Remove excessive padding from ImmOp and RegOp.
The structs ImmOp and RegOp are in AArch64AsmParser.cpp (inside
anonymous namespace).
This diff changes the order of fields and removes the excessive padding
(8 bytes).
Patch by Alexander Shaposhnikov
llvm-svn: 278844
Reid Kleckner [Tue, 16 Aug 2016 20:22:49 +0000 (20:22 +0000)]
Fix an instance of -Wmicrosoft-enum-value by making the enum unsigned
llvm-svn: 278843
Reid Kleckner [Tue, 16 Aug 2016 20:20:56 +0000 (20:20 +0000)]
Try to work around an MSVC 2013 bug around defaulted default ctors
An UnresolvedSetIterator() is supposed to be zeroed out, but MSVC 2013
does not do that.
llvm-svn: 278842
Haicheng Wu [Tue, 16 Aug 2016 20:06:25 +0000 (20:06 +0000)]
[BranchFolding] Change a test case of r278575.
Rename the operands to make the test less brittle.
llvm-svn: 278841
Sjoerd Meijer [Tue, 16 Aug 2016 19:50:33 +0000 (19:50 +0000)]
[MBP] do not reorder and move up loop latch block
Do not reorder and move up a loop latch block before a loop header
when optimising for size because this will generate an extra
unconditional branch.
Differential Revision: https://reviews.llvm.org/D22521
llvm-svn: 278840
Kostya Serebryany [Tue, 16 Aug 2016 19:33:51 +0000 (19:33 +0000)]
[libFuzzer] new experimental feature: value profiling. Profiles values that affect control flow and treats new values as new coverage.
llvm-svn: 278839
Benjamin Kramer [Tue, 16 Aug 2016 19:20:10 +0000 (19:20 +0000)]
Remove excessive padding from LineNoCacheTy
The struct LineNoCacheTy is in SourceMgr.cpp inside anonymous namespace.
This diff changes the order of fields and removes the excessive padding
(8 bytes).
Patch by Alexander Shaposhnikov!
Differential revision: https://reviews.llvm.org/D23546
llvm-svn: 278838
David Majnemer [Tue, 16 Aug 2016 18:48:37 +0000 (18:48 +0000)]
Make MDNode::intersect faster than O(n * m)
It is pretty easy to get it down to O(nlogn + mlogm). This
implementation has the added benefit of automatically deduplicating
entries between the two sets.
llvm-svn: 278837
David Majnemer [Tue, 16 Aug 2016 18:48:34 +0000 (18:48 +0000)]
Don't passively concatenate MDNodes
I have audited all the callers of concatenate and none require duplicate
entries to service concatenation.
These duplicates serve no purpose but to needlessly embiggen the IR.
N.B. Layering getMostGenericAliasScope on top of concatenate makes it
O(nlogn + mlogm) instead of O(n*m).
llvm-svn: 278836
Matthias Braun [Tue, 16 Aug 2016 18:28:55 +0000 (18:28 +0000)]
sanitizer_common: Fix warning
Clang added warning that taking the address of a packed struct member
possibly yields an unaligned pointer. This case is benign because
the pointer gets casted to an uptr and not used for unaligned accesses.
Add an intermediate cast to char* until this warning is improved (see
also https://reviews.llvm.org/D20561)
llvm-svn: 278835
Davide Italiano [Tue, 16 Aug 2016 18:23:44 +0000 (18:23 +0000)]
[Driver] Remove break after return. NFCI.
llvm-svn: 278834
Jason Henline [Tue, 16 Aug 2016 18:18:32 +0000 (18:18 +0000)]
[StreamExecutor] Rename StreamExecutor to Executor
Summary: No functional changes just renaming this class for better readability.
Reviewers: jlebar
Subscribers: jprice, parallel_libs-commits
Differential Revision: https://reviews.llvm.org/D23574
llvm-svn: 278833