Alexander Droste [Fri, 12 Aug 2016 17:43:58 +0000 (17:43 +0000)]
Test commit - first LLVM repo commit
llvm-svn: 278533
Duncan P. N. Exon Smith [Fri, 12 Aug 2016 17:32:34 +0000 (17:32 +0000)]
ADT: Remove the ilist_nextprev_traits customization point
No one is using the capability to implement next and prev another way
(since lld stopped doing it in r278468). Remove the customization point
by moving the API from ilist_nextprev_traits<T> to ilist_node_access.
The old traits class is still useful/necessary API as a target for
friends of node types that inherit privately from ilist_node.
Eventually I plan to either remove it entirely or move the template
parameters to the methods.
(Note: if there's desire to bring back customization of next/prev
pointers in the future (e.g., to pack some bits in there), I think a
traits class like this is an awkward way to accomplish it. Instead, we
should change ilist<T> to be ilist<ilist_node<T>>, and give an extra
template parameter to ilist_node.)
llvm-svn: 278532
Michael Kuperstein [Fri, 12 Aug 2016 17:28:27 +0000 (17:28 +0000)]
[PM] Port LowerInvoke to the new pass manager
llvm-svn: 278531
Ivan Krasin [Fri, 12 Aug 2016 17:26:37 +0000 (17:26 +0000)]
Add compiler-rt side test for no_sanitize("cfi") attribute
Summary: Add a test case for __attribute__((no_sanitize("cfi"))) being effective.
Reviewers: kcc
Subscribers: dberris
Differential Revision: https://reviews.llvm.org/D23425
llvm-svn: 278530
Zachary Turner [Fri, 12 Aug 2016 17:15:38 +0000 (17:15 +0000)]
Disable TestThreadSpecificBpPlusCondition on Windows.
Test frequently times out stalling the test runner.
llvm-svn: 278529
Pete Cooper [Fri, 12 Aug 2016 17:13:28 +0000 (17:13 +0000)]
constify InstCombine::foldAllocaCmp. NFC.
This is part of an effort to constify ValueTracking.cpp. This change is
to methods which need const Value* instead of Value* to go with the upcoming
changes to ValueTracking.
llvm-svn: 278528
Todd Fiala [Fri, 12 Aug 2016 17:01:19 +0000 (17:01 +0000)]
Link LLDB only against libclang and libLLVM .a files to fix macOS build
The Xcode macOS build of LLDB is currently broken after
https://reviews.llvm.org/D23232 landed, see
http://lab.llvm.org:8080/green/job/lldb_build_test/20014/console,
because we’re trying to link against all .a files found in the
llvm-build/lib directory. Let’s be more specific in what we link
against. This patch applies a regexp to only use “libclang.*”,
“libLLVM.*” and not “libclang_rt.*” static archives.
Change by Kuba Mracek (formerly Kuba Brecka)
See review here:
https://reviews.llvm.org/D23444
Reviewers: tfiala, compnerd
llvm-svn: 278527
Zachary Turner [Fri, 12 Aug 2016 16:52:31 +0000 (16:52 +0000)]
Fix build on Windows.
llvm-svn: 278526
Duncan P. N. Exon Smith [Fri, 12 Aug 2016 16:46:25 +0000 (16:46 +0000)]
BugReporter: Use ilist_half_embedded_sentinel_traits, NFC
This avoids duplicated code with llvm/ADT/ilist.h. No functionality
change.
llvm-svn: 278525
Greg Clayton [Fri, 12 Aug 2016 16:46:18 +0000 (16:46 +0000)]
Switch over to using socketpair for local debugserver connections as they are twice as fast as TCP sockets (on macOS at least).
This change opens a socket pair and passes the second socket pair file descriptor down to the debugserver binary using a new option: "--fd=N" where N is the file descriptor. This file descriptor gets passed via posix_spawn() so that there is no need to do any bind/listen or bind/accept calls and eliminates the hanshake unix socket that is used to pass the result of the actual port that ends up being used so it can save time on launch as well as being faster.
This is currently only enabled on __APPLE__ builds. Other OSs should try modifying the #define from ProcessGDBRemote.cpp but the first person will need to port the --fd option over to lldb-server. Any OSs that enable USE_SOCKETPAIR_FOR_LOCAL_CONNECTION in their native builds can use the socket pair stuff. The #define is Apple only right now, but looks like:
#if defined (__APPLE__)
#define USE_SOCKETPAIR_FOR_LOCAL_CONNECTION 1
#endif
<rdar://problem/
27814880>
llvm-svn: 278524
Duncan P. N. Exon Smith [Fri, 12 Aug 2016 16:25:04 +0000 (16:25 +0000)]
MachO: Use ilist_half_embedded_sentinel_traits, NFC
Use ilist_half_embedded_sentinel_traits for the list of
lld::mach_o::normalized::TrieEdge, rather than duplicating the code.
llvm-svn: 278523
Dehao Chen [Fri, 12 Aug 2016 16:22:12 +0000 (16:22 +0000)]
Fine tuning of sample profile propagation algorithm.
Summary: The refined propagation algorithm is more accurate and robust.
Reviewers: davidxl, dnovillo
Subscribers: llvm-commits
Differential Revision: https://reviews.llvm.org/D23224
llvm-svn: 278522
Duncan P. N. Exon Smith [Fri, 12 Aug 2016 16:19:34 +0000 (16:19 +0000)]
Core: Use ilist_full_embedded_sentinel_traits for SimpleReference
Avoid custom code for sentinel traits in SimpleReference (the ilist node
for references to a SimpleDefinedAtom), since they'll soon/eventually
disappear from ilist entirely.
Rather than using a BumpPtrAllocator, this drops the lazy sentinel
characteristics and stores the sentinel directly in the ilist. This
unconditionally allocates the sentinel.
At first glance, this looks like it might increase memory usage
slightly, since an unreferenced SimpleDefinedAtom pays for a
6-pointer-sized sentinel even when its list of references is empty. In
practice, the sentinel was being lazily allocated at the first call to
DefinedAtom::begin/end anyway. I don't expect any real memory effects
here.
Moreover, this is an intermediate state. The ilist_*sentinel_traits are
being phased out.
As a preview of the final state: in lieu of a NodeTy sentinel, the ilist
will have a single, untemplated list_node_base that has next/prev
pointers. This base node will serve both as a sentinel and as a pointer
to the head of the list (the same memory layout as
ilist_half_embedded_sentinel_traits, but without the UB).
llvm-svn: 278521
Artur Pilipenko [Fri, 12 Aug 2016 16:08:30 +0000 (16:08 +0000)]
[x86] X86ISelLowering zext(add_nuw(x, C)) --> add(zext(x), C_zext)
Currently X86ISelLowering has a similar transformation for sexts:
sext(add_nsw(x, C)) --> add(sext(x), C_sext)
In this change I extend this code to handle zexts as well.
Reviewed By: spatel
Differential Revision: https://reviews.llvm.org/D23359
llvm-svn: 278520
Ehsan Amiri [Fri, 12 Aug 2016 16:05:03 +0000 (16:05 +0000)]
[BasicAA] Avoid calling GetUnderlyingObject, when the result of a previous call can be reused.
Recursive calls to aliasCheck from alias[GEP|Select|PHI] may result in a second call to GetUnderlyingObject for a Value, whose underlying object is already computed. This patch ensures that in this situations, the underlying object is not computed again, and the result of the previous call is resued.
https://reviews.llvm.org/D22305
llvm-svn: 278519
Artur Pilipenko [Fri, 12 Aug 2016 15:52:23 +0000 (15:52 +0000)]
[LVI] Take guards into account
Teach LVI to gather control dependant constraints from guards.
Reviewed By: sanjoy
Differential Revision: https://reviews.llvm.org/D23358
llvm-svn: 278518
Teresa Johnson [Fri, 12 Aug 2016 15:39:26 +0000 (15:39 +0000)]
Add move ops to satisfy MSVC.
Try to appease Windows bots after r278508:
http://lab.llvm.org:8011/builders/sanitizer-windows/builds/27250
http://lab.llvm.org:8011/builders/clang-x64-ninja-win7/builds/14776
llvm-svn: 278517
Daniel Sanders [Fri, 12 Aug 2016 15:34:35 +0000 (15:34 +0000)]
[mips] Remove obstack.cc XFAIL added in r278504 since it broke X86 and PPC somehow.
Adding the XFAIL has caused msan to report a different line number in the call
stack (@LINE-3 rather than @LINE-30). The new line number looks more correct
at first glance since it's the line that uses uninitialized memory rather than
the first non-whitespace line of the file but this needs investigating.
llvm-svn: 278516
Geoff Berry [Fri, 12 Aug 2016 15:26:00 +0000 (15:26 +0000)]
[AArch64] Re-factor code shared by AArch64LoadStoreOpt and AArch64InstrInfo.
This re-factoring could cause the following slight changes in generated
code, though none were observed during testing:
- MachineScheduler could decide not to cluster some loads/stores if
there are other load/stores with non-pairable opcodes that have the
same base register and offset as a pairable set of load/stores. One
case of different MachineScheduler pairing did show up in my testing,
but it wasn't due to this issue, but due
BaseMemOpClusterMutation::clusterNeighboringMemOps() being unstable
w.r.t. the order it considers memory operations. See PR28942.
- The ImplicitNullChecks optimization could be done for more load/store
opcodes. This optimization isn't done for C/C++ code, so it didn't
show up in my testing.
Reviewers: mcrosier, t.p.northover
Subscribers: aemerson, rengolin, mcrosier, llvm-commits
Differential Revision: https://reviews.llvm.org/D23365
llvm-svn: 278515
Artur Pilipenko [Fri, 12 Aug 2016 15:08:15 +0000 (15:08 +0000)]
[LVI] Fix potential memory corruption in getValueFromCondition
Rewrite Visited[Cond] = getValueFromConditionImpl(..., Visited) statement which can lead to a memory corruption since getValueFromConditionImpl changes Visited map and invalidates the iterators.
llvm-svn: 278514
Duncan P. N. Exon Smith [Fri, 12 Aug 2016 15:00:55 +0000 (15:00 +0000)]
ADT: Share code for embedded sentinel traits, NFC
Share code for the (mostly problematic) embedded sentinel traits.
- Move the LLVM_NO_SANITIZE("object-size") attribute to
ilist_half_embedded_sentinel_traits and ilist_embedded_sentinel_traits
(previously it spread throughout the code duplication).
- Add an ilist_full_embedded_sentinel_traits which has no UB (but has
the downside of storing the complete node).
- Replace all the custom sentinel traits in LLVM with a declaration of
ilist_sentinel_traits that inherits from one of the embedded sentinel
traits classes.
There are still custom sentinel traits in other LLVM subprojects. I'll
remove those in a follow-up.
Nothing at all should be changing here, this is just rearranging code.
Note that the final goal here is to remove the sentinel traits
altogether, settling on the memory layout of
ilist_half_embedded_sentinel_traits without the UB. This intermediate
step moves the logic into ilist.h.
llvm-svn: 278513
Teresa Johnson [Fri, 12 Aug 2016 14:55:43 +0000 (14:55 +0000)]
Fix type to avoid problems on 32-bit builds
lto::InputFile::Symbol::getCommonSize should return uint64_t instead of
size_t since it is returning the result of DataLayout::getTypeAllocSize
which returns uint64_t, and the result of getCommonSize is assigned to a
uint64_t variable. On 32-bit builds size_t is unsigned int and there are
type errors. This was introduced in r278338.
llvm-svn: 278512
James Y Knight [Fri, 12 Aug 2016 14:48:09 +0000 (14:48 +0000)]
Revert "[Sparc] Leon errata fix passes."
...and the two followup commits:
Revert "[Sparc][Leon] Missed resetting option flags from check-in 278489."
Revert "[Sparc][Leon] Errata fixes for various errata in different
versions of the Leon variants of the Sparc 32 bit processor."
This reverts commit r274856, r278489, and r278492.
llvm-svn: 278511
Tamas Berghammer [Fri, 12 Aug 2016 14:17:05 +0000 (14:17 +0000)]
Skip 2 android test what is broken because of debuggerd
debuggerd is a crash reporting system on android what installs some
signal handler for SEGV to print a backtrace in the log. Its behavior
breaks tests where the test tries to continue after a SEGV so we skip
them as this behavior isn't required on android anyway.
llvm-svn: 278510
Teresa Johnson [Fri, 12 Aug 2016 14:03:36 +0000 (14:03 +0000)]
[PM] Port NameAnonFunction pass to new pass manager
Summary:
Port the NameAnonFunction pass and add a test.
Depends on D23439.
Reviewers: mehdi_amini
Subscribers: llvm-commits, mehdi_amini
Differential Revision: https://reviews.llvm.org/D23440
llvm-svn: 278509
Teresa Johnson [Fri, 12 Aug 2016 13:53:02 +0000 (13:53 +0000)]
[PM] Port ModuleSummaryIndex analysis to new pass manager
Summary:
Port the ModuleSummaryAnalysisWrapperPass to the new pass manager.
Use it in the ported BitcodeWriterPass (similar to how we use the
legacy ModuleSummaryAnalysisWrapperPass in the legacy WriteBitcodePass).
Also, pass the -module-summary opt flag through to the new pass
manager pipeline and through to the bitcode writer pass, and add
a test that uses it.
Reviewers: mehdi_amini
Subscribers: llvm-commits, mehdi_amini
Differential Revision: https://reviews.llvm.org/D23439
llvm-svn: 278508
Martin Bohme [Fri, 12 Aug 2016 13:51:00 +0000 (13:51 +0000)]
[ASTMatchers] Add templateTypeParmDecl() to Registry.cpp
Summary:
This appears to have been forgotten when templateTypeParmDecl() was initially
added.
Reviewers: alexfh, aaron.ballman
Subscribers: aaron.ballman, klimek, aemerson, rengolin, samparker, cfe-commits
Differential Revision: https://reviews.llvm.org/D23448
llvm-svn: 278507
Davide Italiano [Fri, 12 Aug 2016 12:37:23 +0000 (12:37 +0000)]
[Core] Retire yet another unused member function.
The code in lib/ could use a lot of love :(
llvm-svn: 278506
Davide Italiano [Fri, 12 Aug 2016 12:34:39 +0000 (12:34 +0000)]
[Core] Simplify a bit. NFCI.
llvm-svn: 278505
Daniel Sanders [Fri, 12 Aug 2016 11:56:36 +0000 (11:56 +0000)]
[mips] XFAIL the new mips64el compiler-rt tests that fail on clang-cmake-mipsel.
The mips64el compiler-rt build has recently been enabled. XFAIL the failing
tests to make the buildbot green again.
The two asan tests require the integrated assembler. This will be fixed soon
for Debian mips64el but not for any other mips64el targets since doing so
requires triple-related issues to be fixed..
The msan tests are largely failing because caused by a kernel update (a patch
has already been posted for this).
I'm not sure why the dfsan test fails yet.
llvm-svn: 278504
Simon Pilgrim [Fri, 12 Aug 2016 11:43:57 +0000 (11:43 +0000)]
Fix Wdocumentation unknown parameter warning
llvm-svn: 278503
Simon Pilgrim [Fri, 12 Aug 2016 11:24:34 +0000 (11:24 +0000)]
[X86][SSE] Add support for combining target shuffles to PSLLDQ/PSRLDQ byte shifts
llvm-svn: 278502
Andrey Bokhanko [Fri, 12 Aug 2016 11:22:12 +0000 (11:22 +0000)]
Fix For pr28288 - Error message in shift of vector values
This fixes an error in type checking of shift of vector values.
Patch by Vladimir Yakovlev.
Differential Revision: https://reviews.llvm.org/D21678
llvm-svn: 278501
Pavel Labath [Fri, 12 Aug 2016 11:20:21 +0000 (11:20 +0000)]
Fix-up r278299 for windows
FD_SETSIZE on windows limits the number of file descriptors, rather than their individual
magnitude (the underlying implementation uses an array rather than a bitset). This meant that the
assert in the SelectHelper was incorrect, and failing all the time. Fix that.
I am not sure whether this should be #ifdef MSVC, or #ifdef WINDOWS, but my feeling is that a
more posix-conforming implementation on windows would choose the bitset implementation, so I'm
sticking with the former.
llvm-svn: 278500
Krzysztof Parzyszek [Fri, 12 Aug 2016 11:12:02 +0000 (11:12 +0000)]
[Hexagon] Standardize pseudo-instructions for calls and returns
- CALLv3nr PS_call_nr
- CALLRv3nr PS_callr_nr
- CALLstk PS_call_stk
- TCRETURNi PS_tailcall_i
- TCRETURNr PS_tailcall_r
- JMPret PS_jmpret
- JMPrett PS_jmprett
- JMPretf PS_jmpretf
- JMPrettnew PS_jmprettnew
- JMPretfnew PS_jmpretfnew
- JMPrettnewpt PS_jmprettnewpt
- JMPretfnewpt PS_jmpretfnewpt
llvm-svn: 278499
Krzysztof Parzyszek [Fri, 12 Aug 2016 11:01:10 +0000 (11:01 +0000)]
[Hexagon] Treat non-returning indirect calls as scheduling boundaries
llvm-svn: 278498
Jonas Hahnfeld [Fri, 12 Aug 2016 10:36:04 +0000 (10:36 +0000)]
Fix cuda-detect.cu when CLANG_DEFAULT_CXX_STDLIB is set
Reported by Ismail Donmez!
llvm-svn: 278497
Artur Pilipenko [Fri, 12 Aug 2016 10:14:11 +0000 (10:14 +0000)]
[LVI] Take range metadata into account while calculating icmp condition constraints
Take range metadata into account for conditions like this:
%length = load i32, i32* %length_ptr, !range !{i32 0, i32
2147483647}
%cmp = icmp ult i32 %a, %length
This is a common pattern for range checks where the length of the array is dynamically loaded.
Reviewed By: sanjoy
Differential Revision: https://reviews.llvm.org/D23267
llvm-svn: 278496
Benjamin Kramer [Fri, 12 Aug 2016 10:13:45 +0000 (10:13 +0000)]
[Webassembly] disable unstable test.
It reads uninitialized memory and crashes randomly.
llvm-svn: 278495
Simon Pilgrim [Fri, 12 Aug 2016 10:10:51 +0000 (10:10 +0000)]
[X86][SSE] Fixed PALIGNR target shuffle decode
The PALIGNR target shuffle decode was not taking into account that DecodePALIGNRMask (rather oddly) expects the operands to be in reverse order, nor was it detecting unary patterns, causing combines to combine with the incorrect input.
The cgbuiltin, auto upgrade and instruction comments code correctly swap the operands so are not affected.
llvm-svn: 278494
Artur Pilipenko [Fri, 12 Aug 2016 10:05:11 +0000 (10:05 +0000)]
[LVI] Handle any predicate in comparisons like icmp <pred> (add Val, Offset), ...
Currently LVI can only gather value constraints from comparisons like:
* icmp <pred> Val, ...
* icmp ult (add Val, Offset), ...
In fact we can handle any predicate in latter comparisons.
Reviewed By: sanjoy
Differential Revision: https://reviews.llvm.org/D23357
llvm-svn: 278493
Chris Dewhurst [Fri, 12 Aug 2016 09:54:39 +0000 (09:54 +0000)]
[Sparc][Leon] Missed resetting option flags from check-in 278489.
llvm-svn: 278492
Pavel Labath [Fri, 12 Aug 2016 09:52:14 +0000 (09:52 +0000)]
XFAIL TestNamespaceDefinitions on gcc-4.8 and below
llvm-svn: 278491
Pavel Labath [Fri, 12 Aug 2016 09:39:22 +0000 (09:39 +0000)]
Make TestCallStopAndContinue clang-format-resilient
llvm-svn: 278490
Chris Dewhurst [Fri, 12 Aug 2016 09:34:26 +0000 (09:34 +0000)]
[Sparc][Leon] Errata fixes for various errata in different versions of the Leon variants of the Sparc 32 bit processor.
The nature of the errata are listed in the comments preceding the errata fix passes. Relevant unit tests are implemented for each of these.
These changes update older versions of these errata fixes with improvements to code and unit tests.
Differential Revision: https://reviews.llvm.org/D21960
llvm-svn: 278489
Benjamin Kramer [Fri, 12 Aug 2016 09:23:14 +0000 (09:23 +0000)]
Prune unused diagnostics. NFC.
llvm-svn: 278488
Benjamin Kramer [Fri, 12 Aug 2016 09:19:34 +0000 (09:19 +0000)]
[C++1z] Fix crash when decomposing structs with anonymous members.
The diagnostic format was invalid.
llvm-svn: 278487
George Rimar [Fri, 12 Aug 2016 09:07:57 +0000 (09:07 +0000)]
[ELF] - Linkerscript: reimplemented output sections constrains matching functionality.
Previously filtering that was used worked incorrectly.
For example for next script it would just remove both sections completely:
SECTIONS {
. = 0x1000;
.aaa : ONLY_IF_RW { *(.aaa.*) }
. = 0x2000;
.aaa : ONLY_IF_RO { *(.aaa.*) }
}
Patch fixes above issues and adds testcase showing the issue. Testcase is a subset of
FreeBSD script which has:
.eh_frame : ONLY_IF_RO { KEEP (*(.eh_frame)) }
...
.eh_frame : ONLY_IF_RW { KEEP (*(.eh_frame)) }
Differential revision: https://reviews.llvm.org/D23326
llvm-svn: 278486
Benjamin Kramer [Fri, 12 Aug 2016 08:47:13 +0000 (08:47 +0000)]
[Coroutines] Move class into anonymous namespace.
Hopefully fixes visibility warnings from GCC. No functionality change.
llvm-svn: 278485
Haicheng Wu [Fri, 12 Aug 2016 08:40:24 +0000 (08:40 +0000)]
Revert "[BranchFolding] Restrict tail merging loop blocks after MBP"
This reverts commit r278463 because it hits the bot.
llvm-svn: 278484
Roger Ferrer Ibanez [Fri, 12 Aug 2016 08:04:13 +0000 (08:04 +0000)]
This patch implements PR#22821.
Taking the address of a packed member is dangerous since the reduced
alignment of the pointee is lost. This can lead to memory alignment
faults in some architectures if the pointer value is dereferenced.
This change adds a new warning to clang emitted when taking the address
of a packed member. A packed member is either a field/data member
declared as attribute((packed)) or belonging to a struct/class
declared as such. The associated flag is -Waddress-of-packed-member.
Conversions (either implicit or via a valid casting) to pointer types
with lower or equal alignment requirements (e.g. void* or char*)
will silence the warning.
Differential Revision: https://reviews.llvm.org/D20561
llvm-svn: 278483
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