Commit Graph

127218 Commits

Author SHA1 Message Date
Dan Gohman ed7c24e2d9 Teach DeadStoreElimination to eliminate exit-block stores with phi addresses.
llvm-svn: 156558
2012-05-10 18:57:38 +00:00
Argyrios Kyrtzidis 671ce47d60 [preprocessor] Make sure that MacroExpands callbacks are always in source order.
Fixes assertion hit in the preprocessing record. rdar://11426523

llvm-svn: 156557
2012-05-10 18:57:19 +00:00
Manman Ren b555b382bd Revert: 156550 "ARM: peephole optimization to remove cmp instruction"
This commit broke an external linux bot and gave a compile-time warning.

llvm-svn: 156556
2012-05-10 18:49:43 +00:00
Jakob Stoklund Olesen c1e9087fbb Precompute lists of explicit sub-registers and indices.
The .td files specify a tree of sub-registers. Store that tree as
ExplicitSubRegs lists in CodeGenRegister instead of extracting it from
the Record when needed.

llvm-svn: 156555
2012-05-10 17:46:18 +00:00
Dan Gohman 0291246ce7 Rewrite ScalarEvolution::hasOperand to use an explicit worklist instead
of recursion, to avoid excessive stack usage on deep expressions.

llvm-svn: 156554
2012-05-10 17:21:30 +00:00
Nuno Lopes 300d629924 teach DSE and isInstructionTriviallyDead() about calloc
llvm-svn: 156553
2012-05-10 17:14:00 +00:00
Fariborz Jahanian b6e9b6cfe7 Test for previously checked in patch.
// rdar://11374235

llvm-svn: 156552
2012-05-10 17:05:15 +00:00
Joel Jones 7f04344b8b formatting change: strip debug info from test
llvm-svn: 156551
2012-05-10 16:55:31 +00:00
Manman Ren c860887b2d ARM: peephole optimization to remove cmp instruction
This patch will optimize the following cases:
  sub r1, r3 | sub r1, imm
  cmp r3, r1 or cmp r1, r3 | cmp r1, imm
  bge L1

TO
  subs r1, r3
  bge  L1 or ble L1

If the branch instruction can use flag from "sub", then we can replace
"sub" with "subs" and eliminate the "cmp" instruction.

rdar: 10734411
llvm-svn: 156550
2012-05-10 16:48:21 +00:00
Joel Jones 3d90a9ae65 Fix a problem with incomplete equality testing of PHINodes in
Instruction::IsIdenticalToWhenDefined.

This manifested itself when inlining two calls to the same function.  The 
inlined function had a switch statement that returned one of a set of 
global variables.  Without this modification, the two phi instructions that 
chose values from the branches of the switch instruction inlined from the 
callee were considered equivalent and jump-threading replaced a load for the 
first switch value with a phi selecting from the second switch, thereby 
producing incorrect code.

This patch has been tested with "make check-all", "lnt runteste nt", and 
llvm self-hosted, and on the original program that had this problem, 
wireshark.

<rdar://problem/11025519>

llvm-svn: 156548
2012-05-10 15:59:41 +00:00
Kostya Serebryany 5b7cb1db61 [tsan] old-dstyle Makefile for tests; two helper scripts that analyze the assembly code of the hot functions
llvm-svn: 156547
2012-05-10 15:10:03 +00:00
Howard Hinnant 423a8d7733 Fix several bugs in find/count specialized for bits.
llvm-svn: 156546
2012-05-10 14:55:00 +00:00
Kostya Serebryany ff15ef0c50 [tsan] ThreadSanitizer tests and micro benchmarks. No makefiles yet.
llvm-svn: 156545
2012-05-10 14:18:22 +00:00
Kostya Serebryany df68b67f06 [tsan] add the old Makefile (which is the only way to build the tsan-rtl for now)
llvm-svn: 156544
2012-05-10 14:04:19 +00:00
Howard Hinnant 19d9cbfb39 Add friends __count_bool_true and __count_bool_false to __bit_iterator.
llvm-svn: 156543
2012-05-10 14:01:40 +00:00
Kostya Serebryany 4ad375f0a9 [tsan] First commit of ThreadSanitizer (TSan) run-time library.
Algorithm description: http://code.google.com/p/thread-sanitizer/wiki/ThreadSanitizerAlgorithm

Status:
The tool is known to work on large real-life applications, but still has quite a few rough edges.
Nothing is guaranteed yet.

The tool works on x86_64 Linux.
Support for 64-bit MacOS 10.7+ is planned for late 2012.
Support for 32-bit OSes is doable, but problematic and not yet planed.

Further commits coming:
  - tests
  - makefiles
  - documentation
  - clang driver patch

The code was previously developed at http://code.google.com/p/data-race-test/source/browse/trunk/v2/
by Dmitry Vyukov and Kostya Serebryany with contributions from
Timur Iskhodzhanov, Alexander Potapenko, Alexey Samsonov and Evgeniy Stepanov.

