Commit Graph

52988 Commits

Author SHA1 Message Date
Jakob Stoklund Olesen 17402e3d5a Handle register masks in local live range splitting.
Again the goal is to produce identical assembly with register mask
operands enabled.

llvm-svn: 150287
2012-02-11 00:42:18 +00:00
Jakob Stoklund Olesen c8046c02c2 Don't read PreRegAlloc before it is initialized.
llvm-svn: 150286
2012-02-11 00:40:36 +00:00
Jim Grosbach 1c9dd2974f Revert r150222, as the clang driver now handles this properly.
Now that the clang driver passes the CPU and feature information to
the backend when processing assembly files (150273), this isn't necessary.

llvm-svn: 150274
2012-02-10 20:38:46 +00:00
Jakob Stoklund Olesen 024d7ae110 Add a static MachineOperand::clobbersPhysReg().
It can be necessary to detach a register mask pointer from its
MachineOperand. This method is convenient for checking clobbered
physregs on a detached bitmask pointer.

llvm-svn: 150261
2012-02-10 19:23:53 +00:00
Jakob Stoklund Olesen a16ae59722 Add register mask support to InterferenceCache.
This makes global live range splitting behave identically with and
without register mask operands.

This is not necessarily the best way of using register masks for live
range splitting.  It would be more efficient to first split global live
ranges around calls (i.e., register masks), and reserve the fine grained
per-physreg interference guidance for global live ranges that do not
cross calls.

For now the goal is to produce identical assembly when enabling register
masks.

llvm-svn: 150259
2012-02-10 18:58:34 +00:00
Jakob Stoklund Olesen b7c1715df1 Remove unused variable.
llvm-svn: 150258
2012-02-10 18:52:15 +00:00
Jason W Kim c7f4841769 Make valgrind happy.
llvm-svn: 150251
2012-02-10 16:07:59 +00:00
Hal Finkel 1bde3f86d1 Update BBVectorize to use aliasesUnknownInst.
This allows BBVectorize to check the "unknown instruction" list in the
alias sets. This is important to prevent instruction fusing from reordering
function calls. Resolves PR11920.

llvm-svn: 150250
2012-02-10 15:52:40 +00:00
Hal Finkel 56f6b0f219 Have AliasSet::aliasesUnknownInst use pointer TBAA info when available
llvm-svn: 150249
2012-02-10 15:52:39 +00:00
Duncan Sands 26641d7c02 Fix PR11948: the result type of an icmp may be a vector of boolean -
don't assume it is a boolean.

llvm-svn: 150247
2012-02-10 14:31:24 +00:00
Benjamin Kramer bf152d57a4 Put instruction names into an indexed string table on the side, removing a pointer from MCInstrDesc.
Make them accessible through MCInstrInfo. They are only used for debugging purposes so this doesn't
have an impact on performance. X86MCTargetDesc.o goes from 630K to 461K on x86_64.

llvm-svn: 150245
2012-02-10 13:18:44 +00:00
Andrew Trick 09fc1bb605 comment grammar
llvm-svn: 150233
2012-02-10 07:08:25 +00:00
Andrew Trick f08915ca8e unnecessary include
llvm-svn: 150228
2012-02-10 04:10:44 +00:00
Andrew Trick f4ff234384 PTX no longer needs to provide its own backend.
llvm-svn: 150227
2012-02-10 04:10:40 +00:00
Andrew Trick d3f8fe81f4 RegAlloc superpass: includes phi elimination, coalescing, and scheduling.
Creates a configurable regalloc pipeline.

Ensure specific llc options do what they say and nothing more: -reglloc=... has no effect other than selecting the allocator pass itself. This patch introduces a new umbrella flag, "-optimize-regalloc", to enable/disable the optimizing regalloc "superpass". This allows for example testing coalscing and scheduling under -O0 or vice-versa.

When a CodeGen pass requires the MachineFunction to have a particular property, we need to explicitly define that property so it can be directly queried rather than naming a specific Pass. For example, to check for SSA, use MRI->isSSA, not addRequired<PHIElimination>.

CodeGen transformation passes are never "required" as an analysis

ProcessImplicitDefs does not require LiveVariables.

We have a plan to massively simplify some of the early passes within the regalloc superpass.

llvm-svn: 150226
2012-02-10 04:10:36 +00:00
Andrew Trick 9363b597e3 whitespace
llvm-svn: 150225
2012-02-10 04:10:26 +00:00
Lang Hames 351fc56ab0 Remove unused 'isAlias' parameter.
llvm-svn: 150224
2012-02-10 03:19:36 +00:00
Jim Grosbach ffc02c5ffc ARM on darwin, v6 implies the presence of VFP for the assembler.
rdar://10838899

llvm-svn: 150222
2012-02-10 02:21:49 +00:00
Jakob Stoklund Olesen 9ef50bd66c Constrain the regmask search space for local live ranges.
When checking a local live range for interference, restrict the binary
search to the single block.

llvm-svn: 150220
2012-02-10 01:31:31 +00:00
Jakob Stoklund Olesen 25c4195ecc Cache basic block boundaries for faster RegMaskSlots access.
Provide API to get a list of register mask slots and bits in a basic
block.

llvm-svn: 150219
2012-02-10 01:26:29 +00:00
Jakob Stoklund Olesen aa06de2447 Optimize LiveIntervals::intervalIsInOneMBB().
No looping and binary searches necessary.

Return a pointer to the containing block instead of just a bool.

