summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Target/X86/X86ISelLowering.cpp
Commit message (Collapse)AuthorAgeFilesLines
...
* Fix typo.Evan Cheng2010-03-051-1/+1
| | | | llvm-svn: 97818
* Fix an oops in x86 sibcall optimization. If the ByVal callee argument is ↵Evan Cheng2010-03-051-8/+14
| | | | | | itself passed as a pointer, then it's obviously not safe to do a tail call. llvm-svn: 97797
* Rever 96389 and 96990. They are causing some miscompilation that I do not ↵Evan Cheng2010-03-051-54/+0
| | | | | | fully understand. llvm-svn: 97782
* Fix recognition of 16-bit bswap for C front-ends which emit theDan Gohman2010-03-041-3/+12
| | | | | | clobber registers in a different order. llvm-svn: 97741
* Remove dead parameter passing.Bill Wendling2010-03-021-2/+1
| | | | llvm-svn: 97536
* Remove the optimize for code size limitation on r67917. Optimize 64-bit imul ↵Evan Cheng2010-03-011-4/+0
| | | | | | by constants into leas + shl regardless if optimizing for code size. The size saving from using imulq isn't worth it. Also, the lea and shl instructions may expose further optimization. llvm-svn: 97507
* Re-apply 97040 with fix. This survives a ppc self-host llvm-gcc bootstrap.Evan Cheng2010-02-271-16/+36
| | | | llvm-svn: 97310
* Truncate from i64 to i32 is "free" on x86-32, because it involves Dan Gohman2010-02-251-2/+2
| | | | | | just discarding one of the registers. llvm-svn: 97100
* Speculatively revert r97011, "Re-apply 96540 and 96556 with fixes.", again inDaniel Dunbar2010-02-241-36/+16
| | | | | | the hopes of fixing PPC bootstrap. llvm-svn: 97040
* When forming SSE min and max nodes for UGE and ULE comparisons, it'sDan Gohman2010-02-241-10/+74
| | | | | | | | | | | necessary to swap the operands to handle NaN and negative zero properly. Also, reintroduce logic for checking for NaN conditions when forming SSE min and max instructions, fixed to take into consideration NaNs and negative zeros. This allows forming min and max instructions in more cases. llvm-svn: 97025
* Re-apply 96540 and 96556 with fixes.Evan Cheng2010-02-241-16/+36
| | | | llvm-svn: 97011
* Fix rev 96389 by restricting the xform to mask that's either signbit or max ↵Evan Cheng2010-02-231-4/+9
| | | | | | signed value. llvm-svn: 96990
* X86InstrInfoSSE.td declares PINSRW as having type v8i16,Chris Lattner2010-02-231-3/+13
| | | | | | | don't alis it in the MMX .td file with a different width, split into two X86ISD opcodes. This fixes an x86 testcase. llvm-svn: 96859
* Mark the return address stack slot as mutable when moving the return addressArnold Schwaighofer2010-02-221-2/+2
| | | | | | | | | | | | | | | | | during a tail call. A parameter might overwrite this stack slot during the tail call. The sequence during a tail call is: 1.) load return address to temp reg 2.) move parameters (might involve storing to return address stack slot) 3.) store return address to new location from temp reg If the stack location is marked immutable CodeGen can colocate load (1) with the store (3). This fixes bug 6225. llvm-svn: 96783
* Remove the logic for reasoning about NaNs from the code that formsDan Gohman2010-02-221-88/+11
| | | | | | | | | | SSE min and max instructions. The real thing this code needs to be concerned about is negative zero. Update the sse-minmax.ll test accordingly, and add tests for -enable-unsafe-fp-math mode as well. llvm-svn: 96775
* fix an incorrect VT: eflags is always i32. The bug was causing us toChris Lattner2010-02-221-1/+1
| | | | | | | | create an X86ISD::Cmp node with result type i64 on the CodeGen/X86/shift-i256.ll testcase and the new isel was assert on it downstream. llvm-svn: 96768
* It turned out that we failed to emit proper symbol stubs on non-x86/darwin ↵Anton Korobeynikov2010-02-211-1/+1
| | | | | | | | | for ages (we emitted a reference to a stub, but no stub was emitted). The code inside x86-32/macho target objfile lowering should actually be the generic one - move it there. This (I really, really hope) should fix EH issues on ppc/darwin and arm/darwin. llvm-svn: 96755
* Revert commits 96556 and 96640, because commit 96556 breaks theDuncan Sands2010-02-191-32/+16
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | dragonegg self-host build. I reverted 96640 in order to revert 96556 (96640 goes on top of 96556), but it also looks like with both of them applied the breakage happens even earlier. The symptom of the 96556 miscompile is the following crash: llvm[3]: Compiling AlphaISelLowering.cpp for Release build cc1plus: /home/duncan/tmp/tmp/llvm/lib/CodeGen/SelectionDAG/SelectionDAG.cpp:4982: void llvm::SelectionDAG::ReplaceAllUsesWith(llvm::SDNode*, llvm::SDNode*, llvm::SelectionDAG::DAGUpdateListener*): Assertion `(!From->hasAnyUseOfValue(i) || From->getValueType(i) == To->getValueType(i)) && "Cannot use this version of ReplaceAllUsesWith!"' failed. Stack dump: 0. Running pass 'X86 DAG->DAG Instruction Selection' on function '@_ZN4llvm19AlphaTargetLowering14LowerOperationENS_7SDValueERNS_12SelectionDAGE' g++: Internal error: Aborted (program cc1plus) This occurs when building LLVM using LLVM built by LLVM (via dragonegg). Probably LLVM has miscompiled itself, though it may have miscompiled GCC and/or dragonegg itself: at this point of the self-host build, all of GCC, LLVM and dragonegg were built using LLVM. Unfortunately this kind of thing is extremely hard to debug, and while I did rummage around a bit I didn't find any smoking guns, aka obviously miscompiled code. Found by bisection. r96556 | evancheng | 2010-02-18 03:13:50 +0100 (Thu, 18 Feb 2010) | 5 lines Some dag combiner goodness: Transform br (xor (x, y)) -> br (x != y) Transform br (xor (xor (x,y), 1)) -> br (x == y) Also normalize (and (X, 1) == / != 1 -> (and (X, 1)) != / == 0 to match to "test on x86" and "tst on arm" r96640 | evancheng | 2010-02-19 01:34:39 +0100 (Fri, 19 Feb 2010) | 16 lines Transform (xor (setcc), (setcc)) == / != 1 to (xor (setcc), (setcc)) != / == 1. e.g. On x86_64 %0 = icmp eq i32 %x, 0 %1 = icmp eq i32 %y, 0 %2 = xor i1 %1, %0 br i1 %2, label %bb, label %return => testl %edi, %edi sete %al testl %esi, %esi sete %cl cmpb %al, %cl je LBB1_2 llvm-svn: 96672
* Some dag combiner goodness:Evan Cheng2010-02-181-16/+32
| | | | | | | | Transform br (xor (x, y)) -> br (x != y) Transform br (xor (xor (x,y), 1)) -> br (x == y) Also normalize (and (X, 1) == / != 1 -> (and (X, 1)) != / == 0 to match to "test on x86" and "tst on arm" llvm-svn: 96556
* Look for SSE and instructions of this form: (and x, (build_vector c1,c2,c3,c4)).Evan Cheng2010-02-161-1/+50
| | | | | | | | | | | | | If there exists a use of a build_vector that's the bitwise complement of the mask, then transform the node to (and (xor x, (build_vector -1,-1,-1,-1)), (build_vector ~c1,~c2,~c3,~c4)). Since this transformation is only useful when 1) the given build_vector will become a load from constpool, and 2) (and (xor x -1), y) matches to a single instruction, I decided this is appropriate as a x86 specific transformation. rdar://7323335 llvm-svn: 96389
* Preliminary patch to improve dwarf EH generation - Hooks to return ↵Anton Korobeynikov2010-02-151-2/+3
| | | | | | Personality / FDE / LSDA / TType encoding depending on target / options (e.g. code model / relocation model) - MCIzation of Dwarf EH printer to use encoding information - Stub generation for ELF target (needed for indirect references) - Some other small changes here and there llvm-svn: 96285
* Remove an assumption of default arguments. This is in anticipation of aDavid Greene2010-02-151-58/+83
| | | | | | change to SelectionDAG build APIs. llvm-svn: 96228
* Uniformize the names of type predicates: rather than having isFloatTy andDuncan Sands2010-02-151-5/+5
| | | | | | isInteger, we now have isFloatTy and isIntegerTy. Requested by Chris! llvm-svn: 96223
* Cleanup stdcall / fastcall name mangling.Anton Korobeynikov2010-02-121-15/+0
| | | | | | This should fix alot of problems we saw so far, e.g. PRs 5851 & 2936 llvm-svn: 95980
* refactor the conditional jump instructions in the .td file toChris Lattner2010-02-111-4/+4
| | | | | | | use a multipattern that generates both the 1-byte and 4-byte versions from the same defm llvm-svn: 95901
* The previous fix of widening divides that trap was too fragile as it depends ↵Mon P Wang2010-02-101-21/+0
| | | | | | | | | | | on custom lowering and requires that certain types exist in ValueTypes.h. Modified widening to check if an op can trap and if so, the widening algorithm will apply only the op on the defined elements. It is safer to do this in widening because the optimizer can't guarantee removing unused ops in some cases. llvm-svn: 95823
* Fix "the the" and similar typos.Dan Gohman2010-02-101-1/+1
| | | | llvm-svn: 95781
* switch ELF @GOTOFF references to use X86MCTargetExpr.Chris Lattner2010-02-081-5/+3
| | | | llvm-svn: 95593
* Rename the PerformTailCallOpt variable to GuaranteedTailCallOpt to reflectDan Gohman2010-02-081-6/+6
| | | | | | its current purpose. llvm-svn: 95564
* Do not emit callseq instructions around sibcalls. This eliminated some ↵Evan Cheng2010-02-061-20/+25
| | | | | | unnecessary stack adjustments. llvm-svn: 95475
* constant propagate a method away.Chris Lattner2010-02-051-8/+5
| | | | llvm-svn: 95408
* change getSizeOfImm and getBaseOpcodeFor to just takeChris Lattner2010-02-051-4/+4
| | | | | | TSFlags directly instead of a TargetInstrDesc. llvm-svn: 95405
* Handle tail call with byval arguments.Evan Cheng2010-02-051-24/+61
| | | | llvm-svn: 95351
* Re-enable x86 tail call optimization.Evan Cheng2010-02-041-3/+0
| | | | llvm-svn: 95295
* Indirect tail call has to go through a call preserved register since it's ↵Evan Cheng2010-02-041-15/+14
| | | | | | | | after callee register pops. X86 isel lowering is using EAX / R11 and it was somehow adding that to function live out. That prevented the real function return register from being added to the function live out list and bad things happen. This fixes 483.xalancbmk (with tail call opt). llvm-svn: 95280
* Speculatively disable x86 automatic tail call optimization while we track ↵Evan Cheng2010-02-031-0/+3
| | | | | | down a self-hosting issue. llvm-svn: 95259
* Allow all types of callee's to be tail called. But avoid automatic tailcall ↵Evan Cheng2010-02-031-17/+1
| | | | | | if the callee is a result of bitcast to avoid losing necessary zext / sext etc. llvm-svn: 95195
* ByVal frame object size should be that of the byval argument, not the size ↵Evan Cheng2010-02-021-7/+11
| | | | | | of the type which is just a pointer. This is not known to break stuff but is wrong nevertheless. llvm-svn: 95163
* Revert 95130.Evan Cheng2010-02-021-5/+11
| | | | llvm-svn: 95160
* Pass callsite return type to TargetLowering::LowerCall and use that to check ↵Evan Cheng2010-02-021-11/+5
| | | | | | sibcall eligibility. llvm-svn: 95130
* Perform sibcall in some cases when arguments are passes memory. Look for casesEvan Cheng2010-02-021-6/+49
| | | | | | | | | | | | | where callee's arguments are already in the caller's own caller's stack and they line up perfectly. e.g. extern int foo(int a, int b, int c); int bar(int a, int b, int c) { return foo(a, b, c); } llvm-svn: 95053
* Fix PR6196. GV callee may not be a function.Evan Cheng2010-02-011-3/+5
| | | | llvm-svn: 95017
* Undo r94946 now all the tests are passing again.Evan Cheng2010-02-011-11/+3
| | | | llvm-svn: 94970
* Fix a missing check from my last commit.Evan Cheng2010-01-311-1/+2
| | | | llvm-svn: 94949
* Avoid recursive sibcall's.Evan Cheng2010-01-311-6/+20
| | | | llvm-svn: 94946
* Allow more tailcall optimization: calls with inputs that are all passed in ↵Evan Cheng2010-01-301-3/+12
| | | | | | registers. llvm-svn: 94873
* Catch more trivial tail call opportunities: no inputs and output types match.Evan Cheng2010-01-291-12/+20
| | | | llvm-svn: 94804
* Fix a bug introduced by r94490 where it created a X86ISD::CMP whose output ↵Evan Cheng2010-01-281-1/+1
| | | | | | | | type is different from its inputs. This fixes PR6146. llvm-svn: 94731
* Perform trivial tail call optimization for callees with "C" ABI. These are doneEvan Cheng2010-01-271-4/+28
| | | | | | | | | even when -tailcallopt is not specified and it does not require changing ABI. First case is the most trivial one. Perform tail call optimization when both the caller and callee do not return values and when the callee does not take any input arguments. llvm-svn: 94664
* Eliminate target hook IsEligibleForTailCallOptimization.Evan Cheng2010-01-271-13/+20
| | | | | | | | | Target independent isel should always pass along the "tail call" property. Change target hook LowerCall's parameter "isTailCall" into a refernce. If the target decides it's impossible to honor the tail call request, it should set isTailCall to false to make target independent isel happy. llvm-svn: 94626
OpenPOWER on IntegriCloud