summaryrefslogtreecommitdiffstats
path: root/llvm/lib
Commit message (Collapse)AuthorAgeFilesLines
...
* add a note.Chris Lattner2009-03-081-0/+40
| | | | llvm-svn: 66360
* add a note.Chris Lattner2009-03-081-0/+22
| | | | llvm-svn: 66359
* implement an optimization to codegen c ? 1.0 : 2.0 as load { 2.0, 1.0 } + c*4. Chris Lattner2009-03-081-2/+53
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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. llvm-svn: 66358
* random cleanups.Chris Lattner2009-03-081-4/+3
| | | | llvm-svn: 66357
* fix a serious pessimization that Tron on IRC pointed out where we wouldChris Lattner2009-03-071-3/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | "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 llvm-svn: 66351
* Introduce new linkage types linkonce_odr, weak_odr, common_odrDuncan Sands2009-03-0736-155/+259
| | | | | | | | | | | | | | | | | | | | | 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. llvm-svn: 66339
* simplify the way how traits get hold of the symbol tableGabor Greif2009-03-071-5/+3
| | | | llvm-svn: 66336
* further simplifications arising from peruse of the more declarative interfaceGabor Greif2009-03-073-21/+0
| | | | llvm-svn: 66333
* 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 llvm-svn: 66330
* 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. llvm-svn: 66324
* Arithmetic instructions don't set EFLAGS bits OF and CF bitsDan Gohman2009-03-072-14/+35
| | | | | | | | | | | 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. llvm-svn: 66318
* Add Module::getNamedValue; use to normalize access to Module symbolDaniel Dunbar2009-03-061-19/+21
| | | | | | | table. - No functionality change. llvm-svn: 66289
* Fix another case where debug info interferes withDale Johannesen2009-03-061-2/+6
| | | | | | an optimization. llvm-svn: 66288
* Use c_str() to force the string to be nul-terminated.Dan Gohman2009-03-061-1/+1
| | | | llvm-svn: 66279
* add a bunch more passes to the C bindings (PR3734), patch byChris Lattner2009-03-062-10/+149
| | | | | | Lennart Augustsson! llvm-svn: 66272
* While thinking about the one-definition-rule and tryingDuncan Sands2009-03-061-3/+12
| | | | | | | | | | | | | 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! llvm-svn: 66267
* on apple systems, integrate nicely with crash reporter.Chris Lattner2009-03-061-4/+34
| | | | llvm-svn: 66264
* While converting an aggregate to scalare, ignore and remove aggregate's ↵Devang Patel2009-03-061-3/+12
| | | | | | debug info. llvm-svn: 66262
* Sprinkle some PrettyStackEntry magic into the passmanager. With this, we nowChris Lattner2009-03-062-90/+106
| | | | | | | | | | | | | | | | 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 llvm-svn: 66260
* Remove this as dbginfo intrinsics has been defined asZhou Sheng2009-03-061-5/+0
| | | | | | IntrNoMem. llvm-svn: 66256
* While hoisting instruction to speculatively execute simple bb, ignore dbg ↵Devang Patel2009-03-061-18/+30
| | | | | | intrinsics. llvm-svn: 66255
* various cosmetic cleanups.Chris Lattner2009-03-061-136/+107
| | | | llvm-svn: 66254
* this wasn't intended to go in.Chris Lattner2009-03-061-34/+0
| | | | llvm-svn: 66252
* Change various llvm utilities to use PrettyStackTraceProgram inChris Lattner2009-03-061-0/+34
| | | | | | | their main routines. This makes the tools print their argc/argv commands if they crash. llvm-svn: 66248
* Do not count DbgInfoIntrinsic while estimating loop header size.Devang Patel2009-03-061-2/+14
| | | | llvm-svn: 66245
* Skip DbgInfoIntrinsic.Devang Patel2009-03-061-2/+2
| | | | llvm-svn: 66244
* Fix ScheduleDAGRRList::CopyAndMoveSuccessors' handling of nodesDan Gohman2009-03-061-7/+7
| | | | | | | | | | | 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. llvm-svn: 66240
* 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. llvm-svn: 66235
* 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. llvm-svn: 66234
* Revert 66224.Devang Patel2009-03-061-9/+7
| | | | llvm-svn: 66233
* Revert rev. 66167. Devang Patel2009-03-061-31/+9
| | | | | | We are still not out of woods yet. llvm-svn: 66232
* SRThreshold is meant to be inclusive.Evan Cheng2009-03-061-1/+1
| | | | llvm-svn: 66227
* Tweak the check for promotable alloca's to handleDale Johannesen2009-03-061-1/+7
| | | | | | debug intrinsics correctly. llvm-svn: 66225
* Do not let debug info prevert globalopt from shriking a global vars to boolean.Devang Patel2009-03-061-7/+9
| | | | llvm-svn: 66224
* Add "check/remove dbg var" helper routines.Devang Patel2009-03-061-0/+44
| | | | llvm-svn: 66223
* Don't use plain INC32 and DEC32 on x86-64; it needsDan Gohman2009-03-052-8/+30
| | | | | | | | INC64_32r and INC64_16r, because these instructions are encoded differently on x86-64. This fixes JIT regressions on x86-64 in kimwitu++ and others. llvm-svn: 66207
* When creating X86ISD::INC and X86ISD::DEC nodes, only add one operand.Dan Gohman2009-03-051-1/+6
| | | | | | | The extra operand didn't appear to cause any trouble, but it was erroneous regardless. llvm-svn: 66206
* Fix the "test" optimization to recognize "dec" as an add ofDan Gohman2009-03-051-9/+8
| | | | | | | negative one, as subtracts of immediates are canonicalized to adds. llvm-svn: 66180
* move some code to gracefully handle the case when a handler crashes.Chris Lattner2009-03-051-4/+6
| | | | llvm-svn: 66171
* GlobalOpt only process non constant local GVs while optimizing global vars.Devang Patel2009-03-051-9/+31
| | | | | | | | | | | | If non constant local GV named A is used by a constant local GV named B (e.g. llvm.dbg.variable) and B is not used by anyone else then eliminate A as well as B. In other words, debug info should not interfere in removal of unused GV. --This life, and those below, will be ignored-- M test/Transforms/GlobalOpt/2009-03-03-dbg.ll M lib/Transforms/IPO/GlobalOpt.cpp llvm-svn: 66167
* Add missing file.Duncan Sands2009-03-051-0/+1
| | | | llvm-svn: 66160
* (Hopefully) silence a warning.Owen Anderson2009-03-051-1/+1
| | | | llvm-svn: 66158
* Be more careful about choosing restore points when doing restore folding. ↵Owen Anderson2009-03-051-5/+28
| | | | | | This fixes some subtle miscompilations. llvm-svn: 66147
* Daniel wanted the stack printed upside down. Perhaps heChris Lattner2009-03-051-6/+14
| | | | | | | | | | | | | feels a kinship to machine stacks that grow down. Now we get stuff like this: Stack dump: 0. Program arguments: clang clang_crash_Iw2Osj.mi 1. /Developer/SDKs/MacOSX10.5.sdk/usr/lib/gcc/i686-apple-darwin9/4.0.1/include/xmmintrin.h:624:1: parsing function body '_mm_cvtpi16_ps' 2. /Developer/SDKs/MacOSX10.5.sdk/usr/lib/gcc/i686-apple-darwin9/4.0.1/include/xmmintrin.h:624:1: in compound statement ('{}') Abort llvm-svn: 66145
* indicate what the program args line is.Chris Lattner2009-03-051-1/+3
| | | | llvm-svn: 66144
* switch this message back to only being in -debug mode.Chris Lattner2009-03-051-1/+1
| | | | llvm-svn: 66143
* When allocating stubs, keep track of which Functions are referencing the stub.Nate Begeman2009-03-051-17/+120
| | | | | | | | This invalidates the stubs in the resolver map when they are no longer referenced, and should the JIT memory manager ever pick up a deallocateStub interface, the JIT could reclaim the memory for unused stubs as well. llvm-svn: 66141
* Do not split edges to EH landing pads. It will cause code size explosion.Evan Cheng2009-03-051-0/+6
| | | | llvm-svn: 66140
* Fix how livein live intervals are handled. Previously it could end at MBB ↵Evan Cheng2009-03-051-4/+9
| | | | | | start. Sorry, no small test case possible. llvm-svn: 66129
* Fix another case where debug info was affectingDale Johannesen2009-03-051-4/+17
| | | | | | | codegen. I convinced myself it was OK to skip all pointer bitcasts here too. llvm-svn: 66122
OpenPOWER on IntegriCloud