1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2024-10-21 12:02:58 +02:00
Commit Graph

52735 Commits

Author SHA1 Message Date
Andrew Trick
251c9756e5 Initialize all common codegen passes before configuration so we can use their PassIDs.
llvm-svn: 149705
2012-02-03 20:14:47 +00:00
Chad Rosier
40b3e74387 [fast-isel] Add support for selecting UIToFP.
llvm-svn: 149704
2012-02-03 19:42:52 +00:00
Duncan Sands
9a1b76b649 Simplify some GEP checks in the verifier.
llvm-svn: 149698
2012-02-03 17:28:51 +00:00
Nadav Rotem
5c5681cf27 The type-legalizer often scalarizes code. One of the common patterns is extract-and-truncate.
In this patch we optimize this pattern and convert the sequence into extract op of a narrow type.
This allows the BUILD_VECTOR dag optimizations to construct efficient shuffle operations in many cases.

llvm-svn: 149692
2012-02-03 13:18:25 +00:00
Craig Topper
dee5f41723 Remove getShuffleVPERMILPImmediate function, getShuffleSHUFImmediate performs the same calculation.
llvm-svn: 149683
2012-02-03 06:52:33 +00:00
Craig Topper
afb89fb5f9 Remove unnecessary qualification on 256-bit vector handling in LowerBUILD_VECTOR. Condition was already guaranteed by earlier code.
llvm-svn: 149680
2012-02-03 06:32:21 +00:00
Craig Topper
94fcde74f6 Add auto upgrade support for x86 pcmpgt/pcmpeq intrinics removed in r149367.
llvm-svn: 149678
2012-02-03 06:10:55 +00:00
Andrew Trick
da0c52e742 Added TargetPassConfig. The first little step toward configuring codegen passes.
Allows command line overrides to be centralized in LLVMTargetMachine.cpp.
LLVMTargetMachine can intercept common passes and give precedence to command line overrides.
Allows adding "internal" target configuration options without touching TargetOptions.
Encapsulates the PassManager.
Provides a good point to initialize all CodeGen passes so that Pass ID's can be used in APIs.
Allows modifying the target configuration hooks without rebuilding the world.

llvm-svn: 149672
2012-02-03 05:12:41 +00:00
Andrew Trick
0838f6788a whitespace
llvm-svn: 149671
2012-02-03 05:12:30 +00:00
Akira Hatanaka
874523adc5 Add a new MachineJumpTableInfo entry type, EK_GPRel64BlockAddress, which is
needed to emit a 64-bit gp-relative relocation entry. Make changes necessary
for emitting jump tables which have entries with directive .gpdword. This patch
does not implement the parts needed for direct object emission or JIT.

llvm-svn: 149668
2012-02-03 04:33:00 +00:00
Lang Hames
311e44bd42 Incorporate suggestions Chad, Jakob and Evan's suggestions on r149957.
llvm-svn: 149655
2012-02-03 01:13:49 +00:00
Jim Grosbach
68e59a434c Narrow test further. Make bot and test happy.
llvm-svn: 149650
2012-02-03 00:26:07 +00:00
Jim Grosbach
6c70b7e9a5 Tidy up. Trailing whitespace.
llvm-svn: 149649
2012-02-03 00:07:04 +00:00
Jim Grosbach
12f2a6322e Restrict InstCombine from converting varargs to or from fixed args.
More targetted fix replacing d0e277d272d517ca1cda368267d199f0da7cad95.

llvm-svn: 149648
2012-02-03 00:00:55 +00:00
Jim Grosbach
bc7e9b3c96 Revert "Disable InstCombine unsafe folding bitcasts of calls w/ varargs."
This reverts commit d0e277d272d517ca1cda368267d199f0da7cad95.

llvm-svn: 149647
2012-02-03 00:00:50 +00:00
Jakob Stoklund Olesen
b84880cf78 Require non-NULL register masks.
It doesn't seem worthwhile to give meaning to a NULL register mask
pointer. It complicates all the code using register mask operands.

llvm-svn: 149646
2012-02-02 23:52:57 +00:00
Jakob Stoklund Olesen
5c71bf1b0e Add pseudo-registers for pairs, triples, and quads of D registers.
NEON loads and stores accept single and double spaced pairs, triples,
and quads of D registers.  This patch adds new register classes to
accurately model those constraints:

  Dn, Dn+1    Dn, Dn+2
  ----------------------
  DPair       DPairSpc
  DTriple     DTripleSpc
  DQuad       DQuadSpc

Also extend the existing QQ and QQQQ register classes to contains all Q
pairs and quads instead of just the aligned ones.