llvm-svn: 150218
2012-02-10 01:23:55 +00:00
Benjamin Kramer baa41d4175 Cache iterators. Some of these are expensive to create.
llvm-svn: 150214
2012-02-10 00:28:31 +00:00
David Blaikie 18544b9614 Change default error_code ctor to a 'named ctor' so it's more self-documenting.
Unify default construction of error_code uses on this idiom so that users don't
feel compelled to make static globals for naming convenience. (unfortunately I
couldn't make the original ctor private as some APIs don't return their result,
instead using an out parameter (that makes sense to default construct) - which
is a bit of a pity. I did, however, find/fix some cases of unnecessary default
construction of error_code before I hit the unfixable cases)

llvm-svn: 150197
2012-02-09 19:24:12 +00:00
Jakob Stoklund Olesen 4a6a0eec52 Add register mask support to RAGreedy.
This only adds the interference checks required for correctness.
We still need to take advantage of register masks for the
interference driven live range splitting.

llvm-svn: 150191
2012-02-09 18:25:05 +00:00
Benjamin Kramer 1a4695a091 Tweak comment readability and grammar.
llvm-svn: 150183
2012-02-09 16:28:15 +00:00
Sirish Pande 545983ea46 Test for commit access.
llvm-svn: 150178
2012-02-09 15:20:33 +00:00
Benjamin Kramer 487a3962c7 GlobalOpt: Be more aggressive about elminating side-effect free static dtors.
GlobalOpt runs early in the pipeline (before inlining) and complex class
hierarchies often introduce bitcasts or GEPs which weren't optimized away.
Teach it to ignore side-effect free instructions instead of depending on
other passes to remove them.

llvm-svn: 150174
2012-02-09 14:26:06 +00:00
James Molloy d9ba4fd48f Teach the MC and disassembler about SoftFail, and hook it up to UNPREDICTABLE on ARM. Wire this to tBLX in order to provide test coverage.
llvm-svn: 150169
2012-02-09 10:56:31 +00:00
Craig Topper a0cd970b81 More tweaks to get the size of the X86 disassembler tables down.
llvm-svn: 150167
2012-02-09 08:58:07 +00:00
Craig Topper 487e744f66 Flatten some of the arrays in the X86 disassembler tables to reduce space needed to store pointers on 64-bit hosts and reduce relocations needed at startup. Part of PR11953.
llvm-svn: 150161
2012-02-09 07:45:30 +00:00
Lang Hames edeea175ad Preserve physreg kills in MachineBasicBlock::SplitCriticalEdge.
Failure to preserve kills was causing LiveIntervals to miss some EFLAGS live
ranges. Unfortunately I've been unable to reduce a good test case yet.

llvm-svn: 150152
2012-02-09 05:59:36 +00:00
Lang Hames 2176edf1c4 Fix kill flags when moving instructions using LiveIntervals::moveInstr(...).
llvm-svn: 150150
2012-02-09 04:45:38 +00:00
Lang Hames 95d6edeba8 Remove assertion. Not all use operands are reads.
llvm-svn: 150149
2012-02-09 04:39:48 +00:00
Andrew Trick f542675ae3 Improve TargetPassConfig. No intended functionality.
Split CodeGen into stages.
Distinguish between optimization and correctness.

llvm-svn: 150122
2012-02-09 00:40:55 +00:00
Andrew Trick c24e09b226 comment
llvm-svn: 150121
2012-02-09 00:40:52 +00:00
David Blaikie e7d7a5dfaa Remove static initializer from DataStream.cpp
If someone would prefer a clear name for the 'success' error_value we could
come up with one - potentially just a 'named constructor' style
'error_value::success()' to make this expression more self-documenting. If
I see this come up in other cases I'll certainly consider it.

One step along the way to resolving PR11944.

llvm-svn: 150120
2012-02-09 00:29:19 +00:00
Jakob Stoklund Olesen 938b4d26f1 Erase dead copies that are clobbered by a call.
This does make a difference, at least when using RABasic.

llvm-svn: 150118
2012-02-09 00:19:08 +00:00
Jakob Stoklund Olesen 4519fd0b21 Handle register masks when searching for EFLAGS clobbers.
Calls clobber the flags, but when using register masks there is no
EFLAGS<imp-def> operand.

llvm-svn: 150117
2012-02-09 00:17:22 +00:00
Jakob Stoklund Olesen 5d33291e8e Never delete instructions that define reserved registers.
I think this was already the intention, but DeadMachineInstructionElim
was accidentally tracking the liveness of reserved registers. Now,
instructions with reserved defs are never deleted.

This prevents the call stack adjustment instructions from getting
deleted when enabling register masks.

llvm-svn: 150116
2012-02-09 00:15:39 +00:00
Jakob Stoklund Olesen 8610a59de1 Handle register masks in MachineCopyPropagation.
For simplicity, treat calls with register masks as basic block
boundaries.  This means we can't copy propagate callee-saved registers
across calls, but I don't think that is a big deal.

llvm-svn: 150108
2012-02-08 22:37:35 +00:00
Kostya Serebryany 154a54d972 [asan] unpoison the stack before every noreturn call. Fixes asan issue 37. llvm part
llvm-svn: 150102
2012-02-08 21:36:17 +00:00
Andrew Trick 1fa5bcbe2a Codegen pass definition cleanup. No functionality.
Moving toward a uniform style of pass definition to allow easier target configuration.
Globally declare Pass ID.
Globally declare pass initializer.
Use INITIALIZE_PASS consistently.
Add a call to the initializer from CodeGen.cpp.
Remove redundant "createPass" functions and "getPassName" methods.

While cleaning up declarations, cleaned up comments (sorry for large diff).