llvm-svn: 156542
2012-05-10 13:48:04 +00:00
Nadav Rotem 1a65397017 Fix merge-typo and cleanup
llvm-svn: 156541
2012-05-10 12:50:02 +00:00
Nadav Rotem 15946e50c1 AVX2: Add an additional broadcast idiom.
llvm-svn: 156540
2012-05-10 12:39:13 +00:00
Nadav Rotem b86a3fb8d0 Generate AVX/AVX2 shuffles even when there is a memory op somewhere else in the program.
Starting r155461 we are able to select patterns for vbroadcast even when the load op is used by other users.

Fix PR11900.

llvm-svn: 156539
2012-05-10 12:22:05 +00:00
Alexander Potapenko 66e6de10cf Fix ReadFileToBuffer to return 0 on failure (-1 is too large if returned as size_t).
llvm-svn: 156538
2012-05-10 12:03:09 +00:00
Argyrios Kyrtzidis b16ff5d1ce Fix an assertion hit when the serialized diagnostics writer receive a diagnostic
from the frontend when the location is invalid and the SourceManager null.

Instead of keeping the SourceManager object in DiagnosticRenderer, propagate it
to the calls accordingly (as reference when it is expected to not be null, or pointer
when it may be null).
This effectively makes DiagnosticRenderer not tied to a specific SourceManager,
removing a hack from TextDiagnosticPrinter.

rdar://11386874

llvm-svn: 156536
2012-05-10 05:03:45 +00:00
Greg Clayton 3d081399f0 <rdar://problem/11388521>
Fixed a case where the install header phase in the Xcode project would not set the LLDB_VERSION #define correctly. It has now been fixed to key off of the CURRENT_PROJECT_VERSION which will get auto updated with "agvtool bump -all". This was done by adding a build setting to the install-headers makefile based target.

llvm-svn: 156535
2012-05-10 03:27:35 +00:00
Rafael Espindola a6b3cd493c Warn about visibility attributes in typedefs.
llvm-svn: 156534
2012-05-10 03:01:34 +00:00
Greg Clayton 5cc6ef9e89 Remove stuff from the xcscheme file that need not be checked in.
llvm-svn: 156533
2012-05-10 02:52:56 +00:00
Greg Clayton ba812f4284 <rdar://problem/11330621>
Fixed the DisassemblerLLVMC disassembler to parse more efficiently instead of parsing opcodes over and over. The InstructionLLVMC class now only reads the opcode in the InstructionLLVMC::Decode function. This can be done very efficiently for ARM and architectures that have fixed opcode sizes. For x64 it still calls the disassembler to get the byte size.

Moved the lldb_private::Instruction::Dump(...) function up into the lldb_private::Instruction class and it now uses the function that gets the mnemonic, operandes and comments so that all disassembly is using the same code.

Added StreamString::FillLastLineToColumn() to allow filling a line up to a column with a character (which is used by the lldb_private::Instruction::Dump(...) function).

Modified the Opcode::GetData() fucntion to "do the right thing" for thumb instructions.

llvm-svn: 156532
2012-05-10 02:52:23 +00:00
Rafael Espindola c67f223c9e Fix an old (2009) FIXME:
// FIXME: This needs to happen before we merge declarations. Then,
// let attribute merging cope with attribute conflicts.

This was already being done for variables, but for functions we were merging
then first and then applying the attributes. To avoid duplicating merging
logic, some of the helpers in SemaDeclAttr.cpp become methods that can
handle merging two attributes in one decl or inheriting attributes from one
decl to another.

With this change we are now able to produce errors for variables with
incompatible visibility attributes or warn about unused dllimports in
variables.

This changes the attribute list iteration back to being in reverse source
code order, as that matches what decl merging does and avoids differentiating
the two cases is the merge*Attr methods.

llvm-svn: 156531
2012-05-10 02:50:16 +00:00
Anna Zaks 62cce9e47d [analyzer] Do not highlight the range of the statement in case of leak.
We report a leak at a point a leaked variable is no longer accessible.
The statement that happens to be at that point is not relevant to the
leak diagnostic and, thus, should not be highlighted.

radar://11178519

llvm-svn: 156530
2012-05-10 01:37:40 +00:00
Jim Ingham 18de2fdc55 If the ObjC Step Through Trampoline plan causes a target crash, properly propagate the error back to
the controlling plans so that they don't lose control.

Also change "ThreadPlanStepThrough" to take the return StackID for its backstop breakpoint as an argument
to the constructor rather than having it try to figure it out itself, since it might get it wrong whereas
the caller always knows where it is coming from.

rdar://problem/11402287

llvm-svn: 156529
2012-05-10 01:35:39 +00:00
Andrew Trick 5d13399851 Fix TableGen's RegPressureSet weight normalization to handle subreg DAGS.
I initially assumed that the subreg graph was a tree. That may not be true.

llvm-svn: 156524
2012-05-10 00:32:15 +00:00
Jim Grosbach 1ace8b6a76 ExecutionEngine: Check for NULL ErrorStr before using it.
Patch by Yury Mikhaylov <yury.mikhaylov@gmail.com>.