These new register classes will make it possible to accurately model
constraints on NEON loads and stores, and we can get rid of all the NEON
pseudo-instructions.  The late scheduler will be able to accurately
model instruction dependencies from the explicit operands.

This more than doubles the number of ARM registers, but the backend
passes are quite good at handling this. The llc -O0 compile time only
regresses by 1.5%.  Future work on register mask operands will recover
this regression.

llvm-svn: 149640
2012-02-02 22:45:32 +00:00
Benjamin Kramer
aa5b959259 BBVectorize: Simplify code, no functionality change.
Also silences warnings about bodyless for loops.

llvm-svn: 149612
2012-02-02 18:52:15 +00:00
Hal Finkel
f067127629 Minor changes from review.
As suggested by Nick Lewycky, the tree traversal queues have been changed to SmallVectors and the associated loops have been rotated. Also, an 80-col violation was fixed.

llvm-svn: 149607
2012-02-02 17:29:39 +00:00
Elena Demikhovsky
00f62e0e9f Minor change in signature of the getZeroVector()
llvm-svn: 149601
2012-02-02 09:20:18 +00:00
Elena Demikhovsky
7ca11b6e3f Optimization for SIGN_EXTEND operation on AVX.
Special handling was added for v4i32 -> v4i64 and v8i16 -> v8i32
extensions.

llvm-svn: 149600
2012-02-02 09:10:43 +00:00
Francois Pichet
0f41b565e8 Unbreak the MSVC build.
llvm-svn: 149599
2012-02-02 08:36:09 +00:00
Lang Hames
17ebcce7ef Re-apply the coalescer fix from r149147. Commit r149597 should have fixed the llvm-gcc and clang self-host issues.
llvm-svn: 149598
2012-02-02 08:01:53 +00:00
Lang Hames
004f627ed6 Set EFLAGS correctly in EmitLoweredSelect on X86.
llvm-svn: 149597
2012-02-02 07:48:37 +00:00
Lang Hames
f5cc9f22ab Break as soon as the MustMapCurValNos flag is set - no need to reiterate.
llvm-svn: 149596
2012-02-02 06:55:45 +00:00
Hal Finkel
1a95e36a7d Vectorize long blocks in groups.
Long basic blocks with many candidate pairs (such as in the SHA implementation in Perl 5.14; thanks to Roman Divacky for the example) used to take an unacceptably-long time to compile. Instead, break long blocks into groups so that no group has too many candidate pairs.

llvm-svn: 149595
2012-02-02 06:14:56 +00:00
Lang Hames
2efb52b518 PR11868. The previous loop in LiveIntervals::join would sometimes fall over if
more than two adjacent ranges needed to be merged. The new version should be
able to handle an arbitrary sequence of adjancent ranges.

llvm-svn: 149588
2012-02-02 05:37:34 +00:00
Akira Hatanaka
54552b8fa7 Set the correct stack pointer register.
llvm-svn: 149585
2012-02-02 03:17:04 +00:00
Akira Hatanaka
4319eaf8b7 Expand EHSELECTION and EHSELECTION nodes. Set the correct exception pointer and
selector registers.
 

llvm-svn: 149584
2012-02-02 03:13:40 +00:00
Akira Hatanaka
88e74ead4b Add DWARF numbers of 64-bit registers.
llvm-svn: 149583
2012-02-02 02:56:14 +00:00
Pete Cooper
880d303f14 Typo
llvm-svn: 149562
2012-02-01 23:43:12 +00:00
Rafael Espindola
a223881c4a Fix the cmake build
llvm-svn: 149561
2012-02-01 23:40:51 +00:00
Andrew Trick
d09b64fc25 Instruction scheduling itinerary for Intel Atom.
Adds an instruction itinerary to all x86 instructions, giving each a default latency of 1, using the InstrItinClass IIC_DEFAULT.

Sets specific latencies for Atom for the instructions in files X86InstrCMovSetCC.td, X86InstrArithmetic.td, X86InstrControl.td, and X86InstrShiftRotate.td. The Atom latencies for the remainder of the x86 instructions will be set in subsequent patches.

Adds a test to verify that the scheduler is working.

Also changes the scheduling preference to "Hybrid" for i386 Atom, while leaving x86_64 as ILP.

Patch by Preston Gurd!

