Commit Graph

117372 Commits

Author SHA1 Message Date
Peter Collingbourne 0e7e3fc130 Delete the depfile if we could not open a header file. We cannot
generate any reasonable depfile if a header is missing.

llvm-svn: 145019
2011-11-21 00:01:14 +00:00
Peter Collingbourne 119cfaa595 Teach the driver about failure result files, which are compilation
output files that are valid regardless of whether the compilation
succeeded or failed (but not if we crash).  Add depfiles to the
failure result file list.

llvm-svn: 145018
2011-11-21 00:01:05 +00:00
Peter Collingbourne 17a7bbbc9f Create the clang++ symlink as a POST_BUILD custom command on clang.
This saves us from re-creating the symlink on every build even if we
didn't rebuild clang.

llvm-svn: 145017
2011-11-21 00:00:48 +00:00
Benjamin Kramer ddbb2b85ab CodeGen: allow __asm renaming on static local variables.
Fixes PR4777.

llvm-svn: 145015
2011-11-20 21:05:04 +00:00
Nick Lewycky 6ae03c3378 Less template, more virtual! Refactoring suggested by Chris in code review.
llvm-svn: 145014
2011-11-20 19:37:06 +00:00
Nick Lewycky 612d70b19d Refactor code to use new attribute getters on CallSite for NoCapture and ByVal.
Suggested in code review by Eli.

That code in InstCombine looks kinda suspicious.

llvm-svn: 145013
2011-11-20 19:09:04 +00:00
Douglas Gregor 8ad31c2e36 Allow preprocessor callbacks to recover from a "file not found" error,
from Jason Haslam!

llvm-svn: 145012
2011-11-20 17:46:46 +00:00
NAKAMURA Takumi 76dfa03874 test/CodeGen/X86/block-placement.ll: Relax expressions for Win32.
llvm-svn: 145011
2011-11-20 12:49:45 +00:00
Chandler Carruth 18dfac385b The logic for breaking the CFG in the presence of hot successors didn't
properly account for the *global* probability of the edge being taken.
This manifested as a very large number of unconditional branches to
blocks being merged against the CFG even though they weren't
particularly hot within the CFG.

The fix is to check whether the edge being merged is both locally hot
relative to other successors for the source block, and globally hot
compared to other (unmerged) predecessors of the destination block.

This introduces a new crasher on GCC single-source, but it's currently
behind a flag, and Ben has offered to work on the reduction. =]

llvm-svn: 145010
2011-11-20 11:22:06 +00:00
Chandler Carruth bcb5f39526 Make an obviously const interface actually be marked as const.
llvm-svn: 145009
2011-11-20 11:22:03 +00:00
Benjamin Kramer 650c09aa4d XFAIL this test until I figure out what indvars is doing here (or find someone who does)
llvm-svn: 145008
2011-11-20 11:10:03 +00:00
Benjamin Kramer b5ba2eef2d SCEV: Actually set overflow flags on add expressions.
setFlags doesn't modify its arguments.

llvm-svn: 145007
2011-11-20 10:24:36 +00:00
Chandler Carruth 20df3953d3 Add some comments to the latest test case I added here to document what
is actually being tested. Also add some FileCheck goodness to much more
carefully ensure that the result is the desired result. Before this test
would only have failed through an assert failure if the underlying fix
were reverted.

Also, add some weight metadata and a comment explaining exactly what is
going on to a trick section of the test case. Originally, we were
getting very unlucky and trying to form a block chain that isn't
actually profitable. I'm working on a fix to avoid forming these
unprofitable chains, and that would also have masked any failure from
this test case. The easy solution is to add some metadata that makes it
*really* profitable to form the bad chain here.

llvm-svn: 145006
2011-11-20 09:30:40 +00:00
Craig Topper e79761df73 Add code for lowering v32i8 shifts by a splat to AVX2 immediate shift instructions. Remove 256-bit splat handling from LowerShift as it was already handled by PerformShiftCombine.
llvm-svn: 145005
2011-11-20 00:12:05 +00:00
Craig Topper a3a6583694 Use 256-bit vcmpeqd for creating an all ones vector when AVX2 is enabled.
llvm-svn: 145004
2011-11-19 22:34:59 +00:00
Craig Topper bac86038ac Remove some of the special classes that worked around an old tablegen limitation of not being able to remove redundant bitconverts from patterns.
llvm-svn: 145003
2011-11-19 21:01:54 +00:00
Douglas Gregor 49ccfaa938 Add support for pretty-printing attributes, from Richard Membarth!
llvm-svn: 145002
2011-11-19 19:22:57 +00:00
Douglas Gregor 9f39a765e2 Update signature of HandleTopLevelDecl.
llvm-svn: 145001
2011-11-19 19:22:13 +00:00
Douglas Gregor 328d8d255e Tweak the guidelines for when one should send patches to cfe-commits vs. cfe-dev
llvm-svn: 145000
2011-11-19 19:14:26 +00:00
Craig Topper 3af6ae089f Custom lower AVX2 variable shift intrinsics to shl/srl/sra nodes and remove the intrinsic patterns.
llvm-svn: 144999
2011-11-19 17:46:46 +00:00
Abramo Bagnara 5001caa1b6 Fixed HadMultipleCandidates loading.
llvm-svn: 144995
2011-11-19 11:44:21 +00:00
Chandler Carruth f3dc9eff16 Move the handling of unanalyzable branches out of the loop-driven chain
formation phase and into the initial walk of the basic blocks. We
essentially pre-merge all blocks where unanalyzable fallthrough exists,
as we won't be able to update the terminators effectively after any
reorderings. This is quite a bit more principled as there may be CFGs
where the second half of the unanalyzable pair has some analyzable
predecessor that gets placed first. Then it may get placed next,
implicitly breaking the unanalyzable branch even though we never even
looked at the part that isn't analyzable. I've included a test case that
triggers this (thanks Benjamin yet again!), and I'm hoping to synthesize
some more general ones as I dig into related issues.

