Sean Callanan [Thu, 9 Aug 2012 00:53:54 +0000 (00:53 +0000)]
Made lldb.swig include <string>, which it requires.
llvm-svn: 161560
Sean Callanan [Thu, 9 Aug 2012 00:50:26 +0000 (00:50 +0000)]
Removed explicit NULL checks for shared pointers
and instead made us use implicit casts to bool.
This generated a warning in C++11.
<rdar://problem/
11930775>
llvm-svn: 161559
Sean Callanan [Thu, 9 Aug 2012 00:46:55 +0000 (00:46 +0000)]
When compiling with C++11, switch from
hash_multimap to unordered_multimap.
<rdar://problem/
11930775>
llvm-svn: 161558
Anna Zaks [Thu, 9 Aug 2012 00:42:24 +0000 (00:42 +0000)]
[analyzer] Cleanup of malloc checker.
Remove Escaped state, which is not really necessary. We can just stop
tracking the symbol instead of keeping it around and marking escaped.
llvm-svn: 161557
Sean Callanan [Thu, 9 Aug 2012 00:40:16 +0000 (00:40 +0000)]
Now that the testcase is fixed, it is no longer
an expected failure.
llvm-svn: 161556
Enrico Granata [Thu, 9 Aug 2012 00:35:41 +0000 (00:35 +0000)]
<rdar://problem/
12061386> Fixing data-formatter-cpp test case - previous version had an unfortunate dependency on the value of uninitialized memory
llvm-svn: 161555
Eli Friedman [Thu, 9 Aug 2012 00:31:40 +0000 (00:31 +0000)]
Fix AAPCS ABI. I can't actually test this, but it restores the behavior from before r159168. PR13562.
llvm-svn: 161554
Matt Beaumont-Gay [Thu, 9 Aug 2012 00:30:39 +0000 (00:30 +0000)]
MachineRegisterInfo was already a friend of MachineOperand, and GCC complains
about repeated friending.
llvm-svn: 161553
Anna Zaks [Thu, 9 Aug 2012 00:21:33 +0000 (00:21 +0000)]
[analyzer] Bifurcate the path with dynamic dispatch.
This is an initial (unoptimized) version. We split the path when
inlining ObjC instance methods. On one branch we always assume that the
type information for the given memory region is precise. On the other we
assume that we don't have the exact type info. It is important to check
since the class could be subclassed and the method can be overridden. If
we always inline we can loose coverage.
Had to refactor some of the call eval functions.
llvm-svn: 161552
Dmitri Gribenko [Thu, 9 Aug 2012 00:16:26 +0000 (00:16 +0000)]
Add new file CommentCommandTraits.cpp to CMakeLists.txt.
llvm-svn: 161551
Chandler Carruth [Thu, 9 Aug 2012 00:12:21 +0000 (00:12 +0000)]
Fix the order of the link arguments for this tool. I think there is
something fishy with the rest of the order too, but this at least lets
it build for me.
llvm-svn: 161550
Chandler Carruth [Thu, 9 Aug 2012 00:05:27 +0000 (00:05 +0000)]
Allow the Makefile build system to find the extra repo if it is checked
out.
Unfortunately, the existing makefiles for the extra repo don't specify
the correct library dependencies. Fixing that next. If you're following
along, you'll get linker errors.
llvm-svn: 161549
Dmitri Gribenko [Thu, 9 Aug 2012 00:03:17 +0000 (00:03 +0000)]
Comment parsing: extract TableGen'able pieces into new CommandTraits class.
llvm-svn: 161548
Sean Callanan [Thu, 9 Aug 2012 00:01:48 +0000 (00:01 +0000)]
The C++ data formatter tests are flaky. Marking
them as expected failures until they are fixed.
llvm-svn: 161547
Eli Friedman [Wed, 8 Aug 2012 23:57:20 +0000 (23:57 +0000)]
clang support for Bitrig (an OpenBSD fork); patch by David Hill.
llvm-svn: 161546
Jim Grosbach [Wed, 8 Aug 2012 23:56:06 +0000 (23:56 +0000)]
Move [SU]LEB128 encoding to a utility header.
These functions are very generic. There's no reason for them to
be tied to MCObjectWriter.
llvm-svn: 161545
Eli Friedman [Wed, 8 Aug 2012 23:53:27 +0000 (23:53 +0000)]
Minor simplification for r161534.
llvm-svn: 161544
Jakob Stoklund Olesen [Wed, 8 Aug 2012 23:44:07 +0000 (23:44 +0000)]
Move getNextOperandForReg() into MachineRegisterInfo.
MRI provides iterators for traversing the use-def chains. They should
not be accessible from anywhere else.
llvm-svn: 161543
Jakob Stoklund Olesen [Wed, 8 Aug 2012 23:44:04 +0000 (23:44 +0000)]
Don't use getNextOperandForReg().
This way of using getNextOperandForReg() was unlikely to work as
intended. We don't give any guarantees about the order of operands in
the use-def chains, so looking only at operands following a given
operand in the chain doesn't make sense.
llvm-svn: 161542
Jakob Stoklund Olesen [Wed, 8 Aug 2012 23:44:01 +0000 (23:44 +0000)]
Don't use getNextOperandForReg() in RAFast.
That particular optimization was probably premature anyway.
llvm-svn: 161541
Fariborz Jahanian [Wed, 8 Aug 2012 23:41:08 +0000 (23:41 +0000)]
objective-C: refactor/simplify parsing of delayed
method/c-funcs defined in objc class implementation.
No intended functionality change.
llvm-svn: 161540
Eli Friedman [Wed, 8 Aug 2012 23:35:12 +0000 (23:35 +0000)]
Fix r161534 so it actually builds.
llvm-svn: 161539
Chandler Carruth [Wed, 8 Aug 2012 23:34:47 +0000 (23:34 +0000)]
Fix up the makefiles in the tools repo, and add a top-level makefile
suitable for building as part of the LLVM/Clang build.
llvm-svn: 161538
Richard Smith [Wed, 8 Aug 2012 23:32:13 +0000 (23:32 +0000)]
PR13558: Fix typo 'compatiblity'. Thinking of the children. Apparently.
llvm-svn: 161537
Owen Anderson [Wed, 8 Aug 2012 23:31:14 +0000 (23:31 +0000)]
Allow legalization of target-specific SDNodes, provided that the target itself provide a legalization hook for them.
llvm-svn: 161536
Eli Friedman [Wed, 8 Aug 2012 23:04:35 +0000 (23:04 +0000)]
Handle deprecation diagnostics correctly for C struct fields and Objective-C properties/ivars. <rdar://problem/6642337>.
llvm-svn: 161534
Greg Clayton [Wed, 8 Aug 2012 22:27:52 +0000 (22:27 +0000)]
Fixed the delay that was happening when quitting lldb from the command line. We weren't initializing the command pipes when constructing a ConnectionFileDescriptor with a file descriptor.
llvm-svn: 161533
Jakob Stoklund Olesen [Wed, 8 Aug 2012 22:12:01 +0000 (22:12 +0000)]
Deal with irreducible control flow when building traces.
We filter out MachineLoop back-edges during the trace-building PO
traversals, but it is possible to have CFG cycles that aren't natural
loops, and MachineLoopInfo doesn't include such cycles.
Use a standard visited set to detect such CFG cycles, and completely
ignore them when picking traces.
llvm-svn: 161532
Dmitri Gribenko [Wed, 8 Aug 2012 22:10:24 +0000 (22:10 +0000)]
Comment XML: use xml:space="preserve" in Verbatim tags, so that XML tidy does
not compress spaces in verbatim content.
llvm-svn: 161531
Bill Wendling [Wed, 8 Aug 2012 22:03:50 +0000 (22:03 +0000)]
Remove some coding violations. No functionality change.
llvm-svn: 161530
Bill Wendling [Wed, 8 Aug 2012 22:01:55 +0000 (22:01 +0000)]
Cache a commonly used reference.
llvm-svn: 161529
Eli Friedman [Wed, 8 Aug 2012 21:52:41 +0000 (21:52 +0000)]
Unify the codepaths for emitting deprecation warnings. The test changes are just to account for us emitting notes more consistently.
llvm-svn: 161528
Anna Zaks [Wed, 8 Aug 2012 21:42:23 +0000 (21:42 +0000)]
Address code review comments for Wstrncat-size warning (r161440).
llvm-svn: 161527
Chad Rosier [Wed, 8 Aug 2012 21:42:11 +0000 (21:42 +0000)]
[ms-inline asm] Use more idiomatic logic. Thanks, Bill.
llvm-svn: 161526
Jordan Rose [Wed, 8 Aug 2012 21:17:31 +0000 (21:17 +0000)]
Implicitly annotate __CFStringMakeConstantString with format_arg(1).
We handled the builtin version of this function in r157968, but the builtin
isn't used when compiling as -fno-constant-cfstrings.
This should complete <rdar://problem/6157200>.
llvm-svn: 161525
Chad Rosier [Wed, 8 Aug 2012 21:15:52 +0000 (21:15 +0000)]
[ms-inline asm] Add basic codegen support for simple asm stmts. Currently,
only machine specific clobbers are modeled.
llvm-svn: 161524
Eli Friedman [Wed, 8 Aug 2012 21:08:34 +0000 (21:08 +0000)]
Don't add attributes for "#pragma pack" and friends to tag declarations which
are not definitions. This follows the behavior of both gcc and earlier
versions of clang. Regression from r156531. <rdar://problem/
12048621>.
llvm-svn: 161523
Chad Rosier [Wed, 8 Aug 2012 21:08:20 +0000 (21:08 +0000)]
[ms-inline asm] Make sure IsSimple is correctly handled.
llvm-svn: 161522
Chad Rosier [Wed, 8 Aug 2012 20:38:22 +0000 (20:38 +0000)]
Remove extraneous comment.
llvm-svn: 161521
Chad Rosier [Wed, 8 Aug 2012 20:37:31 +0000 (20:37 +0000)]
[ms-inline asm] Add a very simple test case. Basically, we're only testing for
crashers at the moment (and coincidentally this case was causing a crash).
llvm-svn: 161520
Bob Wilson [Wed, 8 Aug 2012 20:31:37 +0000 (20:31 +0000)]
Add test triples to fix win32 failures. Revert workaround from r161292.
I don't have a win32 system to test, so hopefully I got them all fixed here.
llvm-svn: 161519
Chad Rosier [Wed, 8 Aug 2012 19:48:07 +0000 (19:48 +0000)]
[ms-inline asm] Refactor the logic to generate the AsmString into Sema. No
functional change intended.
llvm-svn: 161518
Chad Rosier [Wed, 8 Aug 2012 18:51:50 +0000 (18:51 +0000)]
Whitespace.
llvm-svn: 161517
Chad Rosier [Wed, 8 Aug 2012 18:46:20 +0000 (18:46 +0000)]
Whitespace.
llvm-svn: 161516
Bill Wendling [Wed, 8 Aug 2012 18:37:39 +0000 (18:37 +0000)]
Remove OpenBSD defines:
- The defines are in stddint.h, which is #include'd already.
- The block wasn't used anyway, since it was _OpenBSD_, and not __OpenBSD__
Patch by David Hill!
llvm-svn: 161515
Chandler Carruth [Wed, 8 Aug 2012 18:30:15 +0000 (18:30 +0000)]
Add a copy of the LLVM license here so that even a stand-alone checkout
includes the proper license text.
llvm-svn: 161514
Jakob Stoklund Olesen [Wed, 8 Aug 2012 18:24:23 +0000 (18:24 +0000)]
Heed -stress-early-ifcvt.
llvm-svn: 161513
Jordan Rose [Wed, 8 Aug 2012 18:23:36 +0000 (18:23 +0000)]
[analyzer] Clean up the printing of FieldRegions for leaks.
Unfortunately, generalized region printing is very difficult:
- ElementRegions are used both for casting and as actual elements.
- Accessing values through a pointer means going through an intermediate
SymbolRegionValue; symbolic regions are untyped.
- Referring to implicitly-defined variables like 'this' and 'self' could be
very confusing if they come from another stack frame.
We fall back to simply not printing the region name if we can't be sure it
will print well. This will allow us to improve in the future.
llvm-svn: 161512
Jordan Rose [Wed, 8 Aug 2012 18:23:31 +0000 (18:23 +0000)]
[analyzer] Track malloc'd regions stored in structs.
The main blocker on this (besides the previous commit) was that
ScanReachableSymbols was not looking through LazyCompoundVals.
Once that was fixed, it's easy enough to clear out malloc data on return,
just like we do when we bind to a global region.
<rdar://problem/
10872635>
llvm-svn: 161511
Jordan Rose [Wed, 8 Aug 2012 18:23:27 +0000 (18:23 +0000)]
[analyzer] Revamp RegionStore to distinguish regions with symbolic offsets.
RegionStore currently uses a (Region, Offset) pair to describe the locations
of memory bindings. However, this representation breaks down when we have
regions like 'array[index]', where 'index' is unknown. We used to store this
as (SubRegion, 0); now we mark them specially as (SubRegion, SYMBOLIC).
Furthermore, ProgramState::scanReachableSymbols depended on the existence of
a sub-region map, but RegionStore's implementation doesn't provide for such
a thing. Moving the store-traversing logic of scanReachableSymbols into the
StoreManager allows us to eliminate the notion of SubRegionMap altogether.
This fixes some particularly awkward broken test cases, now in
array-struct-region.c.
llvm-svn: 161510
Jordan Rose [Wed, 8 Aug 2012 18:23:20 +0000 (18:23 +0000)]
Constify CXXRecordDecl::isVirtuallyDerivedFrom.
No functionality change. A couple ugly const_casts because the ancestor
search code is used for other purposes as well.
llvm-svn: 161509
Chad Rosier [Wed, 8 Aug 2012 18:22:06 +0000 (18:22 +0000)]
[ms-inline asm] Add support for detecting simple ms-style inline asm. Simple
asm statements are those that don't reference variable names, function names,
and labels.
Add logic to generate a patched AsmString that will eventually be consumed by
the AsmParser. No functional change at this point, so unfortunately no test
case.
llvm-svn: 161508
Jakob Stoklund Olesen [Wed, 8 Aug 2012 18:19:58 +0000 (18:19 +0000)]
Get the MispredictPenalty from MCSchedModel.
Thanks, Andy!
llvm-svn: 161507
Chandler Carruth [Wed, 8 Aug 2012 18:16:41 +0000 (18:16 +0000)]
Replace the stub README with a proper one based on Clang's.
Also test the commit hooks for the new repository.
llvm-svn: 161506
Sebastian Pop [Wed, 8 Aug 2012 18:04:45 +0000 (18:04 +0000)]
revert my previous patch
llvm-svn: 161505
Sebastian Pop [Wed, 8 Aug 2012 17:45:43 +0000 (17:45 +0000)]
enable Hexagon target from cmake
This patch allows us to use cmake to specify a cross compiler for Hexagon.
In particular, the patch adds a missing case for the target Hexagon in
cmake/config-ix.cmake, and it moves LLVM_DEFAULT_TARGET_TRIPLE and TARGET_TRIPLE
variables from cmake/config-ix.cmake to the toplevel CMakeLists.txt to make them
available at configure time. Here is the command line that I have used to test
my patches:
$ cmake -G Ninja -D BUILD_SHARED_LIBS:BOOL=ON -D LLVM_TARGETS_TO_BUILD:STRING=Hexagon -D TARGET_TRIPLE:STRING=hexagon-unknown-linux-gnu -D LLVM_DEFAULT_TARGET_TRIPLE:STRING=hexagon-unknown-linux-gnu -D LLVM_TARGET_ARCH:STRING=hexagon-unknown-linux-gnu -D LLVM_ENABLE_PIC:BOOL=OFF ..
$ ninja check
llvm-svn: 161504
Chad Rosier [Wed, 8 Aug 2012 17:35:36 +0000 (17:35 +0000)]
Add the IsSimple/IsVolatile parameters to the MSAsmStmt constructor.
llvm-svn: 161503
Sean Callanan [Wed, 8 Aug 2012 17:35:10 +0000 (17:35 +0000)]
Added a 'void' format so that the user can manually
suppress all non-error output from the "expression"
command.
<rdar://problem/
11225150>
llvm-svn: 161502
David Blaikie [Wed, 8 Aug 2012 17:33:31 +0000 (17:33 +0000)]
Implement warning for integral null pointer constants other than the literal 0.
This is effectively a warning for code that violates core issue 903 & thus will
become standard error in the future, hopefully. It catches strange null
pointers such as: '\0', 1 - 1, const int null = 0; etc...
There's currently a flaw in this warning (& the warning for 'false' as a null
pointer literal as well) where it doesn't trigger on comparisons (ptr == '\0'
for example). Fix to come in a future patch.
Also, due to this only being a warning, not an error, it triggers quite
frequently on gtest code which tests expressions for null-pointer-ness in a
SFINAE context (so it wouldn't be a problem if this was an error as in an
actual implementation of core issue 903). To workaround this for now, the
diagnostic does not fire in unevaluated contexts.
Review by Sean Silva and Richard Smith.
llvm-svn: 161501
Fariborz Jahanian [Wed, 8 Aug 2012 16:41:04 +0000 (16:41 +0000)]
objc: Include all types when issuing warning under
-Wdirect-ivar-access.
llvm-svn: 161500
Chad Rosier [Wed, 8 Aug 2012 16:27:29 +0000 (16:27 +0000)]
Add various MC components to clang build to support MS-style inline assembly.
llvm-svn: 161498
Howard Hinnant [Wed, 8 Aug 2012 16:17:31 +0000 (16:17 +0000)]
Change size of reference count field in __libcpp_nmstr from 32 bits to 64 bits for 64 bit targets. This is controls the data layout of all exceptions defined in <stdexcept>. This aligns the ABI with that of gcc-4.2.
llvm-svn: 161497
Howard Hinnant [Wed, 8 Aug 2012 16:15:16 +0000 (16:15 +0000)]
Change size of reference count field in __libcpp_nmstr from 32 bits to 64 bits for 64 bit targets. This is controls the data layout of all exceptions defined in <stdexcept>. This aligns the ABI with that of gcc-4.2.
llvm-svn: 161496
Dylan Noblesmith [Wed, 8 Aug 2012 16:09:15 +0000 (16:09 +0000)]
Preprocessor: fix __OPTIMIZE_SIZE__ and -Oz
Add some tests for __OPTIMIZE_SIZE__ and __NO_INLINE__,
removing the superfluous copies in the target-specific
tests, since it's target-independent.
This uncovered a bug in the handling of -Oz: it would
attempt to store the value 2 in the 1-bit bitfield OptimizeSize,
leaving a value of 0 and never defining __OPTIMIZE_SIZE__.
llvm-svn: 161495
Dylan Noblesmith [Wed, 8 Aug 2012 16:09:12 +0000 (16:09 +0000)]
Frontend: further document __BYTE_ORDER__
llvm-svn: 161494
Filipe Cabecinhas [Wed, 8 Aug 2012 15:23:24 +0000 (15:23 +0000)]
Indentation fix for dotest.py.
llvm-svn: 161493
Filipe Cabecinhas [Wed, 8 Aug 2012 15:05:04 +0000 (15:05 +0000)]
Make dotest.py runnable from a directory other than lldb/test
llvm-svn: 161492
Rafael Espindola [Wed, 8 Aug 2012 14:51:03 +0000 (14:51 +0000)]
Typedefs and indentation fixes from the Andy Zhang/PAX macro argument patch.
Committing it first as it makes the "real" patch a lot easier to read.
llvm-svn: 161491
NAKAMURA Takumi [Wed, 8 Aug 2012 13:27:04 +0000 (13:27 +0000)]
llvm/test/MC/COFF/seh.s: Fixup corresponding to r161487.
llvm-svn: 161489
Anton Korobeynikov [Wed, 8 Aug 2012 12:46:46 +0000 (12:46 +0000)]
Fix for .pdata and .xdata section attributes on COFF.
Patch by kai@redstar.de !
llvm-svn: 161487
Alexey Samsonov [Wed, 8 Aug 2012 09:46:51 +0000 (09:46 +0000)]
[Sanitizer] cleanup CMake files for interception and sanitizer_common helper libraries
llvm-svn: 161485
Benjamin Kramer [Wed, 8 Aug 2012 09:26:28 +0000 (09:26 +0000)]
Remove unused variables.
llvm-svn: 161483
Hans Wennborg [Wed, 8 Aug 2012 08:41:02 +0000 (08:41 +0000)]
Revert part of r161175 which was wrong for OpenBSD's PowerPC target.
Contributed by Brad Smith <brad@comstyle.com>
llvm-svn: 161481
Bill Wendling [Wed, 8 Aug 2012 08:21:24 +0000 (08:21 +0000)]
Sphinxify the CommandLine document.
llvm-svn: 161479
Bill Wendling [Wed, 8 Aug 2012 06:42:30 +0000 (06:42 +0000)]
Move header so that it can be picked up by other .rst files.
llvm-svn: 161478
Bill Wendling [Wed, 8 Aug 2012 06:30:30 +0000 (06:30 +0000)]
Add `.pushsection', `.popsection', and `.previous' directives to Darwin ASM.
There are situations where inline ASM may want to change the section -- for
instance, to create a variable in the .data section. However, it cannot do this
without (potentially) restoring to the wrong section. E.g.:
asm volatile (".section __DATA, __data\n\t"
".globl _fnord\n\t"
"_fnord: .quad 1f\n\t"
".text\n\t"
"1:" :::);
This may be wrong if this is inlined into a function that has a "section"
attribute. The user should use `.pushsection' and `.popsection' here instead.
The addition of `.previous' is added for completeness.
<rdar://problem/
12048387>
llvm-svn: 161477
Richard Smith [Wed, 8 Aug 2012 06:13:49 +0000 (06:13 +0000)]
Implement final piece of DR963 and also DR587:
A conditional operator between glvalues of types cv1 T and cv2 T produces a
glvalue if the expressions are of the same value kind and one of cv1 and cv2
is a subset of the other.
A conditional operator between two null pointer constants is permitted if one
of them is of type std::nullptr_t.
llvm-svn: 161476
Chris Lattner [Wed, 8 Aug 2012 05:26:51 +0000 (05:26 +0000)]
clarify that the advantages of the BSD license apply to when you incorporate clang into proprietary code bases,
patch by Jonathan Sauer.
llvm-svn: 161475
Eli Friedman [Wed, 8 Aug 2012 04:39:56 +0000 (04:39 +0000)]
Get rid of an early return in Sema::ActOnFields which doesn't make sense anymore.
Fixes a crash (<rdar://problem/
11067144>), and generally seems to improve
recovery in other cases.
llvm-svn: 161474
Eli Friedman [Wed, 8 Aug 2012 03:51:37 +0000 (03:51 +0000)]
Fix an assertion failure with a C++ constructor initializing a
member of reference type in an anonymous struct. PR13154.
llvm-svn: 161473
Eli Friedman [Wed, 8 Aug 2012 03:47:15 +0000 (03:47 +0000)]
Fix a -ast-dump crash.
llvm-svn: 161472
Andrew Trick [Wed, 8 Aug 2012 02:44:16 +0000 (02:44 +0000)]
Added MispredictPenalty to SchedMachineModel.
This replaces an existing subtarget hook on ARM and allows standard
CodeGen passes to potentially use the property.
llvm-svn: 161471
Andrew Trick [Wed, 8 Aug 2012 02:44:11 +0000 (02:44 +0000)]
Minor cleanup of defaultDefLatency API
llvm-svn: 161470
Andrew Trick [Wed, 8 Aug 2012 02:44:08 +0000 (02:44 +0000)]
whitespace
llvm-svn: 161469
Eli Friedman [Wed, 8 Aug 2012 02:17:32 +0000 (02:17 +0000)]
isAllocLikeFn is allowed to return true for functions which read memory; make
sure we account for that correctly in DeadStoreElimination. Fixes a regression
from r158919. PR13547.
llvm-svn: 161468
Enrico Granata [Wed, 8 Aug 2012 02:06:30 +0000 (02:06 +0000)]
<rdar://problem/
11975483> Removing user-visible references to 'dict' as a parameter name for Python summary-generating functions since it is a Python keyword.
llvm-svn: 161467
Sean Callanan [Wed, 8 Aug 2012 01:30:34 +0000 (01:30 +0000)]
Made "call" another alias for "expression --",
for people used to the GDB command.
<rdar://problem/
12052072>
llvm-svn: 161466
Greg Clayton [Wed, 8 Aug 2012 01:19:34 +0000 (01:19 +0000)]
Added the ability to set the architecture from two numbers that represent the mach-o CPU type and subtype in the format "%u-%u" or "%u.%u". This can of course be followed by vendor and OS.
llvm-svn: 161465
Enrico Granata [Wed, 8 Aug 2012 01:12:11 +0000 (01:12 +0000)]
<rdar://problem/
11576169> Better documentation string for the -Y option to frame variable
llvm-svn: 161464
Jakob Stoklund Olesen [Wed, 8 Aug 2012 01:10:31 +0000 (01:10 +0000)]
Revert "Fix a quadratic algorithm in MachineBranchProbabilityInfo."
It caused an assertion failure when compiling consumer-typeset.
llvm-svn: 161463
Manman Ren [Wed, 8 Aug 2012 00:51:41 +0000 (00:51 +0000)]
X86: enable CSE between CMP and SUB
We perform the following:
1> Use SUB instead of CMP for i8,i16,i32 and i64 in ISel lowering.
2> Modify MachineCSE to correctly handle implicit defs.
3> Convert SUB back to CMP if possible at peephole.
Removed pattern matching of (a>b) ? (a-b):0 and like, since they are handled
by peephole now.
rdar://
11873276
llvm-svn: 161462
Jakob Stoklund Olesen [Wed, 8 Aug 2012 00:40:47 +0000 (00:40 +0000)]
Don't scan physreg use-def chains looking for a PIC base.
We can't rematerialize a PIC base after register allocation anyway, and
scanning physreg use-def chains is very expensive in a function with
many calls.
<rdar://problem/
12047515>
llvm-svn: 161461
Jakob Stoklund Olesen [Wed, 8 Aug 2012 00:20:37 +0000 (00:20 +0000)]
Fix a quadratic algorithm in MachineBranchProbabilityInfo.
The getSumForBlock function was quadratic in the number of successors
because getSuccWeight would perform a linear search for an already known
iterator.
llvm-svn: 161460
Dan Gohman [Wed, 8 Aug 2012 00:00:26 +0000 (00:00 +0000)]
Avoid recomputing the unique exit blocks and their insert points when doing
multiple scalar promotions on a single loop. This also has the effect of
preserving the order of stores sunk out of loops, which is aesthetically
pleasing, and it happens to fix the testcase in PR13542, though it doesn't
fix the underlying problem.
llvm-svn: 161459
Fariborz Jahanian [Tue, 7 Aug 2012 23:48:10 +0000 (23:48 +0000)]
objc-arc: Make -Wdirect-ivar-access accessible to all
memory models, except when arc is accessing a weak
ivar (which is an error). // rdar://6505197
llvm-svn: 161458
Chad Rosier [Tue, 7 Aug 2012 23:12:23 +0000 (23:12 +0000)]
Whitespace.
llvm-svn: 161455
Jakob Stoklund Olesen [Tue, 7 Aug 2012 22:47:06 +0000 (22:47 +0000)]
Skip tied operand pairs that already have the same register.
llvm-svn: 161454
Jakob Stoklund Olesen [Tue, 7 Aug 2012 22:37:05 +0000 (22:37 +0000)]
Add SelectionDAG::getTargetIndex.
This adds support for TargetIndex operands during isel. The meaning of
these (index, offset, flags) operands is entirely defined by the target.
llvm-svn: 161453
Bob Wilson [Tue, 7 Aug 2012 22:35:16 +0000 (22:35 +0000)]
Fix a serious typo in InstCombine's optimization of comparisons.
An unsigned value converted to floating-point will always be greater than
a negative constant. Unfortunately InstCombine reversed the check so that
unsigned values were being optimized to always be greater than all positive
floating-point constants. <rdar://problem/
12029145>
llvm-svn: 161452
Evan Cheng [Tue, 7 Aug 2012 22:21:00 +0000 (22:21 +0000)]
X86 cmp lowering is looking past truncate on the condition node. It should only
do so when the high bits are known zero. This caused a subtle miscompilation.
rdar://
12027825
llvm-svn: 161451