llvm-svn: 149558
2012-02-01 23:20:51 +00:00
Jakob Stoklund Olesen
1410489492 Move ARM subreg index compositions to the SubRegIndex itself.
llvm-svn: 149557
2012-02-01 23:16:43 +00:00
Andrew Trick
7bdbed8e5b fix cmake
llvm-svn: 149553
2012-02-01 22:28:29 +00:00
Mon P Wang
7313ffe333 Avoid creating an extract element to an illegal type after LegalizeTypes has run.
llvm-svn: 149548
2012-02-01 22:15:20 +00:00
Andrew Trick
b4963dd8da VLIW specific scheduler framework that utilizes deterministic finite automaton (DFA).
This new scheduler plugs into the existing selection DAG scheduling framework. It is a top-down critical path scheduler that tracks register pressure and uses a DFA for pipeline modeling.

Patch by Sergei Larin!

llvm-svn: 149547
2012-02-01 22:13:57 +00:00
Chad Rosier
9c3c30332f Tidy up.
llvm-svn: 149521
2012-02-01 18:45:51 +00:00
Elena Demikhovsky
455db87d41 Passing AVX 256-bit structures in Win64 was wrong.
Fixed Win64 calling conventions.

llvm-svn: 149494
2012-02-01 10:46:14 +00:00
Elena Demikhovsky
f63bfb1b5d Shortened code in shuffle masks
llvm-svn: 149493
2012-02-01 10:33:05 +00:00
Elena Demikhovsky
da37eb48d8 Optimization for "truncate" operation on AVX.
Truncating v4i64 -> v4i32 and v8i32 -> v8i16 may be done with set of shuffles.

llvm-svn: 149485
2012-02-01 07:56:44 +00:00
Stepan Dyatkovskiy
856ca370cc SwitchInst refactoring.
The purpose of refactoring is to hide operand roles from SwitchInst user (programmer). If you want to play with operands directly, probably you will need lower level methods than SwitchInst ones (TerminatorInst or may be User). After this patch we can reorganize SwitchInst operands and successors as we want.

What was done:

1. Changed semantics of index inside the getCaseValue method:
getCaseValue(0) means "get first case", not a condition. Use getCondition() if you want to resolve the condition. I propose don't mix SwitchInst case indexing with low level indexing (TI successors indexing, User's operands indexing), since it may be dangerous.
2. By the same reason findCaseValue(ConstantInt*) returns actual number of case value. 0 means first case, not default. If there is no case with given value, ErrorIndex will returned.
3. Added getCaseSuccessor method. I propose to avoid usage of TerminatorInst::getSuccessor if you want to resolve case successor BB. Use getCaseSuccessor instead, since internal SwitchInst organization of operands/successors is hidden and may be changed in any moment.
4. Added resolveSuccessorIndex and resolveCaseIndex. The main purpose of these methods is to see how case successors are really mapped in TerminatorInst.
4.1 "resolveSuccessorIndex" was created if you need to level down from SwitchInst to TerminatorInst. It returns TerminatorInst's successor index for given case successor.
4.2 "resolveCaseIndex" converts low level successors index to case index that curresponds to the given successor.

Note: There are also related compatability fix patches for dragonegg, klee, llvm-gcc-4.0, llvm-gcc-4.2, safecode, clang.
llvm-svn: 149481
2012-02-01 07:49:51 +00:00
Andrew Trick
3c9be3c4cc Add pass printer passes in the right place.
The pass pointer should never be referenced after sending it to
schedulePass(), which may delete the pass. To fix this bug I had to
clean up the design leading to more goodness.

You may notice now that any non-analysis pass is printed. So things like loop-simplify and lcssa show up, while target lib, target data, alias analysis do not show up. Normally, analysis don't mutate the IR, but you can now check this by using both -print-after and -print-before. The effects of analysis will now show up in between the two.

The llc path is still in bad shape. But I'll be improving it in my next checkin. Meanwhile, print-machineinstrs still works the same way. With print-before/after, many llc passes that were not printed before now are, some of these should be converted to analysis. A few very important passes, isel and scheduler, are not properly initialized, so not printed.

llvm-svn: 149480
2012-02-01 07:16:20 +00:00
Craig Topper
79859da905 Don't create VBROADCAST nodes if any nodes use the chain result from the load. Fixes PR11900.
llvm-svn: 149478
2012-02-01 06:51:58 +00:00
NAKAMURA Takumi
8068191bb8 BBVectorize.cpp: Try to fix MSVC build. map::iterator and multimap::iterator are incompatible.
llvm-svn: 149475
2012-02-01 06:11:58 +00:00
Hal Finkel
15dafd979c A few of the changes suggested in code review (by Nick Lewycky)
llvm-svn: 149472
2012-02-01 05:51:45 +00:00
Argyrios Kyrtzidis
492f34016f Revert Chris' commits up to r149348 that started causing VMCoreTests unit test to fail.
These are:

r149348
r149351
r149352
r149354
r149356
r149357
r149361
r149362
r149364
r149365