Also, to make this new scheme work we have to be able to handle branches
into the middle of a chain, so add this check. We always fallback on the
incoming ordering.

Finally, this starts to really underscore a known limitation of the
current implementation -- we don't consider broken predecessors when
merging successors. This can caused major missed opportunities, and is
something I'm planning on looking at next (modulo more bug reports).

llvm-svn: 144994
2011-11-19 10:26:02 +00:00
Benjamin Kramer 7824360017 Driver: Remove the signal number from the "command failed" diagnostic.
- With the current implementation of sys::Program this always printed "2".
- The command execution code will output the right number anyway (including the signal name).

llvm-svn: 144993
2011-11-19 10:24:49 +00:00
Douglas Gregor 6cdda3bde6 Initialize ImplicitConversionSequence::ListInitializationSequence. Fixes PR11394
llvm-svn: 144992
2011-11-19 09:56:57 +00:00
Douglas Gregor 3005bfd516 Add missing initialization in the ContentCache. Seriously, when do
constructors go below public member functions?

llvm-svn: 144991
2011-11-19 09:42:42 +00:00
Craig Topper 6d77f4ae14 Test cases for SSSE3/AVX integer horizontal add/sub.
llvm-svn: 144990
2011-11-19 09:03:33 +00:00
Craig Topper f984efbfce Synthesize SSSE3/AVX 128-bit horizontal integer add/sub instructions from add/sub of appropriate shuffle vectors.
llvm-svn: 144989
2011-11-19 09:02:40 +00:00
Craig Topper 81390be00f Collapse X86 PSIGNB/PSIGNW/PSIGND node types.
llvm-svn: 144988
2011-11-19 07:33:10 +00:00
Craig Topper de6b73bb4d Extend VPBLENDVB and VPSIGN lowering to work for AVX2.
llvm-svn: 144987
2011-11-19 07:07:26 +00:00
Craig Topper 75ffc5fbb5 Remove some unnecessary filtering checks from X86 disassembler table build.
llvm-svn: 144986
2011-11-19 05:48:20 +00:00
Craig Topper 66e2b5a61e Remove unused parameters from the AVX maskmov classes.
llvm-svn: 144985
2011-11-19 04:49:22 +00:00
Sean Callanan 7f27d6044e Pulled in a new revision of LLVM/Clang and added
several patches.  These patches fix a problem
where templated types were not being completed the
first time they were used, and fix a variety of
minor issues I discovered while fixing that problem.

One of the previous local patches was resolved in
the most recent Clang, so I removed it.  The others
will be removed in due course.

llvm-svn: 144984
2011-11-19 02:54:21 +00:00
Greg Clayton 3b608422e8 Further performance improvements in the DWARF parser:
1 - the DIE collections no longer have the NULL tags which saves up to 25%
    of the memory on typical C++ code
2 - faster parsing by not having to run the SetDIERelations() function anymore
    it is done when parsing the DWARF very efficiently.

llvm-svn: 144983
2011-11-19 02:11:30 +00:00
Sean Callanan b5c796215d Ensure that the empty RecordDecl generated for
templates is properly complete (though still
empty).

llvm-svn: 144982
2011-11-19 01:35:08 +00:00
Jim Ingham 9683ff1211 Handle stepping through a trampoline where the jump target is calculated a runtime - and so doesn't match
the name of the PLT entry.  This solution assumes a naming convention agreed upon by us and the system folks,
and isn't general.  The general solution requires actually finding & calling the resolver function if it
hasn't been called yet.  That's more tricky.

llvm-svn: 144981
2011-11-19 00:19:25 +00:00
Francois Pichet 6dc4c16417 Enable delayed template parsing for friend functions declared at template class scope.
llvm-svn: 144980
2011-11-18 23:47:17 +00:00
Abramo Bagnara 12dcbf3eaa Fixed implicit instantiations source range.
llvm-svn: 144977
2011-11-18 08:08:52 +00:00
Greg Clayton 46fb558df1 Added optional calls to lldb_private::Process for getting memory region info
from a process and hooked it up to the new packet that was recently added
to our GDB remote executable named debugserver. Now Process has the following
new calls:

