Simon Atanasyan [Fri, 12 Aug 2016 06:28:49 +0000 (06:28 +0000)]
[ELF][MIPS] Support .MIPS.abiflags section
This section supersedes .reginfo and .MIPS.options sections. But for now
we have to support all three sections for ABI transition period.
llvm-svn: 278482
Gor Nishanov [Fri, 12 Aug 2016 05:45:49 +0000 (05:45 +0000)]
[Coroutines]: Part6b: Add coro.id intrinsic.
Summary:
1. Make coroutine representation more robust against optimization that may duplicate instruction by introducing coro.id intrinsics that returns a token that will get fed into coro.alloc and coro.begin. Due to coro.id returning a token, it won't get duplicated and can be used as reliable indicator of coroutine identify when a particular coroutine call gets inlined.
2. Move last three arguments of coro.begin into coro.id as they will be shared if coro.begin will get duplicated.
3. doc + test + code updated to support the new intrinsic.
Reviewers: mehdi_amini, majnemer
Subscribers: mehdi_amini, llvm-commits
Differential Revision: https://reviews.llvm.org/D23412
llvm-svn: 278481
Simon Atanasyan [Fri, 12 Aug 2016 05:43:42 +0000 (05:43 +0000)]
[ELF][MIPS] Fix the comment
llvm-svn: 278480
Duncan P. N. Exon Smith [Fri, 12 Aug 2016 05:05:36 +0000 (05:05 +0000)]
ADT: Remove all ilist_iterator => pointer casts, NFC
Remove all ilist_iterator to pointer casts. There were two reasons for
casts:
- Checking for an uninitialized (i.e., null) iterator. I added
MachineInstrBundleIterator::isValid() to check for that case.
- Comparing an iterator against the underlying pointer value while
avoiding converting the pointer value to an iterator. This is
occasionally necessary in MachineInstrBundleIterator, since there is
an assertion in the constructors that the underlying MachineInstr is
not bundled (but we don't care about that if we're just checking for
pointer equality).
To support the latter case, I rewrote the == and != operators for
ilist_iterator and MachineInstrBundleIterator.
- The implicit constructors now use enable_if to exclude
const-iterator => non-const-iterator conversions from overload
resolution (previously it was a compiler error on instantiation, now
it's SFINAE).
- The == and != operators are now global (friends), and are not
templated.
- MachineInstrBundleIterator has overloads to compare against both
const_pointer and const_reference. This avoids the implicit
conversions to MachineInstrBundleIterator that assert, instead just
checking the address (and I added unit tests to confirm this).
Notably, the only remaining uses of ilist_iterator::getNodePtrUnchecked
are in ilist.h, and no code outside of ilist*.h directly relies on this
UB end-iterator-to-pointer conversion anymore. It's still needed for
ilist_*sentinel_traits, but I'll clean that up soon.
llvm-svn: 278478
David Majnemer [Fri, 12 Aug 2016 04:32:45 +0000 (04:32 +0000)]
Use the range variant of transform instead of unpacking begin/end
No functionality change is intended.
llvm-svn: 278477
David Majnemer [Fri, 12 Aug 2016 04:32:42 +0000 (04:32 +0000)]
Use the range variant of transform instead of unpacking begin/end
No functionality change is intended.
llvm-svn: 278476
David Majnemer [Fri, 12 Aug 2016 04:32:37 +0000 (04:32 +0000)]
Use the range variant of remove_if instead of unpacking begin/end
No functionality change is intended.
llvm-svn: 278475
David Majnemer [Fri, 12 Aug 2016 04:32:29 +0000 (04:32 +0000)]
Use the range variant of count_if instead of unpacking begin/end
No functionality change is intended.
llvm-svn: 278474
Rui Ueyama [Fri, 12 Aug 2016 04:28:20 +0000 (04:28 +0000)]
Add comments.
llvm-svn: 278473
George Burgess IV [Fri, 12 Aug 2016 04:19:35 +0000 (04:19 +0000)]
[Sema] Fix the wording of a comment. NFC.
llvm-svn: 278472
George Burgess IV [Fri, 12 Aug 2016 04:12:31 +0000 (04:12 +0000)]
[Sema] Fix a crash on variadic enable_if functions.
Currently, when trying to evaluate an enable_if condition, we try to
evaluate all arguments a user passes to a function. Given that we can't
use variadic arguments from said condition anyway, not converting them
is a reasonable thing to do. So, this patch makes us ignore any varargs
when attempting to check an enable_if condition.
We'd crash because, in order to convert an argument, we need its
ParmVarDecl. Variadic arguments don't have ParmVarDecls.
llvm-svn: 278471
Rui Ueyama [Fri, 12 Aug 2016 04:00:22 +0000 (04:00 +0000)]
Rename getSizeOfHeaders -> getHeaderSize.
We have getSectionSize for SIZEOF command. So, I think
getHeaderSize is a better name for SIZEOF_HEADERS.
llvm-svn: 278470
David Majnemer [Fri, 12 Aug 2016 03:55:06 +0000 (03:55 +0000)]
Use the range variant of find/find_if instead of unpacking begin/end
If the result of the find is only used to compare against end(), just
use is_contained instead.
No functionality change is intended.
llvm-svn: 278469
Duncan P. N. Exon Smith [Fri, 12 Aug 2016 03:35:47 +0000 (03:35 +0000)]
Core: Remove custom next-prev traits from SimpleReference, NFC
There's nothing special about the _next/_prev pointers in
SimpleReference, so just use ilist_node to do the work.
llvm-svn: 278468
Duncan P. N. Exon Smith [Fri, 12 Aug 2016 03:35:33 +0000 (03:35 +0000)]
ADT: Add ilist_iterator conversions to/from ilist_node
Allow an ilist_iterator to be constructed from an ilist_node, and give
access to the underlying ilist_node as well.
This will be used immediately in lld to support a type-erasure use case.
Longer term, they'll stick around once the iterator is using
ilist_node<NodeTy>* instead of NodeTy*.
llvm-svn: 278467
Wei Mi [Fri, 12 Aug 2016 03:33:22 +0000 (03:33 +0000)]
Recommit 'Remove the restriction that MachineSinking is now stopped by
"insert_subreg, subreg_to_reg, and reg_sequence" instructions' after
adjusting some unittest checks.
This is to solve PR28852. The restriction was added at 2010 to make better register
coalescing. We assumed that it was not necessary any more. Testing results on x86
supported the assumption.
We will look closely to any performance impact it will bring and will be prepared
to help analyzing performance problem found on other architectures.
Differential Revision: https://reviews.llvm.org/D23210
llvm-svn: 278466
Rui Ueyama [Fri, 12 Aug 2016 03:33:04 +0000 (03:33 +0000)]
Early continue. NFC.
llvm-svn: 278465
Rui Ueyama [Fri, 12 Aug 2016 03:31:09 +0000 (03:31 +0000)]
Simplify LinkerScript<ELFT>::createSections.
Previously, we were setting LayoutInputSection's OutputSection member
in createSections. Because when we create LayoutInputSectinos, we
don't know the output section for them, so we backfilled the member
in the function. This patch moves the code to backfill it to assignOffsets.
llvm-svn: 278464
Haicheng Wu [Fri, 12 Aug 2016 03:30:23 +0000 (03:30 +0000)]
[BranchFolding] Restrict tail merging loop blocks after MBP
To fix PR28014, this patch restricts tail merging to blocks that belong to the
same loop after MBP.
Differential Revision: https://reviews.llvm.org/D23191
llvm-svn: 278463
Rui Ueyama [Fri, 12 Aug 2016 03:25:25 +0000 (03:25 +0000)]
Remove excessive parentheses.
llvm-svn: 278462
Rui Ueyama [Fri, 12 Aug 2016 03:16:56 +0000 (03:16 +0000)]
Create only one section for a name in LinkerScript.
Previously, we created two or more output sections if there are
input sections with the same name but with different attributes.
That is a wrong behavior. This patch fixes the issue.
One thing we need to do is to merge output section attributes.
Currently, we create an output section based on the first input
section's attributes. This may make a wrong output section
attributes. What we need to do is to bitwise-OR attributes.
We'll do it in a follow-up patch.
llvm-svn: 278461
Richard Smith [Fri, 12 Aug 2016 02:21:25 +0000 (02:21 +0000)]
P0217R3: serialization/deserialization support for c++17 decomposition declarations.
llvm-svn: 278460
Bruno Cardoso Lopes [Fri, 12 Aug 2016 02:17:26 +0000 (02:17 +0000)]
Revert "[VFS] Skip non existent files from the VFS tree"
Breaking bots:
http://lab.llvm.org:8080/green/job/clang-stage1-cmake-RA-incremental_check/27281/
This reverts commit r278457.
llvm-svn: 278459
Richard Smith [Fri, 12 Aug 2016 01:55:21 +0000 (01:55 +0000)]
P0217R3: template instantiation support for decomposition declarations.
llvm-svn: 278458
Bruno Cardoso Lopes [Fri, 12 Aug 2016 01:51:04 +0000 (01:51 +0000)]
[VFS] Skip non existent files from the VFS tree
When the VFS uses a YAML file, the real file path for a
virtual file is described in the "external-contents" field. Example:
...
{
'type': 'file',
'name': 'a.h',
'external-contents': '/a/b/c/a.h'
}
Currently, when parsing umbrella directories, we use
vfs::recursive_directory_iterator to gather the header files to generate the
equivalent modules for. If the external contents for a header does not exist,
we currently are unable to build a module, since the VFS
vfs::recursive_directory_iterator will fail when it finds an entry without a
reliable real path.
Since the YAML file could be prepared ahead of time and shared among
different compiler invocations, an entry might not yet have a reliable
path in 'external-contents', breaking the iteration.
Give the VFS the capability to skip such entries whenever
'ignore-non-existent-contents' property is set in the YAML file.
rdar://problem/
27531549
llvm-svn: 278457
Bruno Cardoso Lopes [Fri, 12 Aug 2016 01:50:53 +0000 (01:50 +0000)]
[VFS] Add 'ignore-non-existent-contents' field to YAML files
Add 'ignore-non-existent-contents' to tell the VFS whether an invalid path
obtained via 'external-contents' should cause iteration on the VFS to stop.
If 'true', the VFS should ignore the entry and continue with the next. Allows
YAML files to be shared across multiple compiler invocations regardless of
prior existent paths in 'external-contents'. This global value is overridable
on a per-file basis.
This adds the parsing and write test part, but use by VFS comes next.
Differential Revision: https://reviews.llvm.org/D23422
rdar://problem/
27531549
llvm-svn: 278456
Ivan Krasin [Fri, 12 Aug 2016 01:40:10 +0000 (01:40 +0000)]
WholeProgramDevirt: initialize WasDevirt in all constructors.
Summary: This is a follow up to r278389 and r278442.
Differential Revision: https://reviews.llvm.org/D23438
llvm-svn: 278455
Chris Bieneman [Fri, 12 Aug 2016 01:29:26 +0000 (01:29 +0000)]
[CMake] If the compiler supports _Atomic include atomic.c in builtins libraries
This fixes a long-standing TODO by implementing a compiler check for supporting the _Atomic keyword. If the _Atomic keyword is supported by the compiler we should include it in the builtin library sources.
llvm-svn: 278454
Rui Ueyama [Fri, 12 Aug 2016 01:24:53 +0000 (01:24 +0000)]
Allocate LayoutInputSections using SpecificBumpPtrAllocator.
llvm-svn: 278453
Rui Ueyama [Fri, 12 Aug 2016 01:10:17 +0000 (01:10 +0000)]
Simplify output section ownership management.
One reason why we are (ab)using OutputSectionFactory class is
because it owns output sections. Technically there's no need
to have it own sections. So, this patch transfers the ownership
to Out<ELFT>.
llvm-svn: 278452
Eli Friedman [Fri, 12 Aug 2016 01:09:53 +0000 (01:09 +0000)]
[DSE] Don't remove stores made live by a call which unwinds.
Issue exposed by noalias or more aggressive alias analysis.
Fixes http://llvm.org/PR25422.
Differential revision: https://reviews.llvm.org/D21007
llvm-svn: 278451
Pete Cooper [Fri, 12 Aug 2016 01:00:15 +0000 (01:00 +0000)]
Refactor isValidAssumeForContext to reduce duplication and indentation. NFC.
This method had some duplicate code when we did or did not have a dom tree. Refactor
it to remove the duplication, but also clean up the control flow to have less duplication.
llvm-svn: 278450
Rui Ueyama [Fri, 12 Aug 2016 00:55:08 +0000 (00:55 +0000)]
Remove OutputSectionBuilder::finalize.
The reason why we had to assign offsets only to sections that
don't contain layout sections were unclear. It turned out that
we can live without it.
llvm-svn: 278449
Richard Smith [Fri, 12 Aug 2016 00:53:41 +0000 (00:53 +0000)]
Remove unused and undesirable reference from BindingDecl to DecompositionDecl.
llvm-svn: 278448
Richard Smith [Fri, 12 Aug 2016 00:39:32 +0000 (00:39 +0000)]
P0217R3: Constant expression evaluation for decomposition declarations.
llvm-svn: 278447
Rui Ueyama [Fri, 12 Aug 2016 00:36:56 +0000 (00:36 +0000)]
Remove useless local variable.
llvm-svn: 278446
Rui Ueyama [Fri, 12 Aug 2016 00:27:23 +0000 (00:27 +0000)]
Split LinkerScript<ELFT>::createSections.
Also avoid to use a lambda that is called only once.
llvm-svn: 278445
Vedant Kumar [Fri, 12 Aug 2016 00:20:39 +0000 (00:20 +0000)]
[Basic] Add const qualifier to SM.isInSystemMacro (NFC)
The member function is a predicate, and doesn't apply any changes on the
object.
Patch by Visoiu Mistrih Francis!
Differential Revision: https://reviews.llvm.org/D23433
llvm-svn: 278444
David Majnemer [Fri, 12 Aug 2016 00:18:03 +0000 (00:18 +0000)]
Use the range variant of find_if instead of unpacking begin/end
No functionality change is intended.
llvm-svn: 278443
Ivan Krasin [Fri, 12 Aug 2016 00:07:14 +0000 (00:07 +0000)]
WholeProgramDevirt: fix access to a non-initialized field.
Summary: This is a follow up to r278389, where I have introduced the bug
Reviewers: mehdi_amini
Differential Revision: https://reviews.llvm.org/D23436
llvm-svn: 278442
Todd Fiala [Thu, 11 Aug 2016 23:51:28 +0000 (23:51 +0000)]
Decoupled Options from CommandInterpreter.
Options used to store a reference to the CommandInterpreter instance
in the base Options class. This made it impossible to parse options
independent of a CommandInterpreter.
This change removes the reference from the base class. Instead, it
modifies the options-parsing-related methods to take an
ExecutionContext pointer, which the options may inspect if they need
to do so.
Closes https://reviews.llvm.org/D23416
Reviewers: clayborg, jingham
llvm-svn: 278440
Rui Ueyama [Thu, 11 Aug 2016 23:22:52 +0000 (23:22 +0000)]
Replace a variadic forwarding template function with less complex ones.
llvm-svn: 278439
Xinliang David Li [Thu, 11 Aug 2016 23:09:56 +0000 (23:09 +0000)]
Add comment /NFC
llvm-svn: 278438
Tim Shen [Thu, 11 Aug 2016 22:36:16 +0000 (22:36 +0000)]
[ADT] Migrate DepthFirstIterator to use NodeRef
Summary:
Notice that the data layout is changed: instead of using
std::pair<PointerIntPair<NodeType*, 1>, ChildItTy>, now use
std::pair<NodeRef, Optional<ChildItTy>>.
A NFC but worth noticing change is operator==(), since we only compare
an iterator against end(), it's better to put an assert there and make
people noticed when it fails.
Reviewers: dblaikie, chandlerc
Subscribers: mzolotukhin, llvm-commits
Differential Revision: https://reviews.llvm.org/D23146
llvm-svn: 278437
Xinliang David Li [Thu, 11 Aug 2016 22:34:00 +0000 (22:34 +0000)]
Fix typos /NFC
llvm-svn: 278436
Richard Smith [Thu, 11 Aug 2016 22:25:46 +0000 (22:25 +0000)]
P0217R3: Perform semantic checks and initialization for the bindings in a
decomposition declaration for arrays, aggregate-like structs, tuple-like
types, and (as an extension) for complex and vector types.
llvm-svn: 278435
Pete Cooper [Thu, 11 Aug 2016 22:23:07 +0000 (22:23 +0000)]
Remove unnecessary extra version of isValidAssumeForContext. NFC.
There were 2 versions of this method. A public one which takes a
const Instruction* and a private implementation which takes a mutable
Value* and casts to an Instruction*.
There was no need for the 2 versions as all callers pass a const Instruction*
and there was no need for a mutable pointer as we only do analysis here.
llvm-svn: 278434
David Majnemer [Thu, 11 Aug 2016 22:21:41 +0000 (22:21 +0000)]
Use the range variant of find instead of unpacking begin/end
If the result of the find is only used to compare against end(), just
use is_contained instead.
No functionality change is intended.
llvm-svn: 278433
Piotr Padlewski [Thu, 11 Aug 2016 22:13:57 +0000 (22:13 +0000)]
Don't import variadic functions
Summary:
This patch adds IsVariadicFunction bit to summary in order
to not import variadic functions. Inliner doesn't inline
variadic functions because it is hard to reason about it.
This one small fix improves Importer by about 16%
(going from 86% to 100% of imported functions that are
inlined anywhere)
on some spec benchmarks like 'int' and others.
Reviewers: eraman, mehdi_amini, tejohnson
Subscribers: mehdi_amini, llvm-commits
Differential Revision: https://reviews.llvm.org/D23339
llvm-svn: 278432
Vyacheslav Klochkov [Thu, 11 Aug 2016 22:07:33 +0000 (22:07 +0000)]
X86-FMA3: Implemented commute transformation for EVEX/AVX512 FMA3 opcodes.
This helped to improved memory-folding and register coalescing optimizations.
Also, this patch fixed the tracker #17229.
Reviewer: Craig Topper.
Differential Revision: https://reviews.llvm.org/D23108
llvm-svn: 278431
Rui Ueyama [Thu, 11 Aug 2016 22:06:55 +0000 (22:06 +0000)]
Make class hierarchy more shallow.
LayoutInputSection is a dummy class and does not need any features
that the actual implementation (InputSection class) provides.
llvm-svn: 278430
Rui Ueyama [Thu, 11 Aug 2016 22:02:44 +0000 (22:02 +0000)]
Re-commit r278066: Do not ignore SizeOfOptionalHeader in COFF header even if PE header is not present.
llvm-svn: 278429
Tim Northover [Thu, 11 Aug 2016 21:40:55 +0000 (21:40 +0000)]
GlobalISel: support 'null' constant in translation.
It's sharing the integer G_CONSTANT for now since I don't *think* it creates
any ambiguity (even on weird archs). If that turns out wrong we can create a
G_PTRCONSTANT or something.
llvm-svn: 278423
Ehsan Amiri [Thu, 11 Aug 2016 21:31:40 +0000 (21:31 +0000)]
Extend trip count instead of truncating IV in LFTR, when legal
When legal, extending trip count in the loop control logic generates better code compared to truncating IV. This is because
(1) extending trip count is a loop invariant operation (see genLoopLimit where we prove trip count is loop invariant).
(2) Scalar Evolution seems to have problems understanding trunc when computing loop trip count. So removing them allows better analysis performed in Scalar Evolution. (In particular this fixes PR 28363 which is the motivation for this change).
I am not going to perform any performance test. Any degradation caused by this should be an indication of a bug elsewhere.
To prove legality, we rely on SCEV to prove zext(trunc(IV)) == IV (or similarly for sext). If this holds, we can prove equivalence of trunc(IV)==ExitCnt (1) and IV == zext(ExitCnt). Simply take zext of boths sides of (1) and apply the proven equivalence.
This commit contains changes in a newly added testcase which was not included in the previous commit (which was reverted later on).
https://reviews.llvm.org/D23075
llvm-svn: 278421
Rui Ueyama [Thu, 11 Aug 2016 21:30:42 +0000 (21:30 +0000)]
Remove trailing whitespace.
llvm-svn: 278420
Pete Cooper [Thu, 11 Aug 2016 21:27:18 +0000 (21:27 +0000)]
Dead strip DESC bits should only be set on object files.
It only makes sense to set on N_NO_DEAD_STRIP on a relocatable object file. Otherwise the bits aren't useful for anything. Matches the ld64 behaviour.
llvm-svn: 278419
Daniel Berlin [Thu, 11 Aug 2016 21:26:50 +0000 (21:26 +0000)]
[MSSA] Use is_contained
llvm-svn: 278418
David Majnemer [Thu, 11 Aug 2016 21:15:00 +0000 (21:15 +0000)]
Use range algorithms instead of unpacking begin/end
No functionality change is intended.
llvm-svn: 278417
Krzysztof Parzyszek [Thu, 11 Aug 2016 21:14:25 +0000 (21:14 +0000)]
[Hexagon] Allow non-returning calls in hardware loops
llvm-svn: 278416
David Majnemer [Thu, 11 Aug 2016 21:14:05 +0000 (21:14 +0000)]
[vim] Add more attributes to llvm.vim
llvm-svn: 278415
Matt Arsenault [Thu, 11 Aug 2016 21:08:43 +0000 (21:08 +0000)]
AMDGPU: Remove unused tablegen utilities
llvm-svn: 278414
Geoff Berry [Thu, 11 Aug 2016 21:05:17 +0000 (21:05 +0000)]
[SCEV] Update interface to handle SCEVExpander insert point motion.
Summary:
This is an extension of the fix in r271424. That fix dealt with builder
insert points being moved by SCEV expansion, but only for the lifetime
of the expand call. This change modifies the interface so that LSR can
safely call expand multiple times at the same insert point and do the
right thing if one of the expansions decides to move the original insert
point.
This is a fix for PR28719.
Reviewers: sanjoy
Subscribers: llvm-commits, mcrosier, mzolotukhin
Differential Revision: https://reviews.llvm.org/D23342
llvm-svn: 278413
Pete Cooper [Thu, 11 Aug 2016 21:03:56 +0000 (21:03 +0000)]
Add obj2yaml to the list of tool_patterns in lit. NFC
llvm-svn: 278412
Tim Northover [Thu, 11 Aug 2016 21:01:15 +0000 (21:01 +0000)]
Remove empty file left by partial reversion.
llvm-svn: 278411
Tim Northover [Thu, 11 Aug 2016 21:01:13 +0000 (21:01 +0000)]
GlobalISel: add translation support for shift operations.
llvm-svn: 278410
Tim Northover [Thu, 11 Aug 2016 21:01:10 +0000 (21:01 +0000)]
GlobalISel: support zext & sext during translation phase.
llvm-svn: 278409
Rui Ueyama [Thu, 11 Aug 2016 21:00:02 +0000 (21:00 +0000)]
Add comments.
llvm-svn: 278408
Pete Cooper [Thu, 11 Aug 2016 20:59:27 +0000 (20:59 +0000)]
Better compress lazy binding info to match ld64.
We should be using one of BIND_OPCODE_SET_DYLIB_SPECIAL_IMM, BIND_OPCODE_SET_DYLIB_ORDINAL_IMM,
and BIND_OPCODE_SET_DYLIB_ORDINAL_ULEB depending on whether ordinals are <= 0, <= 15, > 15.
This matches the behaviour of ld64.
llvm-svn: 278407
Teresa Johnson [Thu, 11 Aug 2016 20:38:39 +0000 (20:38 +0000)]
Fix type truncation warnings
Avoid type truncation warnings from a 32-bit bot due to size_t not
being unsigned long long, by converting the variables and constants to
unsigned. This was introduced by r278338 and caused warnings here:
http://bb.pgr.jp/builders/i686-mingw32-RA-on-linux/builds/15527/steps/build_llvmclang/logs/warnings%20%287%29
llvm-svn: 278406
Pete Cooper [Thu, 11 Aug 2016 20:37:02 +0000 (20:37 +0000)]
Generate slightly more compressed binding opcodes when entries are the same as last time.
We already had logic for binding opcodes had the same addend as last time. This adds
the cases where the ordinal, symbol name, type, and segment offsets are the same as
the last emitted ordinal.
This gets us one step closer to emitting rebase opcodes as compressed as ld64 can manage.
llvm-svn: 278405
Daniel Berlin [Thu, 11 Aug 2016 20:35:07 +0000 (20:35 +0000)]
Move GVNHoist tests into their own directory since it is a separate pass
llvm-svn: 278404
Wei Ding [Thu, 11 Aug 2016 20:34:48 +0000 (20:34 +0000)]
AMDGPU : Add intrinsic for instruction v_cvt_pk_u8_f32
Differential Revision: http://reviews.llvm.org/D23336
llvm-svn: 278403
Wei Mi [Thu, 11 Aug 2016 20:33:37 +0000 (20:33 +0000)]
Revert rL278384 which caused several buildbot failures (like check failures in CodeGen/X86/clz.ll).
llvm-svn: 278402
Daniel Berlin [Thu, 11 Aug 2016 20:32:43 +0000 (20:32 +0000)]
Fix PR 28933
Summary:
This fixes PR 28933 by making sure GVNHoist does not try to recreate memory
accesses when it has not actually moved them.
Reviewers: sebpop
Subscribers: llvm-commits, george.burgess.iv
Differential Revision: https://reviews.llvm.org/D23411
llvm-svn: 278401
Pete Cooper [Thu, 11 Aug 2016 20:31:50 +0000 (20:31 +0000)]
Add test for rebase opcodes. We didn't have one. NFC.
This will be used to test upcoming changes to improve binding opcode
emission to match the more compressed form ld64 can generate.
llvm-svn: 278400
Pete Cooper [Thu, 11 Aug 2016 20:23:15 +0000 (20:23 +0000)]
Add missing RUN line from r278398. This test works with this line but i forgot to push it
llvm-svn: 278399
Pete Cooper [Thu, 11 Aug 2016 20:18:05 +0000 (20:18 +0000)]
Arm64 stubs alignment is 2, not 4.
This matches the behaviour of ld64 when looking at the alignment of the stubs section in the final image.
llvm-svn: 278398
Tim Shen [Thu, 11 Aug 2016 20:10:15 +0000 (20:10 +0000)]
[ADT] Add relation operators for Optional
Summary: Make Optional's behavior the same as the coming std::optional.
Reviewers: dblaikie
Subscribers: llvm-commits
Differential Revision: https://reviews.llvm.org/D23178
llvm-svn: 278397
Pete Cooper [Thu, 11 Aug 2016 20:10:14 +0000 (20:10 +0000)]
Change when we choose to add an LC_LOAD_DYLIB to the final image.
Currently we do this when an atom is used, but we need to do it when a
dylib is referenced on the cmdline as this matches ld64.
This fixes much confusion over which maps are indexed with installName
vs path. There is likely other confusion so i'll be seeing if i can remove
path() completely in a future commit as path() shouldn't really be needed by anyone.
llvm-svn: 278396
Ed Schouten [Thu, 11 Aug 2016 20:03:22 +0000 (20:03 +0000)]
Don't enable PIE on i686-unknown-cloudabi.
We're only going to provide support for using PIE on architectures that
provide PC-relative addressing. i686 is not one of those, so add the
necessary bits for only passing in -pie -zrelro conditionally.
llvm-svn: 278395
Duncan P. N. Exon Smith [Thu, 11 Aug 2016 20:03:09 +0000 (20:03 +0000)]
CodeGen: Avoid dereferencing end() in MachineScheduler
Check MachineInstr::isDebugValue for the same instruction as we're
calling isSchedBoundary, avoiding the possibility of dereferencing
end().
This is a functionality change even when I!=end(). Matthias had a look
and agrees this is the right resolution (as opposed to checking for
end()).
This is triggered by a huge number of tests, but they happen to
magically pass right now. I found this because WIP patches for PR26753
convert them into crashes.
llvm-svn: 278394
Ed Schouten [Thu, 11 Aug 2016 19:23:30 +0000 (19:23 +0000)]
Pass in frame pointer omitting compiler flags for CloudABI as well.
On Linux we pass in -fomit-frame-pointer flags (and similar)
automatically if optimization is enabled. Let's do the same thing on
CloudABI. Without this, Clang seems to run out of registers quite
quickly while trying to build code with inline assembly.
llvm-svn: 278393
Rui Ueyama [Thu, 11 Aug 2016 19:22:34 +0000 (19:22 +0000)]
Split getArchName. NFC.
llvm-svn: 278392
Matt Arsenault [Thu, 11 Aug 2016 19:18:50 +0000 (19:18 +0000)]
AMDGPU: Prune includes
llvm-svn: 278391
Krzysztof Parzyszek [Thu, 11 Aug 2016 19:12:18 +0000 (19:12 +0000)]
[Hexagon] Standardize "select" pseudo-instructions
- PS_pselect: general register pairs
- PS_vselect: vector registers (+ 128B version)
- PS_wselect: vector register pairs (+ 128B version)
llvm-svn: 278390
Ivan Krasin [Thu, 11 Aug 2016 19:09:02 +0000 (19:09 +0000)]
WholeProgramDevirt: generate more detailed and accurate remarks.
Summary:
Keep track of all methods for which we have devirtualized at least
one call and then print them sorted alphabetically. That allows to
avoid duplicates and also makes the order deterministic.
Add optimization names into the remarks, so that it's easier to
understand how has each method been devirtualized.
Fix a bug when wrong methods could have been reported for
tryVirtualConstProp.
Reviewers: kcc, mehdi_amini
Differential Revision: https://reviews.llvm.org/D23297
llvm-svn: 278389
Marshall Clow [Thu, 11 Aug 2016 18:46:24 +0000 (18:46 +0000)]
Remove test for the sign of a NaN - doesn't work on MIPS, not strictly legal. Fixes bug 28936
llvm-svn: 278387
Pete Cooper [Thu, 11 Aug 2016 18:46:21 +0000 (18:46 +0000)]
Change all the libSystem test files to be dylibs instead of normalized files. Currently NFC.
A future commit will change when we choose to add an LC_LOAD_DYLIB to the final image. Currently
we do this when an atom is used, but we need to do it when a dylib is referenced on the cmdline as
this matches ld64.
To allow this change, libsystem (and other future yaml files representing dylibs) need to be dylibs
so that the loader can see to add them to the referenced dylib list.
llvm-svn: 278386
Pete Cooper [Thu, 11 Aug 2016 18:43:42 +0000 (18:43 +0000)]
Fix one more test missed by r278372. The next commit will update libsystem in a way which broke without this fix as it referenced the wrong file
llvm-svn: 278385
Wei Mi [Thu, 11 Aug 2016 18:42:56 +0000 (18:42 +0000)]
Remove the restriction that MachineSinking is now stopped by "insert_subreg,
subreg_to_reg, and reg_sequence" instructions.
This is to solve PR28852. The restriction was added at 2010 to make better register
coalescing. We assumed that it was not necessary any more. Testing results on x86
supported the assumption.
We will look closely to any performance impact it will bring and will be prepared
to help analyzing performance problem found on other architectures.
Differential Revision: https://reviews.llvm.org/D23210
llvm-svn: 278384
Krzysztof Parzyszek [Thu, 11 Aug 2016 18:42:06 +0000 (18:42 +0000)]
If-conversion incorrectly calculates liveness of redefined registers
Differential Revision: https://reviews.llvm.org/D23207
llvm-svn: 278383
Devin Coughlin [Thu, 11 Aug 2016 18:41:29 +0000 (18:41 +0000)]
[analyzer] Teach RetainCountChecker about CVFooRetain
Change the retain count checker to treat CoreFoundation-style "CV"-prefixed
reference types from CoreVideo similarly to CoreGraphics types. With this
change, we treat CVFooRetain() on a CVFooRef type as a retain. CVFooRelease()
APIs are annotated as consuming their parameter, so this change prevents false
positives about incorrect decrements of reference counts.
<rdar://problem/
27116090>
llvm-svn: 278382
Pete Cooper [Thu, 11 Aug 2016 18:41:14 +0000 (18:41 +0000)]
Fix off-by-one error in default currentVersion.
A version of 0x1000 is 0.16.0, not 1.0.0 as the comment said. Fix the
value to match the comment, and also the one test case which had this
wrong.
llvm-svn: 278381
Barnabas Bittner [Thu, 11 Aug 2016 18:34:29 +0000 (18:34 +0000)]
Test commit
llvm-svn: 278380
Bruno Cardoso Lopes [Thu, 11 Aug 2016 18:33:15 +0000 (18:33 +0000)]
[Sema] Add more strict check for sizeof diagnostics for bzero
Follow-up from r278264 after Joerg's feedback.
Since bzero is not standard, be more strict: also check if the first
argument is a pointer, which harden the check for when it does not come
originally from a builtin.
llvm-svn: 278379
Andrew Kaylor [Thu, 11 Aug 2016 18:28:33 +0000 (18:28 +0000)]
Target independent codesize heuristics for Loop Idiom Recognition
Patch by Sunita Marathe
Differential Revision: https://reviews.llvm.org/D21449
llvm-svn: 278378
Easwaran Raman [Thu, 11 Aug 2016 18:24:08 +0000 (18:24 +0000)]
Add a new method to create SimpleInliner instance and make pre-inliner use this.
This adds a createFunctionInliningPass pass that takes an InlineParams object and use this to create the pre-inliner pass. This prevents the regular inliner's threshold flag from influencing the preinliner.
Differential revision: https://reviews.llvm.org/D23377
llvm-svn: 278377
Krzysztof Parzyszek [Thu, 11 Aug 2016 18:15:16 +0000 (18:15 +0000)]
[Hexagon] Skip byval arguments when checking parameter attributes
From the point of view of register assignment, byval parameters are
ignored: a byval parameter is not going to be assigned to a register,
and it will not affect the assignments of subsequent parameters.
When matching registers with parameters in the bit tracker, make sure
to skip byval parameters before advancing the registers.
llvm-svn: 278375
Zachary Turner [Thu, 11 Aug 2016 18:10:40 +0000 (18:10 +0000)]
Modify coding conventions to mention include ordering.
llvm-svn: 278373
Pete Cooper [Thu, 11 Aug 2016 18:08:59 +0000 (18:08 +0000)]
Have one version of libSystem for each arch. NFC.
An upcoming commit will change how we choose to reference a dylib. Currently
dylibs are only given an LC_LOAD_DYLIB in the final image if an atom is used.
This is different from ld64 which adds the load command when the dylib is referenced
on the cmdline.
In order to change this behaviour, we need libSystem.yaml to actually contain a mach header
so that it is parsed as a dylib, instead of currently being parsed as a normalised file.
To get a mach header, we also require an arch, so now we have one libsystem per arch and
all the tests have been updated to choose the correct one.
llvm-svn: 278372