llvm-svn: 149470
2012-02-01 04:51:17 +00:00
Hal Finkel
8cf5de5774 Add a basic-block autovectorization pass.
This is the initial checkin of the basic-block autovectorization pass along with some supporting vectorization infrastructure.
Special thanks to everyone who helped review this code over the last several months (especially Tobias Grosser).

llvm-svn: 149468
2012-02-01 03:51:43 +00:00
Jim Grosbach
6186319c3f Disable InstCombine unsafe folding bitcasts of calls w/ varargs.
Changing arguments from being passed as fixed to varargs is unsafe, as
the ABI may require they be handled differently (stack vs. register, for
example).

Remove two tests which rely on the bitcast being folded into the direct
call, which is exactly the transformation that's unsafe.

llvm-svn: 149457
2012-02-01 00:08:17 +00:00
Jim Grosbach
b4cc72d103 Tidy up. One more return type mismatch fix.
llvm-svn: 149452
2012-01-31 23:51:09 +00:00
Lenny Maiorani
e3f2427596 bz11794 : EarlyCSE stack overflow on long functions.
Make the EarlyCSE optimizer not use recursion to do a depth first iteration.

llvm-svn: 149445
2012-01-31 23:14:41 +00:00
Kevin Enderby
cb876a7560 Fixed a crash in llvm-mc for Mach-O when a symbol difference expression uses a
symbol from an assignment.  In this case the symbol did not have a fragment so
MCObjectWriter::IsSymbolRefDifferenceFullyResolved() should not have been
calling IsSymbolRefDifferenceFullyResolvedImpl() with a NULL fragment and should
just have returned false in that case.

llvm-svn: 149442
2012-01-31 23:02:57 +00:00
Bob Wilson
caefeeb04d Add Triple::getMacOSXVersion to replace crufty code in the clang driver.
This new function provides a way to get the Mac OS X version number from
either generic "darwin" triples of macosx triples.

llvm-svn: 149438
2012-01-31 22:32:29 +00:00
Jim Grosbach
2f211187f7 Refactor loop for better readability.
Excellent suggestion from Ben Kramer.

llvm-svn: 149417
2012-01-31 20:56:55 +00:00
Jim Grosbach
5a7c34d3ef Add explanatory comment.
llvm-svn: 149416
2012-01-31 20:34:53 +00:00
Andrew Trick
d03ff2ba28 Obvious unnecessary loop removal. Follow through from previous checkin.
llvm-svn: 149398
2012-01-31 18:54:19 +00:00
Devang Patel
b8688eac99 Add assembler dialect attribute in asm parser which lets target specific asm parser change dialect on the fly.
llvm-svn: 149396
2012-01-31 18:14:05 +00:00
Bill Wendling
0ebee7acc5 Increase the initial vector size to be equivalent to the size of the Deps
vector. This potentially saves a resizing.

llvm-svn: 149369
2012-01-31 07:04:52 +00:00
Bill Wendling
91826c63c8 Cache the size of the vector instead of calling .size() all over the place.
llvm-svn: 149368
2012-01-31 06:57:53 +00:00
Craig Topper
2b764de6ab Remove pcmpgt/pcmpeq intrinsics as clang is not using them.
llvm-svn: 149367
2012-01-31 06:52:44 +00:00
Chris Lattner
a9b3505e9a eliminate the "string" form of ConstantArray::get, using
ConstantDataArray::getString instead.

llvm-svn: 149365
2012-01-31 06:18:43 +00:00
Chris Lattner
06407b2f81 with recent changes, ConstantArray is never a "string". Remove the associated
methods and constant fold the clients to false.

llvm-svn: 149362
2012-01-31 06:05:00 +00:00
Andrew Trick
397912b1c0 RAFast: Generalize the logic for return operands.
This removes implicit assumption about the form of MI coming into regalloc. In particular, it should be independent of ProcessImplicitDefs which will eventually become a standard part of coming out of SSA--unless we simply can eliminate IMPLICIT_DEF completely. Current unit tests expose this once I remove incidental pass ordering restrictions.

This is not a final fix. Just a temporary workaround until I figure out the right way.

llvm-svn: 149360
2012-01-31 05:55:32 +00:00
Chris Lattner
63a482554f fix a small oversight that broke the fhourstones app.
llvm-svn: 149357
2012-01-31 05:18:56 +00:00
Chris Lattner
7903530b71 remove the last vestiges of llvm::GetConstantStringInfo, in CodeGen.
llvm-svn: 149356
2012-01-31 05:09:17 +00:00
Chris Lattner
3ca194bce8 eliminate the last uses of GetConstantStringInfo from this file, I didn't realize I was that close...
llvm-svn: 149354
2012-01-31 04:54:27 +00:00
Chandler Carruth
a71c1f9470 Add various coarse bit-width architecture predicates to llvm::Triple.
These are very useful for frontends and other utilities reasoning about
or selecting between triples.