virtual Error
Process::GetMemoryRegionInfo (lldb::addr_t load_addr, MemoryRegionInfo &range_info);

virtual uint32_t
GetLoadAddressPermissions (lldb::addr_t load_addr);

Only the first one needs to be implemented by subclasses that can add this
support.

Cleaned up the way the new packet was implemented in debugserver to be more
useful as an API inside debugserver. Also found an error where finding a region
for an address actually will pick up the next region that follows the address
in the query so we also need ot make sure that the address we requested the
region for falls into the region that gets returned.

llvm-svn: 144976
2011-11-18 07:03:08 +00:00
Greg Clayton 7ba18027e9 Looking at our memory usage with Instruments when debugging a large application
we say that the vectors of DWARFDebugInfoEntry objects were the highest on the
the list. 

With these changes we cut our memory usage by 40%!!! I did this by reducing
the size of the DWARFDebugInfoEntry from a previous:

uint32_t offset
uint32_t parent_idx
uint32_t sibling_idx
Abbrev * abbrev_ptr

which was 20 bytes, but rounded up to 24 bytes due to alignment. Now we have:

uint32_t offset
uint32_t parent_idx
uint32_t sibling_idx
uint32_t abbr_idx:15,       // 32767 possible abbreviation codes
         has_children:1,    // 0 = no children, 1 = has children
         tag:16;            // DW_TAG_XXX value

This gets us down to 16 bytes per DIE. I tested some VERY large DWARF files
(900MB) and found there were only ~700 unique abbreviations, so 32767 should
be enough for any sane compiler. If it isn't there are built in assertions
that will fire off and tell us.

llvm-svn: 144975
2011-11-18 04:43:59 +00:00
Ted Kremenek 2acedbd417 Refine placement of LangOptions object in CompilerInvocation by adding a new baseclass CompilerInvocationBase with a custom copy constructor. This ensures that whenever the CompilerInvocation object's copy constructor is used we always clone the LangOptions object.
llvm-svn: 144973
2011-11-18 04:32:13 +00:00
Eli Friedman f22fa9eaef Finish r144971, which was an incomplete commit.
llvm-svn: 144972
2011-11-18 04:01:36 +00:00
Eli Friedman 0b3f201b61 Fix the meaning of an "empty" record for the case of a zero-length array. Use isEmptyRecord for arguments on x86-32; there are structs of size 0 which don't count as empty.
llvm-svn: 144971
2011-11-18 03:47:20 +00:00
Andrew Trick 6b4d578f54 Fix a corner case in updating LoopInfo after fully unrolling an outer loop.
The loop tree's inclusive block lists are painful and expensive to
update. (I have no idea why they're inclusive). The design was
supposed to handle this case but the implementation missed it and my
unit tests weren't thorough enough.

Fixes PR11335: loop unroll update.

llvm-svn: 144970
2011-11-18 03:42:41 +00:00
Sean Callanan 00f43622e1 This commit completes the rearchitecting of ClangASTSource
to allow variables in the persistent variable store to know
how to complete themselves from debug information.  That
fixes a variety of bugs during dematerialization of 
expression results and also makes persistent variable and
result variables ($foo, $4, ...) more useful.

I have also added logging improvements that make it much
easier to figure out how types are moving from place to 
place, and made some checking a little more aggressive.

The commit includes patches to Clang which are currently being
integrated into Clang proper; once these fixes are in Clang
top-of-tree, these patches will be removed.  The patches don't
fix API; rather, they fix some internal bugs in Clang's 
ASTImporter that were exposed when LLDB was moving types from
place to place multiple times.

llvm-svn: 144969
2011-11-18 03:28:09 +00:00
Nadav Rotem 1ec141d0f9 Add AVX2 vpbroadcast support
llvm-svn: 144967
2011-11-18 02:49:55 +00:00
Eli Friedman a1748564b4 Make va_arg on x86-64 compute alignment the same way as argument passing.
Fixes <rdar://problem/10463281>.

llvm-svn: 144966
2011-11-18 02:44:19 +00:00
Anna Zaks 457c68726c [analyzer] Warn when non pointer arguments are passed to scanf (only when running taint checker).
There is an open radar to implement better scanf checking as a Sema warning. However, a bit of redundancy is fine in this case.

llvm-svn: 144964
2011-11-18 02:26:36 +00:00
Eli Friedman 1d7dd3b682 A bunch of fixes to argument passing and va_arg on Darwin x86-32 for structures containing an SSE vector.
llvm-svn: 144963
2011-11-18 02:12:09 +00:00
Kostya Serebryany 1cdc6e9567 [asan] workaround for reg alloc bug 11395: don't instrument functions with large chunks of inline assembler
llvm-svn: 144962
2011-11-18 01:41:06 +00:00
Eli Friedman e5c85622c9 Don't try to expand struct arguments containing holes on x86-32. From gcc struct layout tests.
llvm-svn: 144961
2011-11-18 01:32:26 +00:00