llvm-svn: 156523
2012-05-10 00:31:50 +00:00
Richard Smith 6dd62fd99d RecursiveASTVisitor:
We don't create any declaration to mark the explicit instantiation of function
templates other than the instantiation itself, so visit that when traversing
the function template decl.

This is a temporary fix, pending the creation of a Decl node to represent the
explicit instantiation.

Patch by Daniel Jasper!

llvm-svn: 156522
2012-05-09 23:51:36 +00:00
Jakob Stoklund Olesen 982205bcae Fix warning text.
llvm-svn: 156521
2012-05-09 23:43:30 +00:00
Dan Gohman f8b19d09ba Fix the objc_storeStrong recognizer to stop before walking off the
end of a basic block if there's no store.

llvm-svn: 156520
2012-05-09 23:08:33 +00:00
Jakob Stoklund Olesen 9b41e5dbc6 Compute a backwards SubReg -> SubRegIndex map for each register.
This mapping is for internal use by TableGen. It will not be exposed in
the generated files.

Unfortunately, the mapping is not completely well-defined. The X86 xmm
registers appear with multiple sub-register indices in the ymm
registers. This is because of the odd idempotent sub_sd and sub_ss
sub-register indices. I hope to be able to eliminate them entirely, so
we can require the sub-registers to form a tree.

For now, just place the canonical sub_xmm index in the mapping, and
ignore the idempotents.

llvm-svn: 156519
2012-05-09 22:15:00 +00:00
Jakob Stoklund Olesen 7d1fa380c5 Rename getSubRegs() to computeSubRegs().
That's what it does.

llvm-svn: 156518
2012-05-09 22:09:17 +00:00
Fariborz Jahanian 7a055366f2 objective-c. Fixes a 'fixit' where location of
'*' on objective-c class name was misplaced.
// rdar://11311333

llvm-svn: 156517
2012-05-09 21:49:29 +00:00
Nuno Lopes 7100f463b0 objectsize:
refactor code a bit to enable future changes to support run-time information
add support to compute allocation sizes at run-time if penalty > 1 (e.g., malloc(x), calloc(x, y), and VLAs)

llvm-svn: 156515
2012-05-09 21:30:57 +00:00
Sean Callanan 26e184d4e4 Added a #define of NULL to 0 to make NULL usable
in expressions.

llvm-svn: 156514
2012-05-09 21:27:03 +00:00
Nuno Lopes 729e6a056c hopefully fix a bunch of ARM buildbot failures
llvm-svn: 156513
2012-05-09 21:21:49 +00:00
Richard Trieu 43a2fc7b9e Pull some cases of initialization with self-reference warnings out of
-Wconditional-uninitialized into -Wuninitialized.

llvm-svn: 156512
2012-05-09 21:08:22 +00:00
Johnny Chen fd02a89960 Make ctrl-c terminate the current input line and start an empty line, instead of the previous content.
rdar://problem/11412821

llvm-svn: 156510
2012-05-09 21:03:07 +00:00
Johnny Chen a21bd407e5 Option processing fix: should match '-F' exactly, instead.
llvm-svn: 156509
2012-05-09 21:00:03 +00:00
Richard Smith 2f07ad5a70 Push the knowledge that we are parsing a type-id/type-name further into the
parser, and use it to emit better diagnostics in cases where an identifer
can't be looked up as a type name.

llvm-svn: 156508
2012-05-09 20:55:26 +00:00
Chad Rosier 1cdb85e048 Add unittests for Triple::getMacOSXVersion and Triple::getiOSVersion.
llvm-svn: 156507
2012-05-09 19:31:41 +00:00
Danil Malyshev 47aba39004 Added a regress test for the bug #9964 before close it.
This bug was fixed by Jim Grosbach in #138879, thanks Jim!

llvm-svn: 156505
2012-05-09 19:07:04 +00:00
Filipe Cabecinhas 3a9b6e7140 Make redo.py more error-proof
Deal with being passed no parameters
Remove the infinite loop when it's passed something like --help

llvm-svn: 156504
2012-05-09 19:02:19 +00:00
Richard Smith 3092a3b43c Stop AltiVec parsing from going down the 'implicit int' codepath as part of its
normal parse for token sequences like 'vector pixel foo'. This incidentally also
fixes a couple of wrong-parse issues.

llvm-svn: 156503
2012-05-09 18:56:43 +00:00
Chad Rosier 7b1fee1fe5 Roll logic into a single if statement, per David's suggestion.
llvm-svn: 156502
2012-05-09 18:55:57 +00:00
Chad Rosier bf8628e62f Use the triple directly, rather then getTriple().
llvm-svn: 156501
2012-05-09 18:51:13 +00:00
Simon Atanasyan ce005eb2c6 Pass a target triple explicitly to check platform specific macros definitions.
That allows to run the tests on all platforms successfully.

llvm-svn: 156500
2012-05-09 18:49:52 +00:00