llvm-svn: 149353
2012-01-31 04:52:32 +00:00
Chris Lattner
96d5f62396 start moving SimplifyLibcalls over to getConstantStringInfo, which is
dramatically more efficient than GetConstantStringInfo.

llvm-svn: 149352
2012-01-31 04:43:11 +00:00
Chris Lattner
b463bd21fc Change ConstantArray::get to form a ConstantDataArray when possible,
kicking in the big win of ConstantDataArray.  As part of this, change
the implementation of GetConstantStringInfo in ValueTracking to work
with ConstantDataArray (and not ConstantArray) making it dramatically,
amazingly, more efficient in the process and renaming it to 
getConstantStringInfo.

This keeps around a GetConstantStringInfo entrypoint that (grossly)
forwards to getConstantStringInfo and constructs the std::string 
required, but existing clients should move over to 
getConstantStringInfo instead.

llvm-svn: 149351
2012-01-31 04:42:22 +00:00
Chris Lattner
b4d65d2788 rework this logic to not depend on the last argument to GetConstantStringInfo,
which is going away.

llvm-svn: 149348
2012-01-31 04:39:22 +00:00
Chris Lattner
5547cb8346 don't emit a 1-byte object as a .fill. This is silly and causes
CodeGen/X86/global-sections.ll to fail with CDArray

llvm-svn: 149343
2012-01-31 03:39:24 +00:00
Chris Lattner
8f102298a0 use the right accessor for ConstantDataArray.
llvm-svn: 149342
2012-01-31 03:16:39 +00:00
Chris Lattner
1d52d79d31 fix asmwriting of ConstantDataArray to use the right element count,
simplify ConstantArray handling, since they can never be empty.

llvm-svn: 149341
2012-01-31 03:15:40 +00:00
Chris Lattner
054e412291 enhance logic to support ConstantDataArray.
llvm-svn: 149340
2012-01-31 02:55:06 +00:00
Bill Wendling
fadeb75339 Remove the now-dead llvm.eh.exception and llvm.eh.selector intrinsics.
llvm-svn: 149331
2012-01-31 01:58:48 +00:00
Bill Wendling
0e5559bc4d s/getInnerUnwindDest/getInnerResumeDest/g
llvm-svn: 149328
2012-01-31 01:48:40 +00:00
Bill Wendling
0b1a8d62d4 Remove the eh.exception and eh.selector intrinsics. Also remove a hack to copy
over the catch information. The catch information is now tacked to the invoke
instruction.

llvm-svn: 149326
2012-01-31 01:46:13 +00:00
Bill Wendling
a2a758eff6 Remove ivar which is identical to another ivar.
llvm-svn: 149323
2012-01-31 01:25:54 +00:00
Bill Wendling
cf0fa6b786 Remove unused ivars and s/getOuterUnwindDest/getOuterResumeDest/g.
llvm-svn: 149322
2012-01-31 01:22:03 +00:00
Bill Wendling
1b3c45b027 Remove more dead functions.
llvm-svn: 149318
2012-01-31 01:18:21 +00:00
Bill Wendling
1be31fd0b1 s/getInnerUnwindDestNewEH/getInnerUnwindDest/g
llvm-svn: 149317
2012-01-31 01:15:59 +00:00
Bill Wendling
6a5ff9da71 Remove some unused, old-EH methods.
llvm-svn: 149316
2012-01-31 01:14:49 +00:00
Eli Friedman
b3c6efa558 Use the correct ShiftAmtTy for creating shifts after legalization. PR11881. Not committing a testcase because I think it will be too fragile.
llvm-svn: 149315
2012-01-31 01:08:03 +00:00
Bill Wendling
ab823c2ad4 Get rid of references to dead intrinsics.
The eh.selector and eh.resume intrinsics aren't used anymore. Get rid of some
calls to them.

