summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Target/X86/X86FastISel.cpp
Commit message (Collapse)AuthorAgeFilesLines
* Simplify code for calling a function where CanLowerReturn fails, fixing a ↵Eli Friedman2012-05-251-2/+1
| | | | | | small bug in the process. llvm-svn: 157446
* Typo.Chad Rosier2012-05-111-1/+1
| | | | llvm-svn: 156633
* Fix fastcc structure return with fast-isel on x86-32Derek Schuff2012-04-301-0/+2
| | | | | | | | | | | | | | On x86-32, structure return via sret lets the callee pop the hidden pointer argument off the stack, which the caller then re-pushes. However if the calling convention is fastcc, then a register is used instead, and the caller should not adjust the stack. This is implemented with a check of IsTailCallConvention X86TargetLowering::LowerCall but is now checked properly in X86FastISel::DoSelectCall. (this time, actually commit what was reviewed!) llvm-svn: 155825
* Revert r155745Derek Schuff2012-04-271-2/+0
| | | | llvm-svn: 155746
* Fix fastcc structure return with fast-isel on x86-32Derek Schuff2012-04-271-0/+2
| | | | | | | | | | | | On x86-32, structure return via sret lets the callee pop the hidden pointer argument off the stack, which the caller then re-pushes. However if the calling convention is fastcc, then a register is used instead, and the caller should not adjust the stack. This is implemented with a check of IsTailCallConvention X86TargetLowering::LowerCall but is now checked properly in X86FastISel::DoSelectCall. llvm-svn: 155745
* Convert some uses of XXXRegisterClass to &XXXRegClass. No functional change ↵Craig Topper2012-04-201-28/+29
| | | | | | since they are equivalent. llvm-svn: 155186
* Remove unnecessary llvm:: qualificationsCraig Topper2012-03-271-1/+1
| | | | llvm-svn: 153500
* Convert more static tables of registers used by calling convention to ↵Craig Topper2012-03-111-1/+1
| | | | | | uint16_t to reduce space. llvm-svn: 152538
* Make all pointers to TargetRegisterClass const since they are all pointers ↵Craig Topper2012-02-221-1/+1
| | | | | | to static data that should not be modified. llvm-svn: 151134
* Use the same CALL instructions for Windows as for everything else.Jakob Stoklund Olesen2012-02-161-6/+2
| | | | | | | The different calling conventions and call-preserved registers are represented with regmask operands that are added dynamically. llvm-svn: 150708
* Enable register mask operands for x86 calls.Jakob Stoklund Olesen2012-02-161-0/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Call instructions no longer have a list of 43 call-clobbered registers. Instead, they get a single register mask operand with a bit vector of call-preserved registers. This saves a lot of memory, 42 x 32 bytes = 1344 bytes per call instruction, and it speeds up building call instructions because those 43 imp-def operands no longer need to be added to use-def lists. (And removed and shifted and re-added for every explicit call operand). Passes like LiveVariables, LiveIntervals, RAGreedy, PEI, and BranchFolding are significantly faster because they can deal with call clobbers in bulk. Overall, clang -O2 is between 0% and 8% faster, uniformly distributed depending on call density in the compiled code. Debug builds using clang -O0 are 0% - 3% faster. I have verified that this patch doesn't change the assembly generated for the LLVM nightly test suite when building with -disable-copyprop and -disable-branch-fold. Branch folding behaves slightly differently in a few cases because call instructions have different hash values now. Copy propagation flushes its data structures when it crosses a register mask operand. This causes it to leave a few dead copies behind, on the order of 20 instruction across the entire nightly test suite, including SPEC. Fixing this properly would require the pass to use different data structures. llvm-svn: 150638
* Use a temporary variable, rather then a series of redundant calls.Chad Rosier2012-02-151-4/+5
| | | | llvm-svn: 150538
* Support MSVC x86-32 sret convention. PR11688. Patch by Joe Groff.Eli Friedman2012-01-201-1/+2
| | | | llvm-svn: 148513
* Remove hasXMM/hasXMMInt functions. Move callers to hasSSE1/hasSSE2. This is ↵Craig Topper2012-01-101-4/+4
| | | | | | the final piece to remove the AVX hack that disabled SSE. llvm-svn: 147843
* Change some places that were checking for AVX OR SSE1/2 to use ↵Craig Topper2012-01-091-4/+4
| | | | | | hasXMM/hasXMMInt instead. Also fix one place that checked SSE3, but accidentally excluded AVX to use hasSSE3orAVX. This is a step towards removing the AVX hack from the X86Subtarget.h llvm-svn: 147764
* Move global variables in TargetMachine into new TargetOptions class. As an APINick Lewycky2011-12-021-3/+3
| | | | | | | | | | | | change, now you need a TargetOptions object to create a TargetMachine. Clang patch to follow. One small functionality change in PTX. PTX had commented out the machine verifier parts in their copy of printAndVerify. That now calls the version in LLVMTargetMachine. Users of PTX who need verification disabled should rely on not passing the command-line flag to enable it. llvm-svn: 145714
* Make X86::FsFLD0SS / FsFLD0SD real pseudo-instructions.Jakob Stoklund Olesen2011-11-291-2/+2
| | | | | | | | | Like V_SET0, these instructions are expanded by ExpandPostRA to xorps / vxorps so they can participate in execution domain swizzling. This also makes the AVX variants redundant. llvm-svn: 145440
* Teach fast isel about vector stores, and make DoSelectCall return false when ↵Lang Hames2011-10-181-3/+24
| | | | | | it fails to emit a store. This fixes <rdar://problem/10215997>. llvm-svn: 142432
* Fix indent in comment.Nick Lewycky2011-10-121-1/+1
| | | | llvm-svn: 141749
* PR10991: make fast-isel correctly check whether accessing a global through ↵Eli Friedman2011-09-221-1/+11
| | | | | | an alias involves thread-local storage. (I'm not entirely sure how this is supposed to work, but this patch makes fast-isel consistent with the normal isel path.) llvm-svn: 140355
* Teach X86FastISel to use AVX versions of instructions when possibleBruno Cardoso Lopes2011-09-031-18/+26
| | | | llvm-svn: 139062
* Don't fast-isel for atomic load/store; some cases require extra handling ↵Eli Friedman2011-09-021-0/+8
| | | | | | missing from fast-isel. llvm-svn: 139044
* Bail from FastISel when we encounter a volatile memset intrinsic. Patch by IvanNick Lewycky2011-08-021-0/+3
| | | | | | Krasin! llvm-svn: 136663
* Teach PreprocessISelDAG to be aware of vector types and to not process them.Bruno Cardoso Lopes2011-08-011-2/+2
| | | | llvm-svn: 136653
* land David Blaikie's patch to de-constify Type, with a few tweaks.Chris Lattner2011-07-181-10/+10
| | | | llvm-svn: 135375
* Fix a problem with fast-isel return values introduced in r134018.Jakob Stoklund Olesen2011-06-301-2/+3
| | | | | | | | | We would put the return value from long double functions in the wrong register. This fixes gcc.c-torture/execute/conversion.c llvm-svn: 134205
* Move CallFrameSetupOpcode and CallFrameDestroyOpcode to TargetInstrInfo.Evan Cheng2011-06-281-2/+2
| | | | llvm-svn: 134030
* - Rename TargetInstrDesc, TargetOperandInfo to MCInstrDesc and MCOperandInfo andEvan Cheng2011-06-281-1/+1
| | | | | | | | sink them into MC layer. - Added MCInstrInfo, which captures the tablegen generated static data. Chang TargetInstrInfo so it's based off MCInstrInfo. llvm-svn: 134021
* Clean up the handling of the x87 fp stack to make it more robust.Jakob Stoklund Olesen2011-06-281-7/+9
| | | | | | | | | | | | | | | | | | | | Drop the FpMov instructions, use plain COPY instead. Drop the FpSET/GET instruction for accessing fixed stack positions. Instead use normal COPY to/from ST registers around inline assembly, and provide a single new FpPOP_RETVAL instruction that can access the return value(s) from a call. This is still necessary since you cannot tell from the CALL instruction alone if it returns anything on the FP stack. Teach fast isel to use this. This provides a much more robust way of handling fixed stack registers - we can tolerate arbitrary FP stack instructions inserted around calls and inline assembly. Live range splitting could sometimes break x87 code by inserting spill code in unfortunate places. As a bonus we handle floating point inline assembly correctly now. llvm-svn: 134018
* Remove TargetOptions.h dependency from X86Subtarget.Evan Cheng2011-06-231-1/+3
| | | | llvm-svn: 133726
* Make sure to pass OpFlags into MachineInstrBuilder::addExternalSymbol; theEli Friedman2011-06-111-1/+1
| | | | | | | memcpy/memset symbol doesn't get marked up correctly in PIC modes otherwise. Should fix llvm-x86_64-linux-checks buildbot. Followup to r132864. llvm-svn: 132869
* Add full x86 fast-isel support for memcpy and memset.Eli Friedman2011-06-101-9/+50
| | | | | | rdar://9431466 llvm-svn: 132864
* Add a parameter to CCState so that it can access the MachineFunction.Eric Christopher2011-06-081-17/+21
| | | | | | | | No functional change. Part of PR6965 llvm-svn: 132763
* Rewrite fast-isel integer cast handling to handle more cases, and to be ↵Eli Friedman2011-05-251-25/+43
| | | | | | | | | | simpler and more consistent. The practical effects here are that x86-64 fast-isel can now handle trunc from i8 to i1, and ARM fast-isel can handle many more constructs involving integers narrower than 32 bits (including loads, stores, and many integer casts). rdar://9437928 . llvm-svn: 132099
* Add fast-isel support for byval calls on x86.Eli Friedman2011-05-201-17/+51
| | | | llvm-svn: 131764
* Add fast-isel support for zeroext and signext ret instructions on x86.Eli Friedman2011-05-191-5/+25
| | | | llvm-svn: 131689
* Revert unintentional commit.Eli Friedman2011-05-181-26/+5
| | | | llvm-svn: 131597
* More instcombine simplifications towards better debug locations.Eli Friedman2011-05-181-5/+26
| | | | llvm-svn: 131596
* Add x86 fast-isel for calls returning first-class aggregates. rdar://9435872.Eli Friedman2011-05-171-46/+51
| | | | | | This is r131438 with a couple small fixes. llvm-svn: 131474
* Back out r131444 and r131438; they're breaking nightly tests. I'll look intoEli Friedman2011-05-171-43/+48
| | | | | | it more tomorrow. llvm-svn: 131451
* Add x86 fast-isel for calls returning first-class aggregates. rdar://9435872.Eli Friedman2011-05-171-48/+43
| | | | llvm-svn: 131438
* Make fast-isel work correctly s/uadd.with.overflow intrinsics.Eli Friedman2011-05-161-76/+7
| | | | llvm-svn: 131420
* Fix a FIXME by moving the fast-isel implementation of the objectsize ↵Eli Friedman2011-05-141-23/+0
| | | | | | intrinsic from the x86 code to the generic code. llvm-svn: 131332
* Zap useless code; this hasn't done anything useful since fast-isel switched ↵Eli Friedman2011-05-141-29/+0
| | | | | | to being bottom-up (a very long time ago). llvm-svn: 131329
* fast-isel sret calls, try 2. We actually do need to do something on x86-32. ↵Eli Friedman2011-04-281-2/+4
| | | | | | rdar://problem/9303592 . llvm-svn: 130429
* Revert r130348; causing buildbot issues on x86-32.Eli Friedman2011-04-281-0/+1
| | | | llvm-svn: 130412
* fast-isel sret. We actually don't need to do anything special on x86. :) ↵Eli Friedman2011-04-271-1/+0
| | | | | | rdar://problem/9303592 . llvm-svn: 130348
* Make the fast-isel code for literal 0.0 a bit shorter/faster, since 0.0 is ↵Eli Friedman2011-04-271-0/+41
| | | | | | common. rdar://problem/9303592 . llvm-svn: 130338
* Refactor out code to fast-isel a memcpy operation with a small constantEli Friedman2011-04-271-32/+40
| | | | | | length. (I'm planning to use this to implement byval.) llvm-svn: 130274
* Fix an edge case involving branches in fast-isel on x86.Eli Friedman2011-04-271-2/+4
| | | | | | rdar://problem/9303306 . llvm-svn: 130272
OpenPOWER on IntegriCloud