Commit Graph

172856 Commits

Author SHA1 Message Date
Chandler Carruth 2e6ef0e80f [LCG] During the incremental re-build of an SCC after removing an edge,
remove the nodes in the SCC from the SCC map entirely prior to the DFS
walk. This allows the SCC map to represent both the state of
not-yet-re-added-to-an-SCC and added-back-to-this-SCC independently. The
first is being missing from the SCC map, the second is mapping back to
'this'. In a subsequent commit, I'm going to use this property to
simplify the new node list for this SCC.

In theory, I think this also makes the contract for orphaning a node
from the graph slightly less confusing. Now it is also orphaned from the
SCC graph. Still, this isn't quite right either, and so I'm not adding
test cases here. I'll add test cases for the behavior of orphaning nodes
when the code *actually* supports it. The change here is mostly
incidental, my goal is simplifying the algorithm.

llvm-svn: 207213
2014-04-25 09:08:10 +00:00
Chandler Carruth 770060ddfa [LCG] Rather than doing a linear time SmallSetVector removal of each
child from the worklist, wait until we actually need to pop another
element off of the worklist and skip over any that were already visited
by the DFS. This also enables swapping the nodes of the SCC into the
worklist. No functionality changed.

llvm-svn: 207212
2014-04-25 09:08:05 +00:00
Dmitry Vyukov 0d0107d2ef tsan: better reports for "unlock of an unlocked mutex"
llvm-svn: 207211
2014-04-25 09:01:17 +00:00
Kostya Serebryany e91930a7e6 [asan] implement an experimental detector of ODR violations. Not tested yet outside of a tiny test, may need tuning.
llvm-svn: 207210
2014-04-25 08:58:28 +00:00
Dmitry Vyukov 56a18f02ea tsan: better reports for "read lock of a write locked mutex"
llvm-svn: 207209
2014-04-25 08:58:23 +00:00
Dmitry Vyukov e296164f77 tsan: improve "read unlock of a write locked mutex" report
llvm-svn: 207208
2014-04-25 08:21:30 +00:00
Dmitry Vyukov 66dbbbc47b tsan: fix tests
failure:
http://lab.llvm.org:8011/builders/llvm-clang-lld-x86_64-centos-6.5/builds/3747/steps/test/logs/stdio

llvm-svn: 207207
2014-04-25 08:13:45 +00:00
Dmitry Vyukov 2c87108a42 tsan: better report for bad mutex unlocks
+ fixes crashes due to races on symbolizer, see
https://code.google.com/p/thread-sanitizer/issues/detail?id=55

llvm-svn: 207206
2014-04-25 07:55:11 +00:00
Dmitry Vyukov ea014b787a tsan: add new test for commit 207204 (forget to add new file)
llvm-svn: 207205
2014-04-25 07:49:36 +00:00
Dmitry Vyukov c845decce1 tsan: better reports for "double lock of a mutex"
+ fixes crashes due to races on symbolizer, see:
https://code.google.com/p/thread-sanitizer/issues/detail?id=55

llvm-svn: 207204
2014-04-25 07:42:55 +00:00
Justin Bogner 3212b18bbf CodeGen: Avoid instrumenting implicit Decls more effectively
We don't assign counters for implicit Decls, but we were emitting code
to increment the (non-existent) counters and adding empty counter
lists in the output. This fixes the checks in assignRegionCounters and
emitInstrumentationData to do the right thing, and adds an assert for
the pathological case of emitting zero counters.

llvm-svn: 207203
2014-04-25 07:20:05 +00:00
Chandler Carruth 6b88e3a545 [LCG] Remove a completely unnecessary loop. It wasn't even doing any
thing, just mucking up the code. I feel bad that I even wrote this loop.
Very sorry. The diff is huge because of the indent change, but I promise
all this is doing is realizing that the outer two loops were actually
the exact same loops, and we didn't need two of them.