llvm-svn: 150100
2012-02-08 21:23:13 +00:00
Andrew Trick c40815de62 Move pass configuration out of pass constructors: MachineLICM.
llvm-svn: 150099
2012-02-08 21:23:03 +00:00
Andrew Trick 5209c739cd whitespace
llvm-svn: 150098
2012-02-08 21:23:00 +00:00
Andrew Trick 3ed444a16a Move pass configuration out of pass constructors: StackSlotColoring.
llvm-svn: 150097
2012-02-08 21:22:57 +00:00
Andrew Trick df7e3769b5 Move pass configuration out of pass constructors: PostRAScheduler.
llvm-svn: 150096
2012-02-08 21:22:53 +00:00
Andrew Trick 58648e4e98 Move pass configuration out of pass constructors: BranchFolderPass
llvm-svn: 150095
2012-02-08 21:22:48 +00:00
Andrew Trick 9e761997d8 whitespace
llvm-svn: 150094
2012-02-08 21:22:43 +00:00
Andrew Trick dd37d52f95 Added TargetPassConfig::setOpt
llvm-svn: 150093
2012-02-08 21:22:39 +00:00
Andrew Trick 3a61b7862b Added Pass::createPass(ID) to handle pass configuration by ID
llvm-svn: 150092
2012-02-08 21:22:34 +00:00
Andrew Trick c044917a8a Move pass configuration out of pass constructors: TailDuplicate::PreRegAlloc
llvm-svn: 150091
2012-02-08 21:22:30 +00:00
Jakob Stoklund Olesen 0c1eea2922 Add Register mask support to RABasic.
When a virtual register is live across a call, limit the search space to
call-preserved registers.

llvm-svn: 150081
2012-02-08 18:54:35 +00:00
Brendon Cahoon 6f35837048 Use TSFlag bit to describe instruction properties.
Creating the isPredicated TSFlag enables the code
to use the property defined in the instruction format
instead of using a large switch statement.

llvm-svn: 150078
2012-02-08 18:25:47 +00:00
Jakob Stoklund Olesen 3ff74d8e62 Keep track of register masks in LiveIntervalAnalysis.
Build an ordered vector of register mask operands (i.e., calls) when
computing live intervals. Provide a checkRegMaskInterference() function
that computes a bit mask of usable registers for a live range.

This is a quick way of determining of a live range crosses any calls,
and restricting it to the callee saved registers if it does.
Previously, we had to discover call clobbers for each candidate register
independently.

llvm-svn: 150077
2012-02-08 17:33:45 +00:00
Duncan Sands 0920308a7e Use Use::set rather than finding the operand number of the use
and setting that.