llvm-svn: 149314
2012-01-31 01:05:20 +00:00
Bill Wendling
d9f60f87d0 Formatting cleanups. No functionality change.
llvm-svn: 149312
2012-01-31 01:01:16 +00:00
Bill Wendling
92e817c1cc Remove no-longer-useful dyn_casts and pals.
llvm-svn: 149307
2012-01-31 00:56:53 +00:00
Bill Wendling
011d7b0f34 Add a constified getLandingPad() method.
llvm-svn: 149303
2012-01-31 00:26:24 +00:00
Kostya Serebryany
e5567f0fe4 [asan] fix the ObjC support (asan Issue #33)
llvm-svn: 149300
2012-01-30 23:50:10 +00:00
Chandler Carruth
865317627e Chris's constant data sequence refactoring actually enabled printing
vectors of all one bits to be printed more cleverly in the AsmPrinter.
Unfortunately, the byte value for all one bits is the same with
-fsigned-char as the error return of '-1'. Force this to be the unsigned
byte value when returning it to avoid this problem, and update the test
case for the shiny new behavior.

Yay for building LLVM and Clang with -funsigned-char.

Chris, please review, and let me know if there is any reason to not
desire this change. It seems good on the surface, and certainly intended
based on the code written.

llvm-svn: 149299
2012-01-30 23:47:44 +00:00
Evan Cheng
111c0844d5 PR11834: Use macros which are defined on Windows. Patch by Marina Yatsina.
llvm-svn: 149294
2012-01-30 23:10:32 +00:00
Devang Patel
be1817e3e0 Intel syntax. Adjust special code, used to recognize cmp<comparison code>{ss,sd,ps,pd}, for intel syntax.
llvm-svn: 149291
2012-01-30 22:47:12 +00:00
Chad Rosier
6e1866cd0a Typo.
llvm-svn: 149289
2012-01-30 22:44:13 +00:00
Chad Rosier
908361b6a5 Typo.
llvm-svn: 149275
2012-01-30 21:13:22 +00:00
David Greene
22e9ce48e0 Implement String Cast from Integer
Allow casts from integer to string.

llvm-svn: 149273
2012-01-30 20:47:04 +00:00
Devang Patel
a5bfdedb9f Intel syntax. Support .intel_syntax directive.
llvm-svn: 149270
2012-01-30 20:02:42 +00:00
Benjamin Kramer
0a88f2966a Fix refacto.
llvm-svn: 149269
2012-01-30 20:01:35 +00:00
Matt Beaumont-Gay
b94c5f7413 Here's a new one: GCC was complaining about an only-used-in-asserts
*function*. Wrap the function in #ifndef NDEBUG.

llvm-svn: 149259
2012-01-30 19:26:20 +00:00
Chris Lattner
b890ac010a Various improvements suggested by Duncan
llvm-svn: 149255
2012-01-30 18:19:30 +00:00
Douglas Gregor
9deae777e2 Eliminate narrowing conversion in initializer list, to make C++11 happy
llvm-svn: 149254
2012-01-30 16:57:18 +00:00
Benjamin Kramer
af9ce50196 X86: Simplify shuffle mask generation code.
llvm-svn: 149248
2012-01-30 15:16:21 +00:00
Alexander Potapenko
bc80f88393 Fix compilation of ASan tests on OS X Lion (see http://code.google.com/p/address-sanitizer/issues/detail?id=32)
The redzones emitted by AddressSanitizer for CFString instances confuse the linker and are of little use, so we shouldn't add them. 

llvm-svn: 149243
2012-01-30 10:40:22 +00:00
Craig Topper
9a8c6c1633 Fix pattern for memory form of PSHUFD for use with FP vectors to remove bitcast to an integer vector that normal code wouldn't have. Also remove bitcasts from code that turns splat vector loads into a shuffle as it was making the broken pattern necessary.
llvm-svn: 149232
2012-01-30 07:50:31 +00:00
Chris Lattner
4780154ab7 fix a major oversight that is breaking some llvm-test tests.
llvm-svn: 149230
2012-01-30 07:36:01 +00:00
Chris Lattner
e087cbc056 First step of flipping on ConstantDataSequential: enable ConstantDataVector
to be formed whenever ConstantVector::get is used.

llvm-svn: 149226
2012-01-30 06:21:21 +00:00
Chris Lattner
95a4f58d65 when verbose asm is on, print integers in ConstantDataSequentials just
like normal integers.

llvm-svn: 149223
2012-01-30 05:55:11 +00:00
Chris Lattner
7bce4c0fde don't lose tail padding on ConstantDataAggregate vec3's.
llvm-svn: 149222
2012-01-30 05:49:43 +00:00
Chris Lattner
aeafae8c79 Fix ConstantFoldShuffleVectorInstruction to properly handle the case
when the result type has a different # elements than the input vectors.

llvm-svn: 149221
2012-01-30 05:34:13 +00:00
Craig Topper
9aabdda961 Move some XOP patterns into instruction definition. Replae VPCMOV intrinsic patterns with custom lowering to a target specific nodes.
llvm-svn: 149216
2012-01-30 01:10:15 +00:00
Chris Lattner
d52c923a50 Add bitcode reader and writer support for ConstantDataAggregate, which
should be feature complete now.  Lets see if it works.

llvm-svn: 149215
2012-01-30 00:51:16 +00:00
Douglas Gregor
1b572cae6f Move Clang's file-level locking facility over to LLVM's support
library, since it doesn't really have anything to do with Clang.

llvm-svn: 149203
2012-01-29 20:15:10 +00:00
Anton Korobeynikov
8610339991 Cleanups for EABI standard functions
llvm-svn: 149195
2012-01-29 09:11:50 +00:00
Anton Korobeynikov
37494ab91a Use base AAPCS for varargs functions even for AAPCS-VFP CC
llvm-svn: 149194
2012-01-29 09:06:09 +00:00
Jakob Stoklund Olesen
6bf068351e Fix some scavenger performance issues.
- Don't call malloc+free in the very hot forward().
- Don't call isTiedToDefOperand().
- Don't create BitVector temporaries.
- Merge DeadRegs into KillRegs.
- Eliminate the early clobber checks, they were irrelevant to scavenging.
- Remove unnecessary code from -Asserts builds.

This speeds up ARM PEI by 3.4x and overall llc -O0 codegen time by 11%.

llvm-svn: 149189
2012-01-29 01:29:28 +00:00
Jakob Stoklund Olesen
cc16458309 Avoid creating BitVector temporaries.
llvm-svn: 149188
2012-01-29 01:29:25 +00:00
Nick Lewycky
8fba23af8b Fix typo.
llvm-svn: 149185
2012-01-28 23:33:44 +00:00
Bob Wilson
157561c941 Add a note about a potential optimization for clz/ctz patterns for ARM
(and other targets).

llvm-svn: 149182
2012-01-28 18:30:07 +00:00
James Molloy
b586b7c9c7 Ensure .AliasedSymbol() is called on all uses of getSymbol(). Affects ARM and MIPS ELF backends.
Fixes PR11877

llvm-svn: 149180
2012-01-28 15:58:32 +00:00
Benjamin Kramer
d10dc94cac Silence GCC's -Wreturn-type warning.
llvm-svn: 149179
2012-01-28 15:28:41 +00:00
Rafael Espindola
c74f450f77 Small improvement to the recursion detection logic from the previous commit.
llvm-svn: 149175
2012-01-28 06:22:14 +00:00
Rafael Espindola
82e15e4544 Handle recursive variable definitions directly. This gives us better error
messages and allows us to fix PR11865.

llvm-svn: 149174
2012-01-28 05:57:00 +00:00
Kostya Serebryany
0a789a0d8c [asan] correctly use ConstantExpr::getGetElementPtr. Catch by NAKAMURA Takumi
llvm-svn: 149172
2012-01-28 04:27:16 +00:00
Bill Wendling
062f06ea0a Reapply r149159 with a fix to add to a PHI node with a non-null parent.
llvm-svn: 149164
2012-01-28 01:17:56 +00:00
Lang Hames
064e6dfeca Remove code that adds live ranges for dead defs. It seems to be breaking things.
llvm-svn: 149163
2012-01-28 01:17:01 +00:00
Bill Wendling
8ef69f989c Revert r149159 until I can fix tests.
llvm-svn: 149162
2012-01-28 01:10:01 +00:00
Bill Wendling
16ac64c902 Don't always create a separate block for the call to _Unwind_Resume.
Sometimes there is only one 'resume' instruction per function. In those
situations, we don't need a separate block for the call to _Unwind_Resume. In
fact, it adds a lot of overhead to code-gen if we do that -- especially at -O0.
If we have a single 'resume' instruction, just generate the call within that
block.
<rdar://problem/10694814>

llvm-svn: 149159
2012-01-28 00:47:18 +00:00
David Greene
7748b4cf3b Fix Record Name Reference
Get the record name though the init to avoid an assert.

llvm-svn: 149153
2012-01-28 00:03:24 +00:00
Lang Hames
bbf83feb7f Silence warning about parens for && within ||
llvm-svn: 149152
2012-01-27 23:52:25 +00:00
Rafael Espindola
7bddde2b49 Add r149110 back with a fix for when the vector and the int have the same
width.

llvm-svn: 149151
2012-01-27 23:33:07 +00:00
Rafael Espindola
7800e62486 Revert r149110 and add a testcase that was crashing since that revision.
Unfortunately I also had to disable constant-pool-sharing.ll the code it tests has been
updated to use the IL logic.

llvm-svn: 149148
2012-01-27 22:42:48 +00:00
Lang Hames
e0f0352889 Add a "moveInstr" method to LiveIntervals. This can be used to move instructions
around within a basic block while maintaining live-intervals.

Updated ScheduleTopDownLive in MachineScheduler.cpp to use the moveInstr API
when reordering MIs.

llvm-svn: 149147
2012-01-27 22:36:19 +00:00
Lang Hames
b2a26bb835 Backing out ill-considered 'refactor'.
llvm-svn: 149146
2012-01-27 21:43:32 +00:00
Lang Hames
e66bae398d Move some duplicate loops in the coalescer into their own function.
llvm-svn: 149144
2012-01-27 19:58:14 +00:00
Devang Patel
e4725ba181 Intel Syntax: Parse mem operand with seg reg. QWORD PTR FS:[320]
llvm-svn: 149142
2012-01-27 19:48:28 +00:00
Craig Topper
9259da4826 Move some patterns back near their instructions and use AddedComplexity to fix priority. Merge some patterns into their instruction definition.
llvm-svn: 149122
2012-01-27 07:09:40 +00:00
Lang Hames
728d37bf16 Physreg dead defs should be handled too.
llvm-svn: 149118
2012-01-27 03:20:42 +00:00
Chris Lattner
bfb2b161d0 smallvectorize.
llvm-svn: 149117
2012-01-27 03:15:49 +00:00
Chris Lattner
466ff4b5f1 continue making the world safe for ConstantDataVector. At this point,
we should (theoretically optimize and codegen ConstantDataVector as well
as ConstantVector.

llvm-svn: 149116
2012-01-27 03:08:05 +00:00
Bill Wendling
8ac1e67396 Place the GEP instructions nearer to the instructions which use them.
GEP instructions are there for the compiler and shouldn't really output much
code (if any at all). When a GEP is stored in the entry block, Fast ISel (for
one) will not know that it could fold it into further uses. For instance, inside
of the EH handling code. This results in a lot of unnecessary spills and loads
which bloat code and slows down pretty much everything.
<rdar://problem/10694814>

llvm-svn: 149114
2012-01-27 02:02:24 +00:00
Chris Lattner
52e0244bed make sure the file's matching header is #include'd first.
llvm-svn: 149113
2012-01-27 01:47:28 +00:00
Chris Lattner
67b57ec4e3 Rewrite CanShareConstantPoolEntry to be implemented in terms of the
mid-level constant folding APIs instead of doing its own analysis.
This makes it more general (e.g. can now share a <2 x i64> with a
<4 x i32>) and avoid duplicating a bunch of logic.

llvm-svn: 149111
2012-01-27 01:46:00 +00:00
Chris Lattner
929f66cdfa enhance constant folding to be able to constant fold bitcast of
ConstantVector's to integer type.

llvm-svn: 149110
2012-01-27 01:44:03 +00:00
Jim Grosbach
e6ac20aadf Keep source location information for X86 MCFixup's.
llvm-svn: 149106
2012-01-27 00:51:27 +00:00
Jim Grosbach
4492fd6b9f Source information in 'expected relocatable expression' diagnostic.
llvm-svn: 149105
2012-01-27 00:51:23 +00:00
Jim Grosbach
ef5d3dc085 Better user diagnostics for more ARM MachO relocation errors.
llvm-svn: 149102
2012-01-27 00:37:12 +00:00
Jim Grosbach
6280a1137f Better diagnostic for malformed .org assembly directive.
Provide source line number information.

llvm-svn: 149101
2012-01-27 00:37:08 +00:00
Lang Hames
5b641086b2 Rewrite instruction operands in AdjustCopiesBackFrom. Fixes PR11861.
llvm-svn: 149097
2012-01-27 00:05:42 +00:00
Jim Grosbach
2bc9a9f339 Tidy up.
llvm-svn: 149096
2012-01-26 23:47:45 +00:00
Jim Grosbach
44913df963 Keep source information, if available, around for ARM Fixups.
Adjust an example MachObjectWriter diagnostic to use the information
to issue a better message.

Before:
LLVM ERROR: unknown ARM fixup kind!

After:
x.s:6:5: error: unsupported relocation on symbol
    beq bar
    ^

rdar://9800182

llvm-svn: 149093
2012-01-26 23:20:15 +00:00
Jim Grosbach
a3c09652c6 Add simple support for keeping MCFixup source information.
Can be used to issue more user friendly diagnostics for faulty
relocation constructs and such.

llvm-svn: 149092
2012-01-26 23:20:11 +00:00
Jim Grosbach
fbf782200a Add SourceMgr to MCContext for backend diagnostics.
llvm-svn: 149090
2012-01-26 23:20:05 +00:00