llvm-svn: 207202
2014-04-25 06:45:06 +00:00
Chandler Carruth 774c9320c0 [LCG] Now that the loop structure of the core SCC finding routine is
factored into a more reasonable form, replace the tail call with
a simple outer-loop continuation. It's sad that C++ makes this so
awkward to write, but it seems more direct and clear than the tail call
at this point.

llvm-svn: 207201
2014-04-25 06:38:58 +00:00
Saleem Abdulrasool d4cae62fda X86: convert object streamer selection to a switch
Change the object streamer selection to a switch from a series of if conditions.
Rather than defaulting to ELF, require that an ELF format is requested.  The
Windows/!ELF is maintained as MachO would have been selected first and will
still provide a MachO format.  Add an assertion that if COFF is requested that
the target platform is Windows as only WinCOFF object emission is currently
supported.

llvm-svn: 207200
2014-04-25 06:29:36 +00:00
Anders Waldenborg f3a1acfbf7 [python] Fix getting section contents.
The returnvalue was handled as c_char_p which ment that ctypes
handled it as a NUL-terminated string making it cut the contents
at first NUL (or even worse - overrunning the buffer if it doesn't
contain a NUL).

Differential Revision: http://reviews.llvm.org/D3474

llvm-svn: 207199
2014-04-25 06:25:15 +00:00
David Blaikie 69d0cf06bc Add missing cpp file header
Code review feedback from Paul Robinson on r207022

llvm-svn: 207198
2014-04-25 06:22:32 +00:00
Craig Topper 062a2baef0 [C++] Use 'nullptr'. Target edition.
llvm-svn: 207197
2014-04-25 05:30:21 +00:00
Craig Topper f40110f4d8 [C++] Use 'nullptr'. Transforms edition.
llvm-svn: 207196
2014-04-25 05:29:35 +00:00
Duncan P. N. Exon Smith cb7d29d30c blockfreq: Only one mass distribution per node
Remove the concepts of "forward" and "general" mass distributions, which
was wrong.  The split might have made sense in an early version of the
algorithm, but it's definitely wrong now.

<rdar://problem/14292693>

llvm-svn: 207195
2014-04-25 04:38:43 +00:00
Duncan P. N. Exon Smith ebf7626988 blockfreq: Document assertion
<rdar://problem/14292693>

llvm-svn: 207194
2014-04-25 04:38:40 +00:00
Duncan P. N. Exon Smith 84408d1fda blockfreq: Use better branch weights in multiexit test
The branch weights were even before.  Make them different.

<rdar://problem/14292693>

llvm-svn: 207193
2014-04-25 04:38:37 +00:00
Duncan P. N. Exon Smith 58c8948a0c blockfreq: Clean up irreducible testcases
Strip irreducible testcases to pure control flow.  The function calls
made the branch weights more believable but cluttered it up a lot.
There isn't going to be any constant analysis here, so just use dumb
branch logic to clarify the important parts.

<rdar://problem/14292693>

llvm-svn: 207192
2014-04-25 04:38:35 +00:00
Duncan P. N. Exon Smith 3f086789ff blockfreq: Document high-level functions
<rdar://problem/14292693>

llvm-svn: 207191
2014-04-25 04:38:32 +00:00
Duncan P. N. Exon Smith 71f07451b6 blockfreq: Remove dead code
<rdar://problem/14292693>

llvm-svn: 207190
2014-04-25 04:38:30 +00:00
Duncan P. N. Exon Smith 5291d2a561 blockfreq: Scale LoopData::Scale on the way down
Rather than scaling loop headers and then scaling all the loop members
by the header frequency, scale `LoopData::Scale` itself, and scale the
loop members by it.  It's much more obvious what's going on this way,
and doesn't cost any extra multiplies.

<rdar://problem/14292693>

llvm-svn: 207189
2014-04-25 04:38:27 +00:00
Duncan P. N. Exon Smith 0633f0ec29 blockfreq: unwrapLoopPackage() => unwrapLoop()
<rdar://problem/14292693>

llvm-svn: 207188
2014-04-25 04:38:25 +00:00
Duncan P. N. Exon Smith da0b21cf96 blockfreq: Pass the Loop directly into unwrapLoopPackage()
<rdar://problem/14292693>