llvm-svn: 150074
2012-02-08 14:10:53 +00:00
Benjamin Kramer 5e4f0a4a31 PathV2: Remove static StringRef ctors.
llvm-svn: 150071
2012-02-08 13:13:47 +00:00
Elena Demikhovsky 1adc1d53dd Fixed a bug in printing "cmp" pseudo ops.
> This IR code
> %res = call <8 x float> @llvm.x86.avx.cmp.ps.256(<8 x float> %a0, <8 x float> %a1, i8 14)
> fails with assertion:
>
> llc: X86ATTInstPrinter.cpp:62: void llvm::X86ATTInstPrinter::printSSECC(const llvm::MCInst*, unsigned int, llvm::raw_ostream&): Assertion `0 && "Invalid ssecc argument!"' failed.
> 0  llc             0x0000000001355803
> 1  llc             0x0000000001355dc9
> 2  libpthread.so.0 0x00007f79a30575d0
> 3  libc.so.6       0x00007f79a23a1945 gsignal + 53
> 4  libc.so.6       0x00007f79a23a2f21 abort + 385
> 5  libc.so.6       0x00007f79a239a810 __assert_fail + 240
> 6  llc             0x00000000011858d5 llvm::X86ATTInstPrinter::printSSECC(llvm::MCInst const*, unsigned int, llvm::raw_ostream&) + 119

I added the full testing for all possible pseudo-ops of cmp.
I extended X86AsmPrinter.cpp and X86IntelInstPrinter.cpp.

You'l also see lines alignments (unrelated to this fix) in X86IselLowering.cpp from my previous check-in.

llvm-svn: 150068
2012-02-08 08:37:26 +00:00
Craig Topper 172b9243cd Remove a couple unneeded intrinsic patterns
llvm-svn: 150067
2012-02-08 08:29:30 +00:00
Craig Topper 5405571fe0 Remove GCC builtins for vpermilp* intrinsics as clang no longer needs them. Custom lower the intrinsics to the vpermilp target specific node and remove intrinsic patterns.
llvm-svn: 150060
2012-02-08 06:36:57 +00:00
Chad Rosier 0ee8c513f7 [fast-isel] Add support for SUBs with non-legal types.
llvm-svn: 150047
2012-02-08 02:45:44 +00:00
Chad Rosier bd471255a9 [fast-isel] Add support for ORs with non-legal types.
llvm-svn: 150045
2012-02-08 02:29:21 +00:00
Andrew Trick 3bc0e0c651 Added MachineInstr::isBundled() to check if an instruction is part of a bundle.
llvm-svn: 150044
2012-02-08 02:17:25 +00:00
Andrew Trick e57583ab19 misched: bug in debug output.
llvm-svn: 150043
2012-02-08 02:17:21 +00:00
Andrew Trick de9f8979c4 stale comment
llvm-svn: 150041
2012-02-08 02:17:16 +00:00
Eric Christopher ae56eecf5f Add support for a temporary forward decl type. We want this so we
can rauw forward declarations if we decide to emit the full type.

Part of rdar://10809898

llvm-svn: 150024
2012-02-08 00:22:26 +00:00
Devang Patel a93cc25b79 Remove tabs.
llvm-svn: 150022
2012-02-08 00:17:07 +00:00
Chad Rosier ded4c99f2e [fast-isel] Add support for indirect branches.
llvm-svn: 150014
2012-02-07 23:56:08 +00:00
Devang Patel d925d1a8d7 Remove tabs.
llvm-svn: 150012
2012-02-07 23:33:58 +00:00
Evan Cheng 1b81fddd65 Use LEA to adjust stack ptr for Atom. Patch by Andy Zhang.
llvm-svn: 150008
2012-02-07 22:50:41 +00:00
David Blaikie 0210e97680 Correct use of const in ParseCommandLineOptions
llvm-svn: 149999
2012-02-07 19:36:01 +00:00
Evan Cheng 45d8f8a08c Do not fold ADD / SUB into load / store (to form pre-indexed, post-indexed
load / store) if the ADD / SUB has a live definition of CPSR.

Bug reported by David Meyer. Alas, no test case.

llvm-svn: 149970
2012-02-07 07:09:28 +00:00
Craig Topper b27fd77c3f Add instruction selection for 256-bit VPSHUFD and 128-bit VPERMILPS/VPERMILPD.
llvm-svn: 149968
2012-02-07 06:28:42 +00:00
Craig Topper a2886c21d9 Convert assert(0) to llvm_unreachable
llvm-svn: 149967
2012-02-07 05:05:23 +00:00
Craig Topper e55c556a24 Convert assert(0) to llvm_unreachable
llvm-svn: 149961
2012-02-07 02:50:20 +00:00
Bill Wendling c15a364cbf Cache the sizes of vectors instead of calculating them all over the place.
llvm-svn: 149954
2012-02-07 01:48:12 +00:00
Bill Wendling 3ae7dd377d Reserve space in these vectors to prevent having to grow the array too
much. This gets us an addition 0.9% on 445.gobmk.

llvm-svn: 149952
2012-02-07 01:27:51 +00:00
Derek Schuff 76b292f5ba Fix win32 build breakage from bitcode streaming patch
llvm-svn: 149941
2012-02-07 00:28:46 +00:00
Chad Rosier 685b20c114 [fast-isel] Add support for ADDs with non-legal types.
llvm-svn: 149934
2012-02-06 23:50:07 +00:00
Andrew Trick 8e7b34c7fc Expose TargetPassConfig to PEI Pass
llvm-svn: 149927
2012-02-06 22:51:18 +00:00
Andrew Trick 34914910f5 Add TargetPassConfig to the PassManager for use inside passes
llvm-svn: 149926
2012-02-06 22:51:15 +00:00
Kostya Serebryany 9e0d377400 The patch resolves the conflict between AddressSanitizer and load widening (GVN).
The problem initially reported by Mozilla folks (http://code.google.com/p/address-sanitizer/issues/detail?id=20),
but it also prevents us from enabling LLVM bootstrap with AddressSanitizer.

llvm-svn: 149925
2012-02-06 22:48:56 +00:00
Nick Lewycky 998bce0366 Fix comment-rulers.
llvm-svn: 149922
2012-02-06 22:41:47 +00:00
Jakob Stoklund Olesen 537444ca37 Don't explicitly renumber slot indices.
We have automatic local renumbering now.

llvm-svn: 149920
2012-02-06 22:37:56 +00:00
Derek Schuff 8b2dcad4b5 Enable streaming of bitcode
This CL delays reading of function bodies from initial parse until
materialization, allowing overlap of compilation with bitcode download.

llvm-svn: 149918
2012-02-06 22:30:29 +00:00
Chris Lattner 8213c8af29 Remove some dead code and tidy things up now that vectors use ConstantDataVector
instead of always using ConstantVector.

llvm-svn: 149912
2012-02-06 21:56:39 +00:00
Jakob Stoklund Olesen c805369fdc Make sure a reserved register has a live interval before merging.
llvm-svn: 149910
2012-02-06 21:52:18 +00:00
Bill Wendling 0aef16afd5 [unwind removal] Remove all of the code for the dead 'unwind' instruction. There
were no 'unwind' instructions being generated before this, so this is in effect
a no-op.

llvm-svn: 149906
2012-02-06 21:44:22 +00:00
Bill Wendling 7c49a0e9e3 [unwind removal] Don't write out the dead 'unwind' instruction.
llvm-svn: 149905
2012-02-06 21:30:37 +00:00
Bill Wendling d5d95b0b51 [unwind removal] We no longer have 'unwind' instructions being generated, so
remove the code that handles them.

llvm-svn: 149901
2012-02-06 21:16:41 +00:00
Bill Wendling 1fc2eac062 'unwind' is a keyword, not an instruction.
llvm-svn: 149898
2012-02-06 21:02:43 +00:00
Bill Wendling b7d8f21acd [unwind removal] Remove the 'unwind' instruction parsing bits.
llvm-svn: 149897
2012-02-06 20:50:27 +00:00
Chandler Carruth 07cfb4b696 Introduce helpers to compute the 32-bit varaints and 64-bit variants of
some architectures. These are useful for interacting with multiarch or
bi-arch GCC (or GCC-based) toolchains.

llvm-svn: 149895
2012-02-06 20:46:33 +00:00
Derek Schuff 206dddda15 Test commit; also removes some trailing whitespace
llvm-svn: 149887
2012-02-06 19:03:04 +00:00
Devang Patel 4488217f73 DebugInfo: Provide a new hook to encode relationship between a property and an ivar.
llvm-svn: 149874
2012-02-06 17:49:43 +00:00
Benjamin Kramer 2496717052 X86: Don't call malloc for 4 bits. No functionality change.
llvm-svn: 149866
2012-02-06 12:06:18 +00:00
Benjamin Kramer baba1aa001 Make helper static.
llvm-svn: 149865
2012-02-06 11:28:19 +00:00
Benjamin Kramer ae87d7b4b2 Hexagon: Remove forbidden iostream includes (it introduces static initializers)
Reorder includes while at it.

llvm-svn: 149863
2012-02-06 10:19:29 +00:00
Nick Lewycky 239fdf0f61 Split part of EvaluateFunction into a new EvaluateBlock method. No functionality
change.

llvm-svn: 149861
2012-02-06 08:24:44 +00:00
Craig Topper accd351e56 Move some llvm_unreachable's from r149849 out of switch statements to satisfy -Wcovered-switch-default
llvm-svn: 149860
2012-02-06 08:17:43 +00:00
Craig Topper 1f71057747 Add shuffle decoding support for 256-bit pshufd. Merge vpermilp* and pshufd decoding.
llvm-svn: 149859
2012-02-06 07:17:51 +00:00
Sebastian Pop 662beed828 fix indentation
llvm-svn: 149857
2012-02-06 05:29:32 +00:00
Sebastian Pop bbb8eb58f9 fix typo
llvm-svn: 149856
2012-02-06 05:29:29 +00:00
Craig Topper c514b5474a Convert assert(0) to llvm_unreachable
llvm-svn: 149849
2012-02-05 22:14:15 +00:00
Talin 46e9b441f0 Efficient Constant Uniquing.
llvm-svn: 149848
2012-02-05 20:54:10 +00:00
Nick Lewycky 52da72b12a Teach GlobalOpt to handle atomic accesses to globals.
* Most of the transforms come through intact by having each transformed load or
store copy the ordering and synchronization scope of the original.
 * The transform that turns a global only accessed in main() into an alloca
(since main is non-recursive) with a store of the initial value uses an
unordered store, since it's guaranteed to be the first thing to happen in main.
(Threads may have started before main (!) but they can't have the address of a
function local before the point in the entry block we insert our code.)
 * The heap-SRoA transforms are disabled in the face of atomic operations. This
can probably be improved; it seems odd to have atomic accesses to an alloca
that doesn't have its address taken.

AnalyzeGlobal keeps track of the strongest ordering found in any use of the
global. This is more information than we need right now, but it's cheap to
compute and likely to be useful.

llvm-svn: 149847
2012-02-05 19:56:38 +00:00
Evan Cheng 613d6d3b43 DefinesPredicate should only look for def operands. Patch by Ludwig Meier.
llvm-svn: 149846
2012-02-05 19:55:04 +00:00
Nick Lewycky bbd1156b95 Clean up some whitespace and comments. No functionality change.
llvm-svn: 149845
2012-02-05 19:48:37 +00:00
Duncan Sands 9066fb5c43 Neaten up this method. Check that if there is only one
predecessor then it's Src.

llvm-svn: 149843
2012-02-05 19:43:37 +00:00
Duncan Sands 994c1103c8 Remove dead test: this was already checked and handled a few lines
above.

llvm-svn: 149841
2012-02-05 19:30:06 +00:00
Duncan Sands 12efb16b01 Fix a thinko pointed out by Eli and the buildbots.
llvm-svn: 149839
2012-02-05 18:56:50 +00:00
Duncan Sands 4b613497f0 Reduce the number of dom queries made by GVN's conditional propagation
logic by half: isOnlyReachableViaThisEdge was trying to be clever and
handle the case of a branch to a basic block which is contained in a
loop.  This costs a domtree lookup and is completely useless due to
GVN's position in the pass pipeline: all loops have preheaders at this
point, which means it is enough for isOnlyReachableViaThisEdge to check
that Dst has only one predecessor.  (I checked this theoretical argument
by running over the entire nightly testsuite, and indeed it is so!).

llvm-svn: 149838
2012-02-05 18:25:50 +00:00
Duncan Sands 268903955c Reduce the number of non-trivial domtree queries by about 1% when
compiling sqlite3, by only doing dom queries after the cheap check
rather than interleaved with it.

llvm-svn: 149836
2012-02-05 15:50:43 +00:00
Duncan Sands ae22c60f90 Persuade GCC that there is nothing worth warning about here (there isn't).
llvm-svn: 149834
2012-02-05 14:20:11 +00:00
Duncan Sands efabc2572f Don't initialize CV in terms of itself! Spotted by GCC.
llvm-svn: 149833
2012-02-05 14:16:09 +00:00
Duncan Sands bc3f4730c5 Explain to the compiler why TargetAddr is not used uninitialized later.
llvm-svn: 149832
2012-02-05 14:14:35 +00:00
Nadav Rotem 4f4546b73a Add additional documentation to the extract-and-trunc dagcombine optimization.
llvm-svn: 149823
2012-02-05 11:39:23 +00:00
Craig Topper ee4dab5f1f Convert assert(0) to llvm_unreachable
llvm-svn: 149816
2012-02-05 08:31:47 +00:00
Chandler Carruth ebd90c58e6 Begin fleshing out more convenience predicates in llvm::Triple and
convert at least one client over to use them. Subsequent patches both to
LLVM and Clang will try to convert more people over to a common set of
predicates.

This round of predicates is focused on OS-categorization predicates.

llvm-svn: 149815
2012-02-05 08:26:40 +00:00
Craig Topper c4965bce14 Convert assert(0) to llvm_unreachable
llvm-svn: 149814
2012-02-05 07:21:30 +00:00
David Blaikie f9c1291fde Simplify contains tests using 'count'.
llvm-svn: 149813
2012-02-05 06:35:36 +00:00
NAKAMURA Takumi 32c48634db BBVectorize.cpp: Get rid of comparision to bool to fix a warning.
llvm-svn: 149810
2012-02-05 05:47:51 +00:00
Craig Topper 4ed7278ff4 Convert assert(0) to llvm_unreachable in X86 Target directory.
llvm-svn: 149809
2012-02-05 05:38:58 +00:00
Craig Topper 83f3bdaa45 Convert some assert(0) in default of switch statements to llvm_unreachable.
llvm-svn: 149808
2012-02-05 03:43:23 +00:00
Craig Topper 1d471e31ba Add target specific node for PMULUDQ. Change patterns to use it and custom lower intrinsics to it. Use it instead of intrinsic to handle 64-bit vector multiplies.
llvm-svn: 149807
2012-02-05 03:14:49 +00:00
Chris Lattner bb8278a10a Improve the bitcode reader's handling of constant strings to use
ConstantDataArray::getString direction, instead of "boxing" each
byte into a ConstantInt and using ConstantArray::get.

llvm-svn: 149805
2012-02-05 02:41:35 +00:00
Chris Lattner cf9e8f6968 reapply the patches reverted in r149470 that reenable ConstantDataArray,
but with a critical fix to the SelectionDAG code that optimizes copies
from strings into immediate stores: the previous code was stopping reading
string data at the first nul.  Address this by adding a new argument to
llvm::getConstantStringInfo, preserving the behavior before the patch.

llvm-svn: 149800
2012-02-05 02:29:43 +00:00
Craig Topper 4daa67483d Remove most of the intrinsics for XOP VPCMOV instruction. They all aliased to the same instruction with different types. This would be better accomplished with casts in the not yet created xopintrin.h header file.
llvm-svn: 149795
2012-02-05 00:55:56 +00:00
Sean Callanan bdce3885c4 Modified the Enhanced Disassembler to create and
cache disassemblers according to the string value
of the target triple, not according to the enum
of the triple CPU.  The reason for this is that
certain attributes of the instruction set are not
reflected in the enum, but only in the string.

llvm-svn: 149773
2012-02-04 07:45:35 +00:00
Jakob Stoklund Olesen abb26bae4e Drop the REDEF_BY_EC VNInfo flag.
A live range that has an early clobber tied redef now looks like a
normal tied redef, except the early clobber def uses the early clobber
slot.

This is enough to handle any strange interference problems.

llvm-svn: 149769
2012-02-04 05:51:25 +00:00
Jakob Stoklund Olesen e386578121 Correctly terminate a physreg redefined by an early clobber.
I don't have a test that fails because of this, but a test case like
CodeGen/X86/2009-12-01-EarlyClobberBug.ll exposes the problem.  EAX is
redefined by a tied early clobber operand on inline asm, and the live
range should look like this:

  %EAX,inf = [48r,64e:0)[64e,80r:1)  0@48r 1@64e

Previously, the two values got merged:

  %EAX,inf = [48r,80r:0)  0@48r

With this bug fixed, the REDEF_BY_EC VNInfo flag is no longer needed.

llvm-svn: 149768
2012-02-04 05:41:20 +00:00
Nick Lewycky 6024f9b5be Fix a leak!
Andy, in a previous commit you made this into an ImmutablePass so that you could
add it to the PassManager, then in the next commit you left it a Pass but
removed the code that added it to the PM. If you do add it to the PM then the PM
should take care of deleting it, but it's also true that nothing in codegen
needs this object to exist after it's done its work here. It's not clear to me
which design you want; this should likely either cease to be a Pass or be added
to the PM where other parts of CodeGen will request it.

llvm-svn: 149765
2012-02-04 05:26:17 +00:00
Jakob Stoklund Olesen ad6b22eb16 Don't store COPY pointers in VNInfo.
If a value is defined by a COPY, that instuction can easily and cheaply
be found by getInstructionFromIndex(VNI->def).

This reduces the size of VNInfo from 24 to 16 bytes, and improves
llc compile time by 3%.

llvm-svn: 149763
2012-02-04 05:20:49 +00:00
Hal Finkel 135cac922c Boost the effective chain depth of loads and stores.
By default, boost the chain depth contribution of loads and stores. This will allow a load/store pair to vectorize even when it would not otherwise be long enough to satisfy the chain depth requirement.

llvm-svn: 149761
2012-02-04 04:14:04 +00:00
Qirun Zhang e788fac623 remove the blank line from previous ci.
llvm-svn: 149758
2012-02-04 03:18:47 +00:00
Qirun Zhang dabce3f4e9 test commit.
add a blank line.

llvm-svn: 149757
2012-02-04 03:15:26 +00:00
Andrew Trick f8ea108c05 TargetPassConfig: confine the MC configuration to TargetMachine.
Passes prior to instructon selection are now split into separate configurable stages.
Header dependencies are simplified.
The bulk of this diff is simply removal of the silly DisableVerify flags.

Sorry for the target header churn. Attempting to stabilize them.

llvm-svn: 149754
2012-02-04 02:56:59 +00:00
Andrew Trick de401d3c29 Move TargetPassConfig implementation into Passes.cpp
llvm-svn: 149753
2012-02-04 02:56:48 +00:00
Andrew Trick b755133686 Make TargetPassConfig an ImmutablePass so CodeGenPasses can query options
llvm-svn: 149752
2012-02-04 02:56:45 +00:00
Dylan Noblesmith 1d966ae18e Object: avoid undefined behavior when bounds-checking
Don't form an out of bounds pointer just to test if it
would be out of bounds.

Also perform the same bounds checking for all the previous
mapped structures.

llvm-svn: 149750
2012-02-04 02:41:39 +00:00
Devang Patel 403e819731 Emit new property tag.
llvm-svn: 149737
2012-02-04 01:30:32 +00:00
Devang Patel 02bd82be36 Update llvm debug version to support new structure and tag for Objective-C property's debug info.
llvm-svn: 149736
2012-02-04 01:30:01 +00:00
Devang Patel cc481596e4 Introduce DIObjCProperty. This will be used to encode objective-c property.
llvm-svn: 149732
2012-02-04 00:59:25 +00:00
Chad Rosier 6d68c7cf79 [fast-isel] HandlePHINodesInSuccessorBlocks() can promite i8 and i16 types too.
llvm-svn: 149730
2012-02-04 00:39:19 +00:00
Devang Patel 839515b64d Add new tag and an attribute to support debug info for objective-c property.
llvm-svn: 149724
2012-02-03 23:57:08 +00:00
Jakob Stoklund Olesen 22e490d908 Trim headers.
llvm-svn: 149722
2012-02-03 23:51:15 +00:00
Jakob Stoklund Olesen f798a0a0e6 Delete some dead code.
llvm-svn: 149717
2012-02-03 21:32:06 +00:00
Chad Rosier b84a4b4c64 [fast-isel] Add support for URem.
llvm-svn: 149716
2012-02-03 21:23:45 +00:00
Jakob Stoklund Olesen 56fe2ed51e Handle register mask operands in setPhysRegsDeadExcept().
Calls that use register mask operands don't have implicit defs for
returned values.  The register mask operand handles the call clobber,
but it always behaves like a set of dead defs.

Add live implicit defs for any implicitly defined physregs that are
actually used.

llvm-svn: 149715
2012-02-03 21:23:14 +00:00
Chad Rosier e023d5d7f3 [fast-isel] Rename isZExt to isSigned. No functional change intended.
llvm-svn: 149714
2012-02-03 21:14:11 +00:00
Chad Rosier aaa55a88b6 [fast-isel] Add support for UDIV.
llvm-svn: 149712
2012-02-03 21:07:27 +00:00
Jakob Stoklund Olesen 4290be4386 ArrayRef'ize MI::setPhysRegsDeadExcept().
llvm-svn: 149709
2012-02-03 20:43:39 +00:00
Jakob Stoklund Olesen f650732cab Handle all live physreg defs in the same place.
SelectionDAG has 4 different ways of passing physreg defs to users.
Collect all of the uses at the same time, and pass all of them to
MI->setPhysRegsDeadExcept() to mark the remaining defs dead.

The setPhysRegsDeadExcept() function will soon add the required
implicit-defs to instructions with register mask operands.

llvm-svn: 149708
2012-02-03 20:43:35 +00:00
Chad Rosier 41f0e78b6c [fast-isel] Add support for FPToUI. Also add test cases for FPToSI.
llvm-svn: 149706
2012-02-03 20:27:51 +00:00
Andrew Trick 99d316098e 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 a8a8ac5d47 [fast-isel] Add support for selecting UIToFP.
llvm-svn: 149704
2012-02-03 19:42:52 +00:00
Duncan Sands a71ae967ca Simplify some GEP checks in the verifier.
llvm-svn: 149698
2012-02-03 17:28:51 +00:00
Nadav Rotem 5399f4d6bf 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 47e6d26911 Remove getShuffleVPERMILPImmediate function, getShuffleSHUFImmediate performs the same calculation.
llvm-svn: 149683
2012-02-03 06:52:33 +00:00
Craig Topper d5ffe0900d 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 3b1817d2f5 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 ccb673659a 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 808a7a6ce6 whitespace
llvm-svn: 149671
2012-02-03 05:12:30 +00:00
Akira Hatanaka f0b08445f6 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 bb682450f9 Incorporate suggestions Chad, Jakob and Evan's suggestions on r149957.
llvm-svn: 149655
2012-02-03 01:13:49 +00:00
Jim Grosbach 1df8cdc588 Narrow test further. Make bot and test happy.
llvm-svn: 149650
2012-02-03 00:26:07 +00:00
Jim Grosbach 7815f56b22 Tidy up. Trailing whitespace.
llvm-svn: 149649
2012-02-03 00:07:04 +00:00
Jim Grosbach e84ae7bfa0 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 0ab54184d7 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 5e1ac45b93 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 caed1c9370 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 f61f60d97a 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 8cf51b871c 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 6fbb4d2842 Minor change in signature of the getZeroVector()
llvm-svn: 149601
2012-02-02 09:20:18 +00:00
Elena Demikhovsky fb44980b41 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 26f302d568 Unbreak the MSVC build.
llvm-svn: 149599
2012-02-02 08:36:09 +00:00
Lang Hames a808dc45cf 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 0269caafa6 Set EFLAGS correctly in EmitLoweredSelect on X86.
llvm-svn: 149597
2012-02-02 07:48:37 +00:00
Lang Hames 4d04f753bd 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 0f3298e8d4 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 3a20bc3652 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 961883c1cf Set the correct stack pointer register.
llvm-svn: 149585
2012-02-02 03:17:04 +00:00
Akira Hatanaka f029537e68 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 d9fef17749 Add DWARF numbers of 64-bit registers.
llvm-svn: 149583
2012-02-02 02:56:14 +00:00
Pete Cooper c1a6f98144 Typo
llvm-svn: 149562
2012-02-01 23:43:12 +00:00
Rafael Espindola 77295818f0 Fix the cmake build
llvm-svn: 149561
2012-02-01 23:40:51 +00:00
Andrew Trick 8523b16ff5 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 c7024a48db Move ARM subreg index compositions to the SubRegIndex itself.
llvm-svn: 149557
2012-02-01 23:16:43 +00:00
Andrew Trick 3441597f84 fix cmake
llvm-svn: 149553
2012-02-01 22:28:29 +00:00
Mon P Wang 9f05206659 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 d06df96a7c 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 e273cb08c4 Tidy up.
llvm-svn: 149521
2012-02-01 18:45:51 +00:00
Elena Demikhovsky 824eed70a6 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 34cca175ab Shortened code in shuffle masks
llvm-svn: 149493
2012-02-01 10:33:05 +00:00
Elena Demikhovsky 0e48c70ba7 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 513aaa5691 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 cbc845f9cf 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 9cdb8bdf04 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 e1d61f666b 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 8a3aebe5e0 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 17c981a45b 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 c34e51132c 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 9fa0481569 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 a2147ce313 Tidy up. One more return type mismatch fix.
llvm-svn: 149452
2012-01-31 23:51:09 +00:00
Lenny Maiorani 8d670b8f93 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 e1a12cf3ee 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 aa30aff4f7 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 44091c2f10 Refactor loop for better readability.
Excellent suggestion from Ben Kramer.

llvm-svn: 149417
2012-01-31 20:56:55 +00:00
Jim Grosbach b4d3a6af97 Add explanatory comment.
llvm-svn: 149416
2012-01-31 20:34:53 +00:00
Andrew Trick 25c7b83a4b Obvious unnecessary loop removal. Follow through from previous checkin.
llvm-svn: 149398
2012-01-31 18:54:19 +00:00
Devang Patel a173ee56fd 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 e5f4a6d904 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 8a33312948 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 b85e40f738 Remove pcmpgt/pcmpeq intrinsics as clang is not using them.
llvm-svn: 149367
2012-01-31 06:52:44 +00:00
Chris Lattner f1179025ae eliminate the "string" form of ConstantArray::get, using
ConstantDataArray::getString instead.

llvm-svn: 149365
2012-01-31 06:18:43 +00:00
Chris Lattner 8ea967d050 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 2b3c187489 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 06d673678e fix a small oversight that broke the fhourstones app.
llvm-svn: 149357
2012-01-31 05:18:56 +00:00
Chris Lattner 997348e9fe remove the last vestiges of llvm::GetConstantStringInfo, in CodeGen.
llvm-svn: 149356
2012-01-31 05:09:17 +00:00
Chris Lattner 9e4b8726f8 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 b90c102a52 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 8193b06e44 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 108423a94a 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 983005f51b 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 0d3785e165 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 3a565d6241 use the right accessor for ConstantDataArray.
llvm-svn: 149342
2012-01-31 03:16:39 +00:00
Chris Lattner 9c181f660c 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 fe741769dd enhance logic to support ConstantDataArray.
llvm-svn: 149340
2012-01-31 02:55:06 +00:00
Bill Wendling 8d9d1a0022 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 3fd879dde2 s/getInnerUnwindDest/getInnerResumeDest/g
llvm-svn: 149328
2012-01-31 01:48:40 +00:00
Bill Wendling a4237652d2 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 ea6e935e95 Remove ivar which is identical to another ivar.
llvm-svn: 149323
2012-01-31 01:25:54 +00:00
Bill Wendling 0c2d82b942 Remove unused ivars and s/getOuterUnwindDest/getOuterResumeDest/g.
llvm-svn: 149322
2012-01-31 01:22:03 +00:00
Bill Wendling 7778e6d818 Remove more dead functions.
llvm-svn: 149318
2012-01-31 01:18:21 +00:00
Bill Wendling 803d6b1b0c s/getInnerUnwindDestNewEH/getInnerUnwindDest/g
llvm-svn: 149317
2012-01-31 01:15:59 +00:00
Bill Wendling 621699de22 Remove some unused, old-EH methods.
llvm-svn: 149316
2012-01-31 01:14:49 +00:00
Eli Friedman 18a4c31525 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 518a205d0a 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 ce0c229234 Formatting cleanups. No functionality change.
llvm-svn: 149312
2012-01-31 01:01:16 +00:00
Bill Wendling f3cae51490 Remove no-longer-useful dyn_casts and pals.
llvm-svn: 149307
2012-01-31 00:56:53 +00:00
Bill Wendling bd7ed6fe7c Add a constified getLandingPad() method.
llvm-svn: 149303
2012-01-31 00:26:24 +00:00
Kostya Serebryany 22ddcfd2df [asan] fix the ObjC support (asan Issue #33)
llvm-svn: 149300
2012-01-30 23:50:10 +00:00
Chandler Carruth 2c469ff14a 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 4e7992eeba 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 7cdb2ff6b5 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 6a0baa8f09 Typo.
llvm-svn: 149289
2012-01-30 22:44:13 +00:00
Chad Rosier 41003f819c Typo.
llvm-svn: 149275
2012-01-30 21:13:22 +00:00
David Greene 6291f3a43c Implement String Cast from Integer
Allow casts from integer to string.

llvm-svn: 149273
2012-01-30 20:47:04 +00:00
Devang Patel 9a9bb5c5db Intel syntax. Support .intel_syntax directive.
llvm-svn: 149270
2012-01-30 20:02:42 +00:00
Benjamin Kramer 396c590818 Fix refacto.
llvm-svn: 149269
2012-01-30 20:01:35 +00:00
Matt Beaumont-Gay 9cc6d524ea 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