summaryrefslogtreecommitdiffstats
Commit message (Collapse)AuthorAgeFilesLines
...
* Author: Daniel Dunbar <daniel@zuster.org>Daniel Dunbar2012-04-094-15/+17
| | | | | | | --- log message follows this test --- [tests] Fixup some tests to work in "CLANG_IS_PRODUCTION" mode. llvm-svn: 154342
* Have TargetLowering::getPICJumpTableRelocBase return a node that points to theAkira Hatanaka2012-04-092-1/+9
| | | | | | GOT if jump table uses 64-bit gp-relative relocation. llvm-svn: 154341
* When performing a truncating store, it's possible to rearrange the data Chad Rosier2012-04-094-7/+107
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | in-register, such that we can use a single vector store rather then a series of scalar stores. For func_4_8 the generated code vldr d16, LCPI0_0 vmov d17, r0, r1 vadd.i16 d16, d17, d16 vmov.u16 r0, d16[3] strb r0, [r2, #3] vmov.u16 r0, d16[2] strb r0, [r2, #2] vmov.u16 r0, d16[1] strb r0, [r2, #1] vmov.u16 r0, d16[0] strb r0, [r2] bx lr becomes vldr d16, LCPI0_0 vmov d17, r0, r1 vadd.i16 d16, d17, d16 vuzp.8 d16, d17 vst1.32 {d16[0]}, [r2, :32] bx lr I'm not fond of how this combine pessimizes 2012-03-13-DAGCombineBug.ll, but I couldn't think of a way to judiciously apply this combine. This ldrh r0, [r0, #4] strh r0, [r1] becomes vldr d16, [r0] vmov.u16 r0, d16[2] vmov.32 d16[0], r0 vuzp.16 d16, d17 vst1.32 {d16[0]}, [r1, :32] PR11158 rdar://10703339 llvm-svn: 154340
* <rdar://problem/11202426> Greg Clayton2012-04-095-10/+29
| | | | | | Work around a deadlocking issue where "SBDebugger::MemoryPressureDetected ()" is being called and is causing a deadlock. We now just try and get the lock when trying to trim down the unique modules so we don't deadlock debugger GUI programs until we can find the root cause. llvm-svn: 154339
* Patch r153892 for PR11861 apparently broke an external project (see PR12493).Lang Hames2012-04-091-16/+17
| | | | | | | | | | This patch restores TwoAddressInstructionPass's pre-r153892 behaviour when rescheduling instructions in TryInstructionTransform. Hopefully this will fix PR12493. To refix PR11861, lowering of INSERT_SUBREGS is deferred until after the copy that unties the operands is emitted (this seems to be a more appropriate fix for that issue anyway). llvm-svn: 154338
* Fix typos.Tobias Grosser2012-04-093-4/+4
| | | | | | Pointed out by: Sebastian Pop <sebpop@gmail.com> llvm-svn: 154337
* Update comments and remove unnecessary isVolatile() check.Chad Rosier2012-04-091-3/+5
| | | | llvm-svn: 154336
* Implementing a test for the use of PWD to base finding theManuel Klimek2012-04-091-0/+12
| | | | | | correct compile commands on, based on an idea by Jordan Rose. llvm-svn: 154335
* objective-c: remove -fobjc-default-synthesize-properties from the driver.Fariborz Jahanian2012-04-093-5/+3
| | | | | | | cc1 option remains though to invoke default property synthesis. // rdar://11209719 llvm-svn: 154334
* objective-c: Remove -fno-objc-default-synthesize-propertiesFariborz Jahanian2012-04-093-5/+11
| | | | | | | as the driver option. // rdar://11209719 llvm-svn: 154331
* Fixes a fix to finding the current directory:Manuel Klimek2012-04-091-1/+4
| | | | | | | | We currently want to look whether PWD is available - if PWD is available it will get us the non-resolved current path, while fs::current_path will resolve symlinks. The long term fix is to not rely on that behavior any more. llvm-svn: 154330
* Typo.Eric Christopher2012-04-091-1/+1
| | | | llvm-svn: 154329
* Revert r154321, pending more discussion.David Chisnall2012-04-097-42/+0
| | | | llvm-svn: 154327
* [ASan] remove dispatch.h header once again - it's not present on Leopard, ↵Alexey Samsonov2012-04-091-3/+18
| | | | | | and we don't want to break the build of compiler-rt there. See https://trac.macports.org/ticket/33362 llvm-svn: 154326
* Fix bugs found by -Wconstant-conversion improvements currently under review.David Blaikie2012-04-097-30/+38
| | | | | | | | | | | | | | | | | | Specifically, using a an integer outside [0, 1] as a boolean constant seems to be an easy mistake to make with things like "x == a || b" where the author intended "x == a || x == b". The bug caused by calling SkipUntil with three token kinds was also identified by a VC diagnostic & reported by Francois Pichet as review feedback for my commit r154163. I've included test cases to verify the error recovery that was broken/poorly implemented due to this bug. The other fix (lib/Sema/SemaExpr.cpp) seems like that code was never actually reached in any of Clang's tests & is related to Objective C features I'm not familiar with, so I've not been able to construct a test case for it. Perhaps someone else can. llvm-svn: 154325
* Fix accidentally constant conditions found by uncommitted improvements to ↵David Blaikie2012-04-092-5/+6
| | | | | | | | | | | -Wconstant-conversion. A couple of cases where we were accidentally creating constant conditions by something like "x == a || b" instead of "x == a || x == b". In one case a conditional & then unreachable was used - I transformed this into a direct assert instead. llvm-svn: 154324
* Pattern match a setcc of boolean value with 0 as a truncate.Rafael Espindola2012-04-092-10/+81
| | | | llvm-svn: 154322
* Add -fobjc-trace to emit a call before and after each Objective-C message sendDavid Chisnall2012-04-097-0/+42
| | | | | | for hooking in code flow visualisation applications. llvm-svn: 154321
* This patch adds X86 instruction itineraries, which were missed by thePreston Gurd2012-04-091-28/+30
| | | | | | original patch to add itineraries, to X86InstrArithmetc.td. llvm-svn: 154320
* Clarify that fpaccuracy metadata is giving the compiler permission to use aDuncan Sands2012-04-091-2/+4
| | | | | | less accurate method. llvm-svn: 154319
* Factor out ARM floating ABI determination to new routine Anton Korobeynikov2012-04-091-35/+44
| | | | llvm-svn: 154318
* Make a modern Objective-C runtime the default target for *BSD. Don't yet ↵David Chisnall2012-04-091-0/+30
| | | | | | change this on GNU/Linux, where the GCC runtime still tends to be used. llvm-svn: 154315
* Use 'typename' instead of 'class' in template<> definitions supporting POD typesTimur Iskhodzhanov2012-04-091-6/+6
| | | | llvm-svn: 154314
* Lower some x86 shuffle sequences to the vblend family of instructions.Nadav Rotem2012-04-092-0/+107
| | | | llvm-svn: 154313
* s/lto_codegen_whole_program_optimization/lto_codegen_set_whole_program_optim ↵Bill Wendling2012-04-093-5/+5
| | | | | | ization/ llvm-svn: 154312
* Fix a bug in the lowering of broadcasts: ConstantPools need to use the ↵Nadav Rotem2012-04-093-19/+27
| | | | | | | | target pointer type. Move NormalizeVectorShuffle and LowerVectorBroadcast into X86TargetLowering. llvm-svn: 154310
* Remove unnecessary type check when combining and/or/xor of swizzles. Move ↵Craig Topper2012-04-091-13/+12
| | | | | | some checks to allow better early out. llvm-svn: 154309
* Remove unnecessary 'else' on an 'if' that always returnsCraig Topper2012-04-091-1/+2
| | | | llvm-svn: 154308
* Optimize code slightly. No functionality change.Craig Topper2012-04-091-6/+7
| | | | llvm-svn: 154307
* Add a hook to turn on the internalize pass through the LTO interface.Bill Wendling2012-04-095-4/+19
| | | | llvm-svn: 154306
* Replace some explicit checks with asserts for conditions that should never ↵Craig Topper2012-04-091-14/+7
| | | | | | happen. llvm-svn: 154305
* Cleanup and relax a restriction on the matching of global offsets intoChandler Carruth2012-04-093-29/+22
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | x86 addressing modes. This allows PIE-based TLS offsets to fit directly into an addressing mode immediate offset, which is the last remaining code quality issue from PR12380. With this patch, that PR is completely fixed. To understand why this patch is correct to match these offsets into addressing mode immediates, break it down by cases: 1) 32-bit is trivially correct, and unmodified here. 2) 64-bit non-small mode is unchanged and never matches. 3) 64-bit small PIC code which is RIP-relative is handled specially in the match to try to fit RIP into the base register. If it fails, it now early exits. This behavior is unchanged by the patch. 4) 64-bit small non-PIC code which is not RIP-relative continues to work as it did before. The reason these immediates are safe is because the ABI ensures they fit in small mode. This behavior is unchanged. 5) 64-bit small PIC code which is *not* using RIP-relative addressing. This is the only case changed by the patch, and the primary place you see it is in TLS, either the win64 section offset TLS or Linux local-exec TLS model in a PIC compilation. Here the ABI again ensures that the immediates fit because we are in small mode, and any other operations required due to the PIC relocation model have been handled externally to the Wrapper node (extra loads etc are made around the wrapper node in ISelLowering). I've tested this as much as I can comparing it with GCC's output, and everything appears safe. I discussed this with Anton and it made sense to him at least at face value. That said, if there are issues with PIC code after this patch, yell and we can revert it. llvm-svn: 154304
* Fold 15 tiny test cases into a single file that implements theChandler Carruth2012-04-0916-299/+336
| | | | | | | | | | | | | | | | | | | comprehensive testing of TLS codegen for x86. Convert all of the ones that were still using grep to use FileCheck. Remove some redundancies between them. Perhaps most interestingly expand the test cases so that they actually fully list the instruction snippet being tested. TLS operations are *very* narrowly defined, and so these seem reasonably stable. More importantly, the existing test cases already were crazy fine grained, expecting specific registers to be allocated. This just clarifies that no *other* instructions are expected, and fills in some crucial gaps that weren't being tested at all. This will make any subsequent changes to TLS much more clear during review. llvm-svn: 154303
* Remove definedAtomsBegin() and co. so that C++11 range based for loops can ↵Nick Kledzik2012-04-094-87/+29
| | | | | | be used llvm-svn: 154302
* Rename referencesBegin() to begin() so that C++11 range based for loops can ↵Nick Kledzik2012-04-0811-87/+48
| | | | | | be used llvm-svn: 154301
* Optimize code a bit. No functional change intended.Craig Topper2012-04-081-9/+9
| | | | llvm-svn: 154299
* Wire up -fpie and -fPIE to LLVM's newly added TargetOptions. No testChandler Carruth2012-04-081-0/+1
| | | | | | | | | | | case as we don't currently have any way of dumping target options or otherwise observing this. Another small step toward fixing PR12380. With this we generate TLS accesses using the static model instead of the dynamic model, but we're still generating suboptimal code under the mistaken assumption that the TLS offset might be greater than 2^32, and therefor not viable as an immediate offset of a segment register. llvm-svn: 154298
* Silence sign-compare warning.Benjamin Kramer2012-04-081-1/+1
| | | | llvm-svn: 154297
* Only have codegen turn fdiv by a constant into fmul by the reciprocalDuncan Sands2012-04-082-16/+7
| | | | | | | | when -ffast-math, i.e. don't just always do it if the reciprocal can be formed exactly. There is already an IR level transform that does that, and it does it more carefully. llvm-svn: 154296
* Simplify code that tries to do vector extracts for shuffles when the mask ↵Craig Topper2012-04-081-12/+8
| | | | | | width and the input vector widths don't match. No need to check the min and max are in range before calculating the start index. The range check after having the start index is sufficient. Also no need to check for an extract from the beginning differently. llvm-svn: 154295
* Teach LLVM about a PIE option which, when enabled on top of PIC, makesChandler Carruth2012-04-084-3/+80
| | | | | | | | | | | | | | | | | | | | optimizations which are valid for position independent code being linked into a single executable, but not for such code being linked into a shared library. I discussed the design of this with Eric Christopher, and the decision was to support an optional bit rather than a completely separate relocation model. Fundamentally, this is still PIC relocation, its just that certain optimizations are only valid under a PIC relocation model when the resulting code won't be in a shared library. The simplest path to here is to expose a single bit option in the TargetOptions. If folks have different/better designs, I'm all ears. =] I've included the first optimization based upon this: changing TLS models to the *Exec models when PIE is enabled. This is the LLVM component of PR12380 and is all of the hard work. llvm-svn: 154294
* Move the TLSModel information into the TargetMachine rather than hidingChandler Carruth2012-04-086-35/+37
| | | | | | | | in TargetLowering. There was already a FIXME about this location being odd. The interface is simplified as a consequence. This will also make it easier to change TLS models when compiling with PIE. llvm-svn: 154292
* Teach Clang about PIE compilations. This is the first step of PR12380.Chandler Carruth2012-04-0810-30/+168
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | First, this patch cleans up the parsing of the PIC and PIE family of options in the driver. The existing logic failed to claim arguments all over the place resulting in kludges that marked the options as unused. Instead actually walk all of the arguments and claim them properly. We now treat -f{,no-}{pic,PIC,pie,PIE} as a single set, accepting the last one on the commandline. Previously there were lots of ordering bugs that could creep in due to the nature of the parsing. Let me know if folks would like weird things such as "-fPIE -fno-pic" to turn on PIE, but disable full PIC. This doesn't make any sense to me, but we could in theory support it. Options that seem to have intentional "trump" status (-static, -mkernel, etc) continue to do so and are commented as such. Next, a -pie-level flag is threaded into the frontend, rigged to a language option, and handled preprocessor, setting up the appropriate defines. We'll now have the correct defines when compiling with -fpie. The one place outside of the preprocessor that was inspecting the PIC level (as opposed to the relocation model, which is set and handled separately, yay!) is in the GNU ObjC runtime. I changed it to exactly preserve existing behavior. If folks want to change its behavior in the face of PIE, they can do that in a separate patch. Essentially the only functionality changed here is the preprocessor defines and bug-fixes to the argument management. Tests have been updated and extended to test all of this a bit more thoroughly. llvm-svn: 154291
* Rephrase the preprocessor test to directly use CC1 and not botherChandler Carruth2012-04-081-12/+12
| | | | | | | | testing any of the strange driver behavior. We already have some tiny tests for the driver behavior, and I'm going to expand them greatly in the next commit. llvm-svn: 154290
* FileCheck-ize this test.Chandler Carruth2012-04-081-9/+12
| | | | llvm-svn: 154289
* EngineBuilder::create is expected to take ownership of the TargetMachine ↵Benjamin Kramer2012-04-081-3/+5
| | | | | | passed to it. Delete it on error or when we create an interpreter that doesn't need it. llvm-svn: 154288
* Remove an over zealous assert. The assert was trying to catch placesChandler Carruth2012-04-081-1/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | where a chain outside of the loop block-set ended up in the worklist for scheduling as part of the contiguous loop. However, asserting the first block in the chain is in the loop-set isn't a valid check -- we may be forced to drag a chain into the worklist due to one block in the chain being part of the loop even though the first block is *not* in the loop. This occurs when we have been forced to form a chain early due to un-analyzable branches. No test case here as I have no idea how to even begin reducing one, and it will be hopelessly fragile. We have to somehow end up with a loop header of an inner loop which is a successor of a basic block with an unanalyzable pair of branch instructions. Ow. Self-host triggers it so it is unlikely it will regress. This at least gets block placement back to passing selfhost and the test suite. There are still a lot of slowdown that I don't like coming out of block placement, although there are now also a lot of speedups. =[ I'm seeing swings in both directions up to 10%. I'm going to try to find time to dig into this and see if we can turn this on for 3.1 as it does a really good job of cleaning up after some loops that degraded with the inliner changes. llvm-svn: 154287
* Add a debug-only 'dump' method to the BlockChain structure to easeChandler Carruth2012-04-081-0/+8
| | | | | | debugging. llvm-svn: 154286
* Teach InstCombine to nuke a common alloca pattern -- an alloca which hasChandler Carruth2012-04-082-1/+114
| | | | | | | | | | | | GEPs, bit casts, and stores reaching it but no other instructions. These often show up during the iterative processing of the inliner, SROA, and DCE. Once we hit this point, we can completely remove the alloca. These were actually showing up in the final, fully optimized code in a bunch of inliner tests I've been working on, and notably they show up after LLVM finishes optimizing away all function calls involved in hash_combine(a, b). llvm-svn: 154285
* AVX2: Build splat vectors by broadcasting a scalar from the constant pool.Nadav Rotem2012-04-083-32/+106
| | | | | | | | Previously we used three instructions to broadcast an immediate value into a vector register. On Sandybridge we continue to load the broadcasted value from the constant pool. llvm-svn: 154284
OpenPOWER on IntegriCloud