llvm-svn: 207187
2014-04-25 04:38:23 +00:00
Duncan P. N. Exon Smith 575bd8c81b blockfreq: Unwrap from Loops
When unwrapping loops, just visit the loops rather than all nodes.

<rdar://problem/14292693>

llvm-svn: 207186
2014-04-25 04:38:20 +00:00
Duncan P. N. Exon Smith 46d9a56ce6 blockfreq: Separate unwrapLoops() from finalizeMetrics()
<rdar://problem/14292693>

llvm-svn: 207185
2014-04-25 04:38:17 +00:00
Duncan P. N. Exon Smith 50a1bb85b8 blockfreq: LoopData::MemberList => NodeList
<rdar://problem/14292693>

llvm-svn: 207184
2014-04-25 04:38:15 +00:00
Duncan P. N. Exon Smith c9b7cfea2f blockfreq: Expose getPackagedNode()
Make `getPackagedNode()` a member function of
`BlockFrequencyInfoImplBase` so that it's available for templated code.

<rdar://problem/14292693>

llvm-svn: 207183
2014-04-25 04:38:12 +00:00
Duncan P. N. Exon Smith 1cab8a0708 blockfreq: Store the header with the members
<rdar://problem/14292693>

llvm-svn: 207182
2014-04-25 04:38:09 +00:00
Duncan P. N. Exon Smith 39cc64827e blockfreq: Encapsulate LoopData::Header
<rdar://problem/14292693>

llvm-svn: 207181
2014-04-25 04:38:06 +00:00
Duncan P. N. Exon Smith 4bbaff75e0 blockfreq: Embed Loop hierarchy in LoopData
Continue refactoring to make `LoopData` first-class.  Here I'm making
the `LoopData` hierarchy explicit, instead of bouncing back and forth
with `WorkingData`.  This simplifies the logic and better matches the
`LoopInfo` design.  (Eventually, `LoopInfo` should be restructured so
that it supports this pass, and `LoopData` can be removed.)

<rdar://problem/14292693>

llvm-svn: 207180
2014-04-25 04:38:03 +00:00
Duncan P. N. Exon Smith d132040ed6 blockfreq: Use LoopData directly
Instead of passing around loop headers, pass around `LoopData` directly.

<rdar://problem/14292693>

llvm-svn: 207179
2014-04-25 04:38:01 +00:00
Duncan P. N. Exon Smith e005c7c496 blockfreq: Stop using range-based for to traverse Loops
A follow-up commit will need the actual iterators.

<rdar://problem/14292693>

llvm-svn: 207178
2014-04-25 04:37:58 +00:00
Duncan P. N. Exon Smith fc7dc93031 blockfreq: Use a std::list for Loops
As pointed out by David Blaikie in code review, a `std::list<T>` is
simpler than a `std::vector<std::unique_ptr<T>>`.  Another option is a
`std::deque<T>` (which allocates in chunks), but I'd like to leave open
the option of inserting in the middle of the sequence for handling
irreducible control flow on the fly.

<rdar://problem/14292693>

llvm-svn: 207177
2014-04-25 04:30:06 +00:00
Craig Topper e6cb63e471 [C++] Use 'nullptr'. Tools edition.
llvm-svn: 207176
2014-04-25 04:24:47 +00:00
Rui Ueyama 409ac186bb [PECOFF] Add /IMPLIB command line option.
This option is to override the default import file path.

llvm-svn: 207175
2014-04-25 03:35:13 +00:00
Karthik Bhat 6a48f7d66e Allow vectorization of bit intrinsics in BB Vectorizer.
This patch adds support for vectorization of  bit intrinsics such as bswap,ctpop,ctlz,cttz.

llvm-svn: 207174
2014-04-25 03:33:48 +00:00
Saleem Abdulrasool 05f9613610 bindings: expose C++ access specifiers
Expose the enum CX_CXXAccessSpecifier in the python bindings as a property of
the cursor.  If access specifier is not applicable to the node, return the
INVALID specifier rather than raising an exception.

