aboutsummaryrefslogtreecommitdiffstats
Commit message (Collapse)AuthorAgeFilesLines
* change the MemIntrinsic get/setAlignment method to take an unsignedChris Lattner2009-03-084-20/+21
| | | | | | | instead of a Constant*, which is what the clients of it really want. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@66364 91177308-0d34-0410-b5e6-96231b3b80d8
* If a MI uses the same register more than once, only mark one of them as 'kill'.Evan Cheng2009-03-082-6/+100
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@66363 91177308-0d34-0410-b5e6-96231b3b80d8
* use MemTransferInst.Chris Lattner2009-03-081-1/+1
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@66362 91177308-0d34-0410-b5e6-96231b3b80d8
* Introduce a new MemTransferInst pseudo class, which is a commonChris Lattner2009-03-083-64/+56
| | | | | | | | parent between MemCpyInst and MemMoveInst, simplify some code to use it. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@66361 91177308-0d34-0410-b5e6-96231b3b80d8
* add a note.Chris Lattner2009-03-081-0/+40
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@66360 91177308-0d34-0410-b5e6-96231b3b80d8
* add a note.Chris Lattner2009-03-081-0/+22
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@66359 91177308-0d34-0410-b5e6-96231b3b80d8
* implement an optimization to codegen c ? 1.0 : 2.0 as load { 2.0, 1.0 } + c*4. Chris Lattner2009-03-083-5/+68
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | For 2009-03-07-FPConstSelect.ll we now produce: _f: xorl %eax, %eax testl %edi, %edi movl $4, %ecx cmovne %rax, %rcx leaq LCPI1_0(%rip), %rax movss (%rcx,%rax), %xmm0 ret previously we produced: _f: subl $4, %esp cmpl $0, 8(%esp) movss LCPI1_0, %xmm0 je LBB1_2 ## entry LBB1_1: ## entry movss LCPI1_1, %xmm0 LBB1_2: ## entry movss %xmm0, (%esp) flds (%esp) addl $4, %esp ret on PPC the code also improves to: _f: cntlzw r2, r3 srwi r2, r2, 5 li r3, lo16(LCPI1_0) slwi r2, r2, 2 addis r3, r3, ha16(LCPI1_0) lfsx f1, r3, r2 blr from: _f: li r2, lo16(LCPI1_1) cmplwi cr0, r3, 0 addis r2, r2, ha16(LCPI1_1) beq cr0, LBB1_2 ; entry LBB1_1: ; entry li r2, lo16(LCPI1_0) addis r2, r2, ha16(LCPI1_0) LBB1_2: ; entry lfs f1, 0(r2) blr This also improves the existing pic-cpool case from: foo: subl $12, %esp call .Lllvm$1.$piclabel .Lllvm$1.$piclabel: popl %eax addl $_GLOBAL_OFFSET_TABLE_ + [.-.Lllvm$1.$piclabel], %eax cmpl $0, 16(%esp) movsd .LCPI1_0@GOTOFF(%eax), %xmm0 je .LBB1_2 # entry .LBB1_1: # entry movsd .LCPI1_1@GOTOFF(%eax), %xmm0 .LBB1_2: # entry movsd %xmm0, (%esp) fldl (%esp) addl $12, %esp ret to: foo: call .Lllvm$1.$piclabel .Lllvm$1.$piclabel: popl %eax addl $_GLOBAL_OFFSET_TABLE_ + [.-.Lllvm$1.$piclabel], %eax xorl %ecx, %ecx cmpl $0, 4(%esp) movl $8, %edx cmovne %ecx, %edx fldl .LCPI1_0@GOTOFF(%eax,%edx) ret This triggers a few dozen times in spec FP 2000. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@66358 91177308-0d34-0410-b5e6-96231b3b80d8
* random cleanups.Chris Lattner2009-03-081-4/+3
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@66357 91177308-0d34-0410-b5e6-96231b3b80d8
* Fix misaligned whitespace. No functionality change.Nick Lewycky2009-03-081-4/+4
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@66355 91177308-0d34-0410-b5e6-96231b3b80d8
* fix a serious pessimization that Tron on IRC pointed out where we wouldChris Lattner2009-03-072-3/+22
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | "boolify" pointers, generating really awful code because getting the pointer value requires a load itself. Before: _foo: movb $1, _X.b ret _get: xorl %ecx, %ecx movb _X.b, %al testb %al, %al movl $_Y, %eax cmove %ecx, %eax ret With the xform disabled: _foo: movl $_Y, _X ret _get: movl _X, %eax ret git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@66351 91177308-0d34-0410-b5e6-96231b3b80d8
* Revert r66315. Fix the build on mixed 64/32 Linux systems.Nick Lewycky2009-03-071-10/+2
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@66350 91177308-0d34-0410-b5e6-96231b3b80d8
* Remove some duplication.Mikhail Glushenkov2009-03-071-5/+8
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@66347 91177308-0d34-0410-b5e6-96231b3b80d8
* Introduce new linkage types linkonce_odr, weak_odr, common_odrDuncan Sands2009-03-0743-192/+370
| | | | | | | | | | | | | | | | | | | | | | and extern_weak_odr. These are the same as the non-odr versions, except that they indicate that the global will only be overridden by an *equivalent* global. In C, a function with weak linkage can be overridden by a function which behaves completely differently. This means that IP passes have to skip weak functions, since any deductions made from the function definition might be wrong, since the definition could be replaced by something completely different at link time. This is not allowed in C++, thanks to the ODR (One-Definition-Rule): if a function is replaced by another at link-time, then the new function must be the same as the original function. If a language knows that a function or other global can only be overridden by an equivalent global, it can give it the weak_odr linkage type, and the optimizers will understand that it is alright to make deductions based on the function body. The code generators on the other hand map weak and weak_odr linkage to the same thing. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@66339 91177308-0d34-0410-b5e6-96231b3b80d8
* simplify the way how traits get hold of the symbol tableGabor Greif2009-03-074-28/+16
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@66336 91177308-0d34-0410-b5e6-96231b3b80d8
* further simplifications arising from peruse of the more declarative interfaceGabor Greif2009-03-077-28/+5
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@66333 91177308-0d34-0410-b5e6-96231b3b80d8
* Remove the burden of dealing with list offsetsGabor Greif2009-03-074-67/+25
| | | | | | | | | from SymbolTableListTraits' clients, and intead request a nice declarative interface. Cleans up an IMHO ugly wart. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@66331 91177308-0d34-0410-b5e6-96231b3b80d8
* When a crash signal is delivered do two things: remove all of ourChris Lattner2009-03-071-5/+14
| | | | | | | | | | | signal handlers to prevent reentrance on unrelated things (a sigabort where the handle bus errors) also, clear the signal mask so that the signal doesn't infinitely reissue. This fixes rdar://6654827 - Crash causes clang to loop git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@66330 91177308-0d34-0410-b5e6-96231b3b80d8
* Finish cross-process JIT work, and clean up previous work.Nate Begeman2009-03-072-30/+40
| | | | | | | | | | | | | | | | | 1. When the JIT is asked to remove a function, updating it's mapping to 0, we invalidate any function stubs used only by that function. Now, also invalidate the JIT's mapping from the GV the stub pointed to, to the address of the GV. 2. When dlsym stubs for cross-process JIT are enabled, do not abort just because a named function cannot be found in the JIT's process. 3. Fix various assumptions about when it is ok to use the lazy resolver when non-lazy JITing is enabled. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@66324 91177308-0d34-0410-b5e6-96231b3b80d8
* Arithmetic instructions don't set EFLAGS bits OF and CF bitsDan Gohman2009-03-073-14/+52
| | | | | | | | | | | | the same say the "test" instruction does in overflow cases, so eliminating the test is only safe when those bits aren't needed, as is the case for COND_E and COND_NE, or if it can be proven that no overflow will occur. For now, just restrict the optimization to COND_E and COND_NE and don't do any overflow analysis. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@66318 91177308-0d34-0410-b5e6-96231b3b80d8
* If ARCH is x86_64, pass -m64 to the host compiler. -m32 for i386. This makes ↵Evan Cheng2009-03-071-0/+8
| | | | | | sure the JIT work correctly. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@66315 91177308-0d34-0410-b5e6-96231b3b80d8
* Add IRBuilder::CreateConstGEP{1, 2}_{32, 64}.Daniel Dunbar2009-03-061-4/+36
| | | | | | | - Names are lame, but it seems better to be explicit. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@66295 91177308-0d34-0410-b5e6-96231b3b80d8
* Rename my makefile debugging rule to prevent accidental collisions.Daniel Dunbar2009-03-061-2/+2
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@66294 91177308-0d34-0410-b5e6-96231b3b80d8
* Add Module::getNamedValue; use to normalize access to Module symbolDaniel Dunbar2009-03-062-19/+31
| | | | | | | | table. - No functionality change. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@66289 91177308-0d34-0410-b5e6-96231b3b80d8
* Fix another case where debug info interferes withDale Johannesen2009-03-061-2/+6
| | | | | | | | an optimization. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@66288 91177308-0d34-0410-b5e6-96231b3b80d8
* Add default constructor to SDNode to make gcc 3.4.6 happy.Tanya Lattner2009-03-061-0/+4
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@66280 91177308-0d34-0410-b5e6-96231b3b80d8
* Use c_str() to force the string to be nul-terminated.Dan Gohman2009-03-061-1/+1
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@66279 91177308-0d34-0410-b5e6-96231b3b80d8
* Add a comment.Mikhail Glushenkov2009-03-061-0/+1
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@66278 91177308-0d34-0410-b5e6-96231b3b80d8
* some nits noticed by DuncanChris Lattner2009-03-061-2/+3
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@66274 91177308-0d34-0410-b5e6-96231b3b80d8
* fix header comment and include guard.Chris Lattner2009-03-061-9/+5
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@66273 91177308-0d34-0410-b5e6-96231b3b80d8
* add a bunch more passes to the C bindings (PR3734), patch byChris Lattner2009-03-064-19/+280
| | | | | | | Lennart Augustsson! git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@66272 91177308-0d34-0410-b5e6-96231b3b80d8
* Trailing whitespace.Mikhail Glushenkov2009-03-061-3/+3
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@66269 91177308-0d34-0410-b5e6-96231b3b80d8
* Trailing whitespace.Mikhail Glushenkov2009-03-061-18/+18
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@66268 91177308-0d34-0410-b5e6-96231b3b80d8
* While thinking about the one-definition-rule and tryingDuncan Sands2009-03-062-3/+23
| | | | | | | | | | | | | | to find a tiny mouse hole to squeeze through, it struck me that globals without a name can be considered internal since they can't be referenced from outside the current module. This patch makes GlobalOpt give them internal linkage. Also done for aliases even though they always have names, since in my opinion anonymous aliases should be allowed for consistency with global variables and functions. So if that happens one day, this code is ready! git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@66267 91177308-0d34-0410-b5e6-96231b3b80d8
* on apple systems, integrate nicely with crash reporter.Chris Lattner2009-03-061-4/+34
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@66264 91177308-0d34-0410-b5e6-96231b3b80d8
* While converting an aggregate to scalare, ignore and remove aggregate's ↵Devang Patel2009-03-062-3/+196
| | | | | | debug info. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@66262 91177308-0d34-0410-b5e6-96231b3b80d8
* Sprinkle some PrettyStackEntry magic into the passmanager. With this, we nowChris Lattner2009-03-063-90/+129
| | | | | | | | | | | | | | | | | | get nice and happy stack traces when we crash in an optimizer or codegen. For example, an abort put in UnswitchLoops now looks like this: Stack dump: 0. Program arguments: clang pr3399.c -S -O3 1. <eof> parser at end of file 2. per-module optimization passes 3. Running pass 'CallGraph Pass Manager' on module 'pr3399.c'. 4. Running pass 'Loop Pass Manager' on function '@foo' 5. Running pass 'Unswitch loops' on basic block '%for.inc' Abort git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@66260 91177308-0d34-0410-b5e6-96231b3b80d8
* Remove this as dbginfo intrinsics has been defined asZhou Sheng2009-03-061-5/+0
| | | | | | | IntrNoMem. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@66256 91177308-0d34-0410-b5e6-96231b3b80d8
* While hoisting instruction to speculatively execute simple bb, ignore dbg ↵Devang Patel2009-03-062-18/+138
| | | | | | intrinsics. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@66255 91177308-0d34-0410-b5e6-96231b3b80d8
* various cosmetic cleanups.Chris Lattner2009-03-061-136/+107
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@66254 91177308-0d34-0410-b5e6-96231b3b80d8
* this wasn't intended to go in.Chris Lattner2009-03-061-34/+0
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@66252 91177308-0d34-0410-b5e6-96231b3b80d8
* Change various llvm utilities to use PrettyStackTraceProgram inChris Lattner2009-03-0616-33/+112
| | | | | | | | their main routines. This makes the tools print their argc/argv commands if they crash. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@66248 91177308-0d34-0410-b5e6-96231b3b80d8
* Do not count DbgInfoIntrinsic while estimating loop header size.Devang Patel2009-03-061-2/+14
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@66245 91177308-0d34-0410-b5e6-96231b3b80d8
* Skip DbgInfoIntrinsic.Devang Patel2009-03-062-2/+68
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@66244 91177308-0d34-0410-b5e6-96231b3b80d8
* Committing unsaved changes that should've been with r66237.Gordon Henriksen2009-03-061-8/+7
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@66242 91177308-0d34-0410-b5e6-96231b3b80d8
* Fix ScheduleDAGRRList::CopyAndMoveSuccessors' handling of nodesDan Gohman2009-03-062-7/+42
| | | | | | | | | | | | with multiple chain operands. This can occur when the scheduler has added chain operands to a node that already has a chain operand, in order to handle physical register dependencies. This fixes an llvm-gcc bootstrap failure on x86-64 introduced in r66058. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@66240 91177308-0d34-0410-b5e6-96231b3b80d8
* Use CloneModule's ValueMap to avoid needing to look upDan Gohman2009-03-061-5/+4
| | | | | | | functions by name. This fixes PR718. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@66239 91177308-0d34-0410-b5e6-96231b3b80d8
* Incorporate feedback to improve GarbageCollection.html.Gordon Henriksen2009-03-061-57/+103
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@66237 91177308-0d34-0410-b5e6-96231b3b80d8
* Don't assign rank numbers to debug intrinsic "calls".Dale Johannesen2009-03-061-1/+3
| | | | | | | | This is needed so debug info doesn't change codegen. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@66235 91177308-0d34-0410-b5e6-96231b3b80d8
* When we split a basic block, there's a default branch to the newly created BB.Bill Wendling2009-03-061-0/+3
| | | | | | | Delete this default branch, because we're going to generate our own. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@66234 91177308-0d34-0410-b5e6-96231b3b80d8
* Revert 66224.Devang Patel2009-03-062-9/+9
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@66233 91177308-0d34-0410-b5e6-96231b3b80d8