aboutsummaryrefslogtreecommitdiff
AgeCommit message (Collapse)AuthorFilesLines
2012-11-29Merging r168622: into 3.2 release branch.Pawel Wodnicki1-1/+1
Don't use iterator after being erased. llvm-svn: 168947
2012-11-29Cherry-picking r168297 pic.cPawel Wodnicki1-76/+116
llvm-svn: 168917
2012-11-29Merging r167918: into the 3.2 release branch.Pawel Wodnicki2-1/+1
When we have a MemberExpr referring to an overloaded static member function, and we resolve it to a specific function based on the type which it's used as, don't forget to mark it as referenced. Fixes a regression introduced in r167514. llvm-svn: 168888
2012-11-29Merging r168837: into the 3.2 release branch.Pawel Wodnicki2-0/+50
Avoid rewriting instructions twice. This could cause miscompilations in targets where sub-register composition is not always idempotent (ARM). <rdar://problem/12758887> llvm-svn: 168849
2012-11-29Merge in r168799 (PPC bug fix).Hal Finkel2-1/+42
llvm-svn: 168842
2012-11-29Merge in r168765 (BBVectorize bug fix)Hal Finkel2-0/+25
llvm-svn: 168839
2012-11-28Merging r168818: into the 3.2 release branch.Pawel Wodnicki2-1/+37
PR13098: If we're instantiating an overloaded binary operator and we could determine which member function would be the callee from within the template definition, don't pass that function as a "non-member function" to CreateOverloadedBinOp. Instead, just rely on it to select the member function for itself. llvm-svn: 168830
2012-11-28Merging r168303: into the 3.2 release branch.Pawel Wodnicki2-0/+4
clang/test: Suppress two tests on LLP64 target, Windows x64. llvm-svn: 168823
2012-11-28Merging r168674: into the 3.2 release branch.Pawel Wodnicki6-3/+20
Fix the definition of the vfork() builtin on Haiku. PR14378. llvm-svn: 168819
2012-11-28Merging r168269: into the 3.2 release branch.Pawel Wodnicki4-7/+32
Fix crash on end-of-file after \ in a char literal, fixes PR14369. This makes LexCharConstant() look more like LexStringLiteral(), which doesn't have this bug. Add tests for eof after \ for several other cases. llvm-svn: 168808
2012-11-27Merging r168278: into 3.2 release branch.Pawel Wodnicki1-1/+1
clang/test/Sema/warn-documentation.cpp: Try to fix up the testcase in r168277. - llvm-svn: 168732
2012-11-27Merging r168277: into 3.2 release branch.Pawel Wodnicki3-0/+32
Documentation parsing: propely handle a lone '\endverbatim' and emit a warning. We actually used to assert on this. Thanks to NAKAMURA Takumi for noticing this! llvm-svn: 168730
2012-11-26Merging r167935: into the 3.2 release branch.Pawel Wodnicki1-4/+5
The ObjC++-to-C++ personality trick is only necessary on NeXT runtimes, which is not coincidentally the only place it works, either (because of how it tests for EH_TYPE symbols). llvm-svn: 168611
2012-11-26Merging r167925: into the 3.2 release branch.Pawel Wodnicki1-22/+25
Move some GNUStep-specific code out of CGObjCGNU. Patch by Jonathan Schleifer. llvm-svn: 168609
2012-11-26Merging r167912: into the 3.2 release branch.Pawel Wodnicki2-1/+24
Handle DAG CSE adding new uses during ReplaceAllUsesWith. Fixes PR14333. llvm-svn: 168596
2012-11-26Merging r168196: into the 3.2 release branch.Pawel Wodnicki2-2/+12
Make this easier to understand, as suggested by Chandler. llvm-svn: 168594
2012-11-26Merging r168186: into the 3.2 release branch.Pawel Wodnicki2-2/+23
InstructionSimplify should be able to simplify A+B==B+A to 'true' but wasn't due to the same logic bug that caused PR14361. llvm-svn: 168593
2012-11-23Merging r168320: into 3.2 relase branch.Pawel Wodnicki2-2/+17
Handle mixed normal and early-clobber defs on inline asm. PR14376. llvm-svn: 168527
2012-11-23Merging r168512: into 3.2 release branch.Pawel Wodnicki1-1/+1
Update call to the new syntax. llvm-svn: 168526
2012-11-22Merging r168291: into the 3.2 release branch.Pawel Wodnicki2-6/+43
Fix PR14060, an infinite loop in reassociate. The problem was that one of the operands of the expression being written was wrongly thought to be reusable as an inner node of the expression resulting in it turning up as both an inner node *and* a leaf, creating a cycle in the def-use graph. This would have caused the verifier to blow up if things had gotten that far, however it managed to provoke an infinite loop first. llvm-svn: 168489
2012-11-22Merging r168355: into the 3.2 release branch.Pawel Wodnicki2-3/+4
Update method calls to the new interface re r168354. llvm-svn: 168487
2012-11-22Merging r168354: into 3.2 release branchPawel Wodnicki12-124/+102
Make the AttrListPtr object a part of the LLVMContext. When code deletes the context, the AttributeImpls that the AttrListPtr points to are now invalid. Therefore, instead of keeping a separate managed static for the AttrListPtrs that's reference counted, move it into the LLVMContext and delete it when deleting the AttributeImpls. llvm-svn: 168486
2012-11-22Merging r168280: into 3.2 release branch.Pawel Wodnicki2-1/+18
Don't try to calculate the alignment of an unsigned type. Fixes PR14371! llvm-svn: 168480
2012-11-21Reverting 168457Pawel Wodnicki12-102/+124
llvm-svn: 168465
2012-11-21Merging r168354, r168355 and r168379 into the 3.2 release branch.Pawel Wodnicki12-124/+102
Set of Attributes patches. Merging r168354: Make the AttrListPtr object a part of the LLVMContext. When code deletes the context, the AttributeImpls that the AttrListPtr points to are now invalid. Therefore, instead of keeping a separate managed static for the AttrListPtrs that's reference counted, move it into the LLVMContext and delete it when deleting the AttributeImpls. Merging r168355: Merging r168379 llvm-svn: 168457
2012-11-21Merging r168181: into 3.2 release branch.Pawel Wodnicki2-2/+32
Fix PR14361: wrong simplification of A+B==B+A. You may think that the old logic replaced by this patch is equivalent to the new logic, but you'd be wrong, and that's exactly where the bug was. There's a similar bug in instsimplify which manifests itself as instsimplify failing to simplify this, rather than doing it wrong, see next commit. llvm-svn: 168447
2012-11-21Merging r168035: into 3.2 release branch.Pawel Wodnicki2-54/+30
Fix a crash observed by Shuxin Yang. The issue here is that LinearizeExprTree, the utility for extracting a chain of operations from the IR, thought that it might as well combine any constants it came across (rather than just returning them along with everything else). On the other hand, the factorization code would like to see the individual constants (this is quite reasonable: it is much easier to pull a factor of 3 out of 2*3 than it is to pull it out of 6; you may think 6/3 isn't so hard, but due to overflow it's not as easy to undo multiplications of constants as it may at first appear). This patch therefore makes LinearizeExprTree stupider: it now leaves optimizing to the optimization part of reassociate, and sticks to just analysing the IR. llvm-svn: 168446
2012-11-21Merging r168361, r168346 and r168227 into 3.2 branch releasePawel Wodnicki4-152/+212
Merging r168361: Fix PR14132 and handle OOB loads speculated throuh PHI nodes. The issue is that we may end up with newly OOB loads when speculating a load into the predecessors of a PHI node, and this confuses the new integer splitting logic in some cases, triggering an assertion failure. In fact, the branch in question must be dead code as it loads from a too-narrow alloca. Add code to handle this gracefully and leave the requisite FIXMEs for both optimizing more aggressively and doing more to aid sanitizing invalid code which triggers these patterns. Merging r168346: ------------------------------------------------------------------------ Rework the rewriting of loads and stores for vector and integer allocas to properly handle the combinations of these with split integer loads and stores. This essentially replaces Evan's r168227 by refactoring the code in a different way, and trynig to mirror that refactoring in both the load and store sides of the rewriting. Generally speaking there was some really problematic duplicated code here that led to poorly founded assumptions and then subtle bugs. Now much of the code actually flows through and follows a more consistent style and logical path. There is still a tiny bit of duplication on the store side of things, but it is much less bad. This also changes the logic to never re-use a load or store instruction as that was simply too error prone in practice. I've added a few tests (one a reduction of the one in Evan's original patch, which happened to be the same as the report in PR14349). I'm going to look at adding a few more tests for things I found and fixed in passing (such as the volatile tests in the vectorizable predicate). This patch has survived bootstrap, and modulo one bugfix survived Duncan's test suite, but let me know if anything else explodes. Merging r168227: Teach SROA rewriteVectorizedStoreInst to handle cases when the loaded value is narrower than the stored value. rdar://12713675 llvm-svn: 168443
2012-11-21Merging r168197: into 3.2 release branchPawel Wodnicki2-1/+11
Preserve address space of forward-referenced global variables in the LL parser Before, the parser would assert on the following code: @a2 = global i8 addrspace(1)* @a @a = addrspace(1) global i8 0 because the type of @a was "i8*" instead of "i8 addrspace(1)*" when parsing the initializer for @a2. llvm-svn: 168435
2012-11-21Merging r168319 into 3.2 release branchPawel Wodnicki2-8/+10
Fix a pasto. llvm-svn: 168432
2012-11-21Merging r168063 into 3.2 release branchPawel Wodnicki8-4/+28
block extended signatur option. Change previous option to a cc1 -fencode-extended-block-signature and pass it to cc1 and recognize this option to produce extended block type signature. // rdar://12109031 llvm-svn: 168419
2012-11-21Merging r168297 into 3.2 release branchPawel Wodnicki7-106/+172
Completely re-work how the Clang driver interprets PIC and PIE options. There were numerous issues here that were all entangled, and so I've tried to do a general simplification of the logic. 1) The logic was mimicing actual GCC bugs, rather than "features". These have been fixed in trunk GCC, and this fixes Clang as well. Notably, the logic was always intended to be last-match-wins like any other flag. 2) The logic for handling '-mdynamic-no-pic' was preposterously unclear. It also allowed the use of this flag on non-Darwin platforms where it has no actual meaning. Now this option is handled directly based on tests of how llvm-gcc behaves, and it is only supported on Darwin. 3) The APIs for the Driver's ToolChains had the implementation ugliness of dynamic-no-pic leaking through them. They also had the implementation details of the LLVM relocation model flag names leaking through. 4) The actual results of passing these flags was incorrect on Darwin in many cases. For example, Darwin *always* uses PIC level 2 if it uses in PIC level, and Darwin *always* uses PIC on 64-bit regardless of the flags specified, including -fPIE. Darwin never compiles in PIE mode, but it can *link* in PIE mode. 5) Also, PIC was not always being enabled even when PIE was. This isn't a supported mode at all and may have caused some fallout in builds with complex PIC and PIE interactions. The result is (I hope) cleaner and clearer for readers. I've also left comments and tests about some of the truly strage behavior that is observed on Darwin platforms. We have no real testing of Windows platforms and PIC, but I don't have the tools handy to figure that out. Hopefully others can beef up our testing here. Unfortunately, I can't test this for every platform. =/ If folks have dependencies on these flags that aren't covered by tests, they may break. I've audited and ensured that all the changes in behavior of the existing tests are intentional and good. In particular I've tried to make sure the Darwin behavior (which is more suprising than the Linux behavior) also matches that of 'gcc' on my mac. llvm-svn: 168416
2012-11-20Merge in r168364 to disable MCJIT execution engine tests on ppc32 (which ↵Andrew Kaylor1-0/+3
doesn't currently support MCJIT). llvm-svn: 168392
2012-11-20Merging r168001 into 3.2 release branchPawel Wodnicki1-6/+4
NVPTXISelLowering.cpp: Fix warnings. [-Wunused-variable] llvm-svn: 168378
2012-11-20Merge in PPC release notes: r168189 and r168352.Hal Finkel1-0/+40
llvm-svn: 168353
2012-11-20Merge in PPC internal-as fixes: r167861, r167862, r167863, r167875, r167860, ↵Hal Finkel6-33/+100
r167864 llvm-svn: 168351
2012-11-20Merge in r167737: Make PPC TOC contents deterministic.Hal Finkel1-3/+3
llvm-svn: 168350
2012-11-20Merge in r168316 so that the proper JIT tests are run on PPC.Hal Finkel2-2/+14
llvm-svn: 168349
2012-11-19Merging r167718 into 3.2 release branchPawel Wodnicki3-6/+19
Fix PR14314 - Fix operand order for atomic sub, where the minuend is the value loaded from memory and the subtrahend is the parameter specified. llvm-svn: 168336
2012-11-19Merging r167948, r168198: into the 3.2 release branchPawel Wodnicki5-5/+174
r168198 [NVPTX] Order global variables in def-use order before emiting them in the final assembly r167948 [NVPTX] Implement custom lowering of loads/stores for i1 Loads from i1 become loads from i8 followed by trunc Stores to i1 become zext to i8 followed by store to i8 llvm-svn: 168335
2012-11-19Merging r167855 into 3.2 relase branchPawel Wodnicki2-16/+62
Do not consider a machine instruction that uses and defines the same physical register as candidate for common subexpression elimination in MachineCSE. This fixes a bug on PowerPC in MultiSource/Applications/oggenc/oggenc caused by MachineCSE invalidly merging two separate DYNALLOC insns. llvm-svn: 168334
2012-11-19Merging r167719 into the 3.2 relase branchPawel Wodnicki1-1/+0
Remove unused field. llvm-svn: 168333
2012-11-19Merging r168124 into 3.2 release branchPawel Wodnicki1-1/+1
Fix PR14321, a crash when Clang is built with GCC 4.7 at -O1 or greater. GCC 4.7 reuses stack slots fairly aggressively, which exposes more temporary lifetime bugs. No new test, this was caught by the existing CodeGenCXX/mangle-ms-templates.cpp. llvm-svn: 168331
2012-11-19Merging r168024 from trunk into 3.2 release branch Pawel Wodnicki8-35/+804
Revert r167567, restoring the ability of clang to run gcc in cases where it can't handle the input file type. This resulted in PR14338. llvm-svn: 168330
2012-11-19Merging r167884,r167920 from trunk into 3.2 release branch Pawel Wodnicki5-18/+100
r167884 Don't try to save the assigned value in a Objective-C property assignment if the type of the value is a non-trivial class type. Fixes PR14318. (There's a minor ObjC++ language change here: given that we can't save the value, the type of the assignment expression is void in such cases.) r167920 PR14279: Work around this major miscompilation by treating move operations as non-trivial if they would not call a move operation, even if they would in fact call a trivial copy operation. A proper fix is to follow, but this small directed fix is intended for porting to the 3.2 release branch. llvm-svn: 168324
2012-11-19Merge r168260 from trunk:Benjamin Kramer3-6/+45
Enable inlining of 4 byte atomic ops on ppc32, 8 byte atomic ops on ppc64. Also fixes a bit/byte mismatch when checking if a target supports atomic ops of a certain size. llvm-svn: 168313
2012-11-16Merge r168176 from trunk:Hans Wennborg1-1/+2
SimplifyCFG: Don't assume non-null ScalarTargetTransformInfo. Patch by Pekka Jääskeläinen! llvm-svn: 168194
2012-11-16Merge r168147 from trunk:Hans Wennborg2-1/+23
Constant::IsThreadDependent(): Use dyn_cast<Constant> instead of cast It turns out that the operands of a Constant are not always themselves Constant. For example, one of the operands of BlockAddress is BasicBlock, which is not a Constant. This should fix the dragonegg-x86_64-linux-gcc-4.6-test build which broke in r168037. llvm-svn: 168193
2012-11-16Merge r168037 from trunk:Hans Wennborg4-0/+90
Make GlobalOpt be conservative with TLS variables (PR14309) For global variables that get the same value stored into them everywhere, GlobalOpt will replace them with a constant. The problem is that a thread-local GlobalVariable looks like one value (the address of the TLS var), but is different between threads. This patch introduces Constant::isThreadDependent() which returns true for thread-local variables and constants which depend on them (e.g. a GEP into a thread-local array), and teaches GlobalOpt not to track such values. llvm-svn: 168192
2012-11-15Bugzilla bug 14357Guy Benyei2-3/+12
Merge SPIR64 target from trunk - the 64bit counterpart of SPIR. The new OpenCL SPIR extension spec will define separate SPIR for 32 and 64 bit architectures. llvm-svn: 168092