Patch by Tamás Szeli!

llvm-svn: 207173
2014-04-25 02:58:03 +00:00
Justin Bogner b59d7c73b0 ProfileData: Treat missing function counts as malformed
llvm-svn: 207172
2014-04-25 02:45:33 +00:00
Reid Kleckner 65fc0e2c00 Change llvm-config --ldflags to report ${CMAKE_CXX_LINK_FLAGS}
Should fix PR19526.

When Oscar added this code in the intial CMake build system port, he had
a TODO saying that ${CMAKE_SHARED_LINKER_FLAGS} was probably wrong.  I
agree.  I'm using ${CMAKE_CXX_LINK_FLAGS} to point LLVM at my custom
installation of gcc 4.recent, so that seems more correct.  With this
change, I can build creduce against an installed clang, and it picks up
the write flags from --ldflags.

llvm-svn: 207171
2014-04-25 01:44:20 +00:00
Nick Kledzik 0fef333dee Properly sign extend delta in compact unwind info
llvm-svn: 207170
2014-04-25 01:39:06 +00:00
Nick Kledzik f00751bfa1 Fix one missed use of DW_EH_PE_omit in r203626
llvm-svn: 207169
2014-04-25 01:35:29 +00:00
Rui Ueyama 51d7efdb57 [PECOFF] Assign unique ordinals to __imp_ symbols.
llvm-svn: 207168
2014-04-25 01:18:40 +00:00
David Blaikie 39fa6a285c Fix quadratic performance during debug compression due to sections x symbols iteration.
When fixing the symbols in each compressed section we were iterating
over all symbols for each compressed section. In extreme cases this
could snowball severely (5min uncompressed -> 35min compressed) due to
iterating over all symbols for each compressed section (large numbers of
compressed sections can be generated by DWARF type units).

To address this, build a map of the symbols in each section ahead of
time, and access that map if a section is being compressed. This brings
compile time for the aforementioned example down to ~6 minutes.

llvm-svn: 207167
2014-04-25 00:48:01 +00:00
Adrian Prantl 6e5de2ea06 Revert "This reapplies r207130 with an additional testcase+and a missing check for"
Typo in testcase.

llvm-svn: 207166
2014-04-25 00:42:50 +00:00
Adrian Prantl 3512190ab3 This reapplies r207130 with an additional testcase+and a missing check for
AllocaInst that was missing in one location.
Debug info for optimized code: Support variables that are on the stack and
described by DBG_VALUEs during their lifetime.

Previously, when a variable was at a FrameIndex for any part of its
lifetime, this would shadow all other DBG_VALUEs and only a single
fbreg location would be emitted, which in fact is only valid for a small
range and not the entire lexical scope of the variable. The included
dbg-value-const-byref testcase demonstrates this.

This patch fixes this by
Local
- emitting dbg.value intrinsics for allocas that are passed by reference
- dropping all dbg.declares (they are now fully lowered to dbg.values)
SelectionDAG
- renamed constructors for SDDbgValue for better readability.
- fix UserValue::match() to handle indirect values correctly
- not inserting an MMI table entries for dbg.values that describe allocas.
- lowering dbg.values that describe allocas into *indirect* DBG_VALUEs.
CodeGenPrepare
- leaving dbg.values for an alloca were they are (see comment)
Other
- regenerated/updated instcombine.ll testcase and included source

rdar://problem/16679879
http://reviews.llvm.org/D3374

llvm-svn: 207165
2014-04-25 00:38:40 +00:00
Greg Clayton 0c4129f2f7 Make sure that the CommandInterpreter::m_command_io_handler_sp gets reset when we quit.
Currently if you run _any_ python, python has the "lldb.debugger" global variable and it has a strong reference to a lldb_private::Debugger since it is a lldb::SBDebugger object with a shared pointer.

This makes sure that your LLDB command interpreter history is saved each time you quit command line LLDB.

llvm-svn: 207164
2014-04-25 00:35:14 +00:00