Commit Graph

59026 Commits

Author SHA1 Message Date
Jim Grosbach 7fce4e39aa switch the flag for using NEON for SP floating point to a subtarget 'feature'
llvm-svn: 99568
2010-03-25 23:32:19 +00:00
Gabor Greif 6c6b2fd2b2 rename pred_const_iterator to const_pred_iterator for consistency's sake
llvm-svn: 99567
2010-03-25 23:25:28 +00:00
Johnny Chen a3617ec88a Removed instruction class NI from ARMInstrFormats.td.
It doesn't seem to be used anywhere.

llvm-svn: 99566
2010-03-25 23:11:56 +00:00
Jim Grosbach a43386ba8f switch the use-vml[as] instructions flag to a subtarget 'feature'
llvm-svn: 99565
2010-03-25 23:11:16 +00:00
Gabor Greif c78d720f02 rename use_const_iterator to const_use_iterator for consistency's sake
llvm-svn: 99564
2010-03-25 23:06:16 +00:00
Daniel Dunbar d821f4ac60 llvm-mc: Add a -mc-relax-all option, which relaxes every fixup. We always need
exactly two passes in that case, and don't ever need to recompute any layout,
so this is a nice baseline for relaxation performance.

llvm-svn: 99563
2010-03-25 22:49:09 +00:00
Johnny Chen 91d2774416 Add NVDupLnFrm and change NVDupLane class to use that format.
llvm-svn: 99557
2010-03-25 21:49:12 +00:00
Jim Grosbach 4b3b2ef65c ARM cortex-a8 doesn't do vmla/vmls well. disable them by default for that cpu
llvm-svn: 99549
2010-03-25 20:48:50 +00:00
Johnny Chen d82f9002e4 Add NVCVTFrm (NEON Convert with fractional bits immediate) and modify N2VImm to
expect a Format arg.  N2VCvtD/N2VCvtQ are modified to use the NVCVTFrm format.

llvm-svn: 99548
2010-03-25 20:39:04 +00:00
Evan Cheng dbcf861a96 Add nounwind.
llvm-svn: 99546
2010-03-25 20:01:07 +00:00
Evan Cheng 510bda2064 Code clean up.
llvm-svn: 99544
2010-03-25 19:46:11 +00:00
Daniel Dunbar 6432bd744e MC: Stop restarting layout on every relaxation.
- Still O(N^2), just a faster form, and now its the MCAsmLayout's fault.

On the .s I am tuning against (combine.s from 403.gcc):
--
ddunbar@lordcrumb:MC$ diff stats-before.txt stats-after.txt
5,10c5,10
<    1728 assembler - Number of assembler layout and relaxation steps
<    7707 assembler - Number of emitted assembler fragments
<  120588 assembler - Number of emitted object file bytes
< 2233448 assembler - Number of evaluated fixups
<    1727 assembler - Number of relaxed instructions
< 6723845 mcexpr    - Number of MCExpr evaluations
---
>      3 assembler - Number of assembler layout and relaxation steps
>   7707 assembler - Number of emitted assembler fragments
> 120588 assembler - Number of emitted object file bytes
>  14796 assembler - Number of evaluated fixups
>   1727 assembler - Number of relaxed instructions
>  67889 mcexpr    - Number of MCExpr evaluations
--
Feel free to LOL at the -before numbers, if you like.

I am a little surprised we make more than 2 relaxation passes. It's pretty
trivial for us to do relaxation out-of-order if that would give a speedup.

llvm-svn: 99543
2010-03-25 19:35:56 +00:00
Daniel Dunbar d919276bc0 Fix -Asserts warning, again.
llvm-svn: 99542
2010-03-25 19:35:53 +00:00
Jakob Stoklund Olesen 3758ff917e Tag SSE2 integer instructions as SSEPackedInt.
llvm-svn: 99540
2010-03-25 18:52:04 +00:00
Jakob Stoklund Olesen f8d7eda663 Teach TableGen to understand X.Y notation in the TSFlagsFields strings.
Remove much horribleness from X86InstrFormats as a result. Similar
simplifications are probably possible for other targets.

llvm-svn: 99539
2010-03-25 18:52:01 +00:00
Chris Lattner fc4ec25363 fix a valgrind error on copy-constructor-synthesis.cpp, which is caused when
the custom insertion hook deletes the instruction, then we try to set dead
flags on it.  Neither the code that I added nor the code that was there 
before was safe.

llvm-svn: 99538
2010-03-25 18:49:10 +00:00
Evan Cheng a1d0a02713 Remove an unused option.
llvm-svn: 99537
2010-03-25 18:37:23 +00:00
Daniel Dunbar 0ba6a671d4 MC: Simplify main section layout process by moving alignment into LayoutSection.
llvm-svn: 99529
2010-03-25 18:16:42 +00:00
Daniel Dunbar 25d114b2b2 MC: Sink Section address assignment into LayoutSection.
llvm-svn: 99528
2010-03-25 18:16:38 +00:00
Jakob Stoklund Olesen 49e121d5e4 Add a late SSEDomainFix pass that twiddles SSE instructions to avoid domain crossings.
On Nehalem and newer CPUs there is a 2 cycle latency penalty on using a register
in a different domain than where it was defined. Some instructions have
equvivalents for different domains, like por/orps/orpd.

The SSEDomainFix pass tries to minimize the number of domain crossings by
changing between equvivalent opcodes where possible.

This is a work in progress, in particular the pass doesn't do anything yet. SSE
instructions are tagged with their execution domain in TableGen using the last
two bits of TSFlags. Note that not all instructions are tagged correctly. Life
just isn't that simple.

The SSE execution domain issue is very similar to the ARM NEON/VFP pipeline
issue handled by NEONMoveFixPass. This pass may become target independent to
handle both.

llvm-svn: 99524
2010-03-25 17:25:00 +00:00
Johnny Chen 45ab3f3ccf Added a new instruction class NVDupLane to be inherited by VDUPLND and VDUPLNQ,
instead of the current N2V.  Format of NVDupLane instances are set to NEONFrm
currently.

llvm-svn: 99518
2010-03-25 17:01:27 +00:00
Bob Wilson e543e7fcb1 Reapply Kevin's change 94440, now that Chris has fixed the limitation on
opcode values fitting in one byte (svn r99494).

llvm-svn: 99514
2010-03-25 16:36:14 +00:00
Daniel Dunbar eb4bc7ffd3 Sketch a few Clang release notes.
llvm-svn: 99512
2010-03-25 16:09:18 +00:00
Devang Patel 95cd4b9c0a Add comment.
llvm-svn: 99507
2010-03-25 15:09:44 +00:00
John Criswell 4e61b255e2 Fixed spurious warning problem noticed by Daniel Dunbar. The configure script
now configures prerequisite projects individually but also ignores them in the
big project switch statement to avoid the incorrect warning.

llvm-svn: 99506
2010-03-25 13:59:09 +00:00
Daniel Dunbar 951459740c MC/Mach-O: Switch to MCSectionData::getOrdinal.
llvm-svn: 99504
2010-03-25 08:08:54 +00:00
Evan Cheng 1889440b52 Scheduler assumes SDDbgValue nodes are in source order. That's true currently. But add an assertion to verify it.
llvm-svn: 99501
2010-03-25 07:16:57 +00:00
Daniel Dunbar 4108802628 MC: Explicity track section and fragment ordinals.
llvm-svn: 99500
2010-03-25 07:10:11 +00:00
Daniel Dunbar eaa792f0d9 Fix -Asserts warning.
llvm-svn: 99499
2010-03-25 07:10:05 +00:00
Daniel Dunbar e810155805 lit: Add LitTestCase and lit.load_test_suite, for adapting lit based suites for
use with Python's unittest.

llvm-svn: 99498
2010-03-25 07:10:01 +00:00
Chris Lattner 552dddc51c Change tblgen to emit FOOISD opcode names as two
bytes instead of one byte.  This is important because
we're running up to too many opcodes to fit in a byte
and it is aggrevated by FIRST_TARGET_MEMORY_OPCODE
making the numbering sparse.  This just bites the
bullet and bloats out the table.  In practice, this
increases the size of the x86 isel table from 74.5K
to 76K.  I think we'll cope :)

This fixes rdar://7791648

llvm-svn: 99494
2010-03-25 06:33:05 +00:00
Devang Patel 32a5c4a4e6 Fix typo.
llvm-svn: 99493
2010-03-25 06:26:14 +00:00
Jakob Stoklund Olesen 0e45762250 Fix evil TableGen bug in template parameters with defaults.
If a TableGen class has an initializer expression containing an X.Y subexpression,
AND X depends on template parameters,
AND those template parameters have defaults,
AND some parameters with defaults are beyond position 1,
THEN parts of the initializer expression are evaluated prematurely with the default values when the first explicit template parameter is substituted, before the remaining explicit template parameters have been substituted.

llvm-svn: 99492
2010-03-25 06:23:34 +00:00
Devang Patel 4414711909 Include isFunctionLocal while calculating folding node set profile for a MDNode.
llvm-svn: 99490
2010-03-25 06:04:47 +00:00
Evan Cheng 08b3364c6e Remove a fixme that doesn't make sense any more.
llvm-svn: 99489
2010-03-25 06:02:53 +00:00
Chris Lattner 0563804982 fix PR6642, GVN forwarding from memset to load of the base of the memset.
llvm-svn: 99488
2010-03-25 05:58:19 +00:00
Evan Cheng 7f0b16a206 Make sure SDDbgValue.Invalid is initialized to false by all the constructors.
llvm-svn: 99487
2010-03-25 05:50:26 +00:00
Chris Lattner 23bf99a97c eliminate a bunch more parallels now that scheduling
handles dead implicit results more aggressively.  More
to come, I think this is now just a data entry problem.

llvm-svn: 99486
2010-03-25 05:44:01 +00:00
Chris Lattner 4690af8567 Make the NDEBUG assertion stronger and more clear what is
happening.

Enhance scheduling to set the DEAD flag on implicit defs
more aggressively.  Before, we'd set an implicit def operand
to dead if it were present in the SDNode corresponding to
the machineinstr but had no use.  Now we do it in this case
AND if the implicit def does not exist in the SDNode at all.

This exposes a couple of problems: one is the FIXME, which
causes a live intervals crash on CodeGen/X86/sibcall.ll.
The second is that it makes machinecse and licm more 
aggressive (which is a good thing) but also exposes a case
where licm hoists a set0 and then it doesn't get resunk.

Talking to codegen folks about both these issues, but I need
this patch in in the meantime.

llvm-svn: 99485
2010-03-25 05:40:48 +00:00
Devang Patel c95e6079a4 Include isFunctionLocal while calculating folding node set provide for a MDNode.
llvm-svn: 99484
2010-03-25 05:36:13 +00:00
Eric Christopher b1a382d8b9 Reapply r99451 with a fix to move the NoInline check to the cost functions
instead of InlineFunction.

llvm-svn: 99483
2010-03-25 04:49:10 +00:00
Chris Lattner e2a504ee82 reapply 99444/99445, which I speculatively reverted in
r99453.

llvm-svn: 99482
2010-03-25 04:41:16 +00:00
Daniel Dunbar 5b07334c0d MC: Route access to SectionData offset and file size through MCAsmLayout.
llvm-svn: 99474
2010-03-25 02:00:07 +00:00
Daniel Dunbar 2522dd1c49 MC: Route access to Fragment offset and effective size through MCAsmLayout.
llvm-svn: 99473
2010-03-25 02:00:02 +00:00
Eric Christopher 5bbda5130f Make sure this runs in 64-bit only, 32-bit won't produce the correct stores.
Fariborz please review and make sure this is what you meant.

llvm-svn: 99472
2010-03-25 01:46:07 +00:00
Evan Cheng 563fe3cc12 Change how dbg_value sdnodes are converted into machine instructions. Their placement should be determined by the relative order of incoming llvm instructions. The scheduler will now use the SDNode ordering information to determine where to insert them. A dbg_value instruction is inserted after the instruction with the last highest source order and before the instruction with the next highest source order. It will optimize the placement by inserting right after the instruction that produces the value if they have consecutive order numbers.
Here is a theoretical example that illustrates why the placement is important.

tmp1 = 
store tmp1 -> x
...
tmp2 = add ...
...
call
...
store tmp2 -> x

Now mem2reg comes along:

tmp1 = 
dbg_value (tmp1 -> x)
...
tmp2 = add ...
...
call
...
dbg_value (tmp2 -> x)

When the debugger examine the value of x after the add instruction but before the call, it should have the value of tmp1.

Furthermore, for dbg_value's that reference constants, they should not be emitted at the beginning of the block (since they do not have "producers").

This patch also cleans up how SDISel manages DbgValue nodes. It allow a SDNode to be referenced by multiple SDDbgValue nodes. When a SDNode is deleted, it uses the information to find the SDDbgValues and invalidate them. They are not deleted until the corresponding SelectionDAG is destroyed.

llvm-svn: 99469
2010-03-25 01:38:16 +00:00
Daniel Dunbar 5d98824615 MC: Eliminate MC{Fragment,{Section,Symbol}Data}::getAddress.
llvm-svn: 99467
2010-03-25 01:03:24 +00:00
Daniel Dunbar 5caf2ff561 MC: Fix refacto in MCExpr evaluation, I mistakenly replaced a fragment address with a symbol address.
- This fixes the integrated-as nightly test regressions.

llvm-svn: 99466
2010-03-25 01:03:17 +00:00
Evan Cheng eae56b5717 Avoid being influenced by dbg_value instructions.
llvm-svn: 99465
2010-03-25 01:01:37 +00:00
Eric Christopher 2332152e4b Fix unused parameter warning.
llvm-svn: 99463
2010-03-25 00:59:51 +00:00
Evan Cheng b07a29ecd4 Disable folding loads into tail call in 32-bit PIC mode. It can introduce illegal code like this:
addl    $12, %esp
        popl    %esi
        popl    %edi
        popl    %ebx
        popl    %ebp
        jmpl    *__Block_deallocator-L1$pb(%esi)  # TAILCALL

The problem is the global base register is assigned GR32 register class. TCRETURNmi needs the registers making up the address mode to have the GR32_TC register class.

The *proper* fix is for X86DAGToDAGISel::getGlobalBaseReg() to return a copy from the global base register of the machine function rather than returning the register itself. But that has the potential of causing it to be coalesced to a more restrictive register class: GR32_TC. It can introduce additional copies and spills. For something as important the PIC base, it's not worth it especially since this is not an issue on 64-bit.

llvm-svn: 99455
2010-03-25 00:10:31 +00:00
Dan Gohman 2a020358dc Docuemntation corrections from John Myers.
llvm-svn: 99454
2010-03-25 00:03:04 +00:00
Chris Lattner ddca7b09f7 revert 99444/99445. This doesn't cause the failure of
2006-07-19-stwbrx-crash.ll for me, but it's the only likely
patch in the blame list of several bots.  Lets see if this
fixes it.

llvm-svn: 99453
2010-03-24 23:41:19 +00:00
Eric Christopher 1d38538fb6 Temporarily revert this, it's causing an issue with an internal project.
llvm-svn: 99451
2010-03-24 23:35:21 +00:00
Bob Wilson 5b2da69f6d Speculatively revert this to see if it fixes buildbot failures.
--- Reverse-merging r99440 into '.':
U    test/MC/AsmParser/X86/x86_32-bit_cat.s
U    test/MC/AsmParser/X86/x86_32-encoding.s
U    include/llvm/IntrinsicsX86.td
U    include/llvm/CodeGen/SelectionDAGNodes.h
U    lib/Target/X86/X86InstrSSE.td
U    lib/Target/X86/X86ISelLowering.h

llvm-svn: 99450
2010-03-24 23:26:29 +00:00
Chris Lattner af2684154f add a convenient TargetInstrDesc::getNumImplicitUses/Defs method.
llvm-svn: 99446
2010-03-24 23:07:47 +00:00
Chris Lattner e70742450f remove dead argument.
llvm-svn: 99445
2010-03-24 22:47:12 +00:00
Chris Lattner 26136636e0 split EmitNode in half to reduce indentation.
llvm-svn: 99444
2010-03-24 22:45:47 +00:00
Kevin Enderby f5584a7397 Added the Advanced Encryption Standard (AES) Instructions.
llvm-svn: 99440
2010-03-24 22:33:33 +00:00
Jim Grosbach 34de7768bf Make the use of the vmla and vmls VFP instructions controllable via cmd line.
Preliminary testing shows significant performance wins by not using these
instructions.

llvm-svn: 99436
2010-03-24 22:31:46 +00:00
Kevin Enderby b96eb68497 Fixed the SS42AI template for the SSE 4.2 instructions with TA prefix so it does
not get an "Unknown immediate size" assert failure when used.  All instructions 
of this form have an 8-bit immediate.  Also added a test case of an example
instruction that is of this form.

llvm-svn: 99435
2010-03-24 22:28:42 +00:00
Nate Begeman 2ceb288416 Per chris's request, add some comments.
llvm-svn: 99434
2010-03-24 22:19:06 +00:00
Devang Patel 834392fcc6 Use SP filename directly instead of SP's context's filename.
llvm-svn: 99429
2010-03-24 21:30:35 +00:00
Johnny Chen bff23ca690 Trivial formating change.
llvm-svn: 99428
2010-03-24 21:25:07 +00:00
Nate Begeman 583e05d8ce BUILD_VECTOR was missing out on some prime opportunities to use SSE 4.1 inserts.
llvm-svn: 99423
2010-03-24 20:49:50 +00:00
Bob Wilson 4d87012eb3 Revert Edwin's change that is breaking MultiSource/Applications/ClamAV/clamscan.
--- Reverse-merging r99400 into '.':
D    test/CodeGen/Generic/2010-03-24-liveintervalleak.ll
U    lib/CodeGen/LiveIntervalAnalysis.cpp

llvm-svn: 99419
2010-03-24 20:25:25 +00:00
Evan Cheng c12c2d9bb4 Move OptChkCall off LibCallOptimization into StrCpyOpt.
llvm-svn: 99418
2010-03-24 20:19:04 +00:00
Dan Gohman 8e404fe769 Trim #includes.
llvm-svn: 99416
2010-03-24 19:56:17 +00:00
Johnny Chen e99953ce9c Reverted r99326 which added NVdVmVCVTFrm, and later renamed to NVCVTFrm.
NVCVTFrm will later be used to describe "vcvt with fractional bits".

llvm-svn: 99415
2010-03-24 19:47:14 +00:00
Dan Gohman b452d4e9e4 Fix minor style issues.
llvm-svn: 99414
2010-03-24 19:38:02 +00:00
Dan Gohman 4634b7d4f6 It's not necessary to call raw_ostream::close explicitly on automatic
raw_ostream variables immediately before they go out of scope.

llvm-svn: 99413
2010-03-24 19:00:02 +00:00
Devang Patel d7a6cc5129 Do not rely on getCompileUnit() to find source file information for a subprogram.
llvm-svn: 99410
2010-03-24 18:48:00 +00:00
Johnny Chen da44d5977f Reverted r99376. The disassembler will deal with the 2-reg format of these two
N3VX instructions using special case code.

llvm-svn: 99409
2010-03-24 18:46:34 +00:00
Jim Grosbach 07607382d8 tweak the arm if conversion heuristic
llvm-svn: 99402
2010-03-24 16:15:14 +00:00
Torok Edwin 4bbfdd41ea Fix memory leak in liveintervals: the destructor for VNInfos must be called,
otherwise the SmallVector it contains doesn't free its memory.
In most cases LiveIntervalAnalysis could get away by not calling the destructor,
because VNInfos are bumpptr-allocated, and smallvectors usually don't grow.
However when the SmallVector does grow it always leaks.

This is the valgrind shown leak from the original testcase:
==8206== 18,304 bytes in 151 blocks are definitely lost in loss record 164 of 164
==8206==    at 0x4A079C7: operator new(unsigned long) (vg_replace_malloc.c:220)
==8206==    by 0x4DB7A7E: llvm::SmallVectorBase::grow_pod(unsigned long, unsigned long) (in /home/edwin/clam/git/builds/defaul
t/libclamav/.libs/libclamav.so.6.1.0)
==8206==    by 0x4F90382: llvm::VNInfo::addKill(llvm::SlotIndex) (in /home/edwin/clam/git/builds/default/libclamav/.libs/libcl
amav.so.6.1.0)
==8206==    by 0x5126B5C: llvm::LiveIntervals::handleVirtualRegisterDef(llvm::MachineBasicBlock*, llvm::ilist_iterator<llvm::M
achineInstr>, llvm::SlotIndex, llvm::MachineOperand&, unsigned int, llvm::LiveInterval&) (in /home/edwin/clam/git/builds/defau
lt/libclamav/.libs/libclamav.so.6.1.0)
==8206==    by 0x512725E: llvm::LiveIntervals::handleRegisterDef(llvm::MachineBasicBlock*, llvm::ilist_iterator<llvm::MachineI
nstr>, llvm::SlotIndex, llvm::MachineOperand&, unsigned int) (in /home/edwin/clam/git/builds/default/libclamav/.libs/libclamav
.so.6.1.0)
==8206==    by 0x51278A8: llvm::LiveIntervals::computeIntervals() (in /home/edwin/clam/git/builds/default/libclamav/.libs/libc
lamav.so.6.1.0)
==8206==    by 0x5127CB4: llvm::LiveIntervals::runOnMachineFunction(llvm::MachineFunction&) (in /home/edwin/clam/git/builds/de
fault/libclamav/.libs/libclamav.so.6.1.0)
==8206==    by 0x4DAE935: llvm::FPPassManager::runOnFunction(llvm::Function&) (in /home/edwin/clam/git/builds/default/libclama
v/.libs/libclamav.so.6.1.0)
==8206==    by 0x4DAEB10: llvm::FunctionPassManagerImpl::run(llvm::Function&) (in /home/edwin/clam/git/builds/default/libclama
v/.libs/libclamav.so.6.1.0)
==8206==    by 0x4DAED3D: llvm::FunctionPassManager::run(llvm::Function&) (in /home/edwin/clam/git/builds/default/libclamav/.l
ibs/libclamav.so.6.1.0)
==8206==    by 0x4D8BE8E: llvm::JIT::runJITOnFunctionUnlocked(llvm::Function*, llvm::MutexGuard const&) (in /home/edwin/clam/git/builds/default/libclamav/.libs/libclamav.so.6.1.0)
==8206==    by 0x4D8CA72: llvm::JIT::getPointerToFunction(llvm::Function*) (in /home/edwin/clam/git/builds/default/libclamav/.libs/libclamav.so.6.1.0)

llvm-svn: 99400
2010-03-24 13:50:36 +00:00
Gabor Greif a2fbc0ae1b Finally land the InvokeInst operand reordering.
I have audited all getOperandNo calls now, fixing
hidden assumptions. CallSite related uglyness will
be eliminated successively.

Note this patch has a long and griveous history,
for all the back-and-forths have a look at
CallSite.h's log.

llvm-svn: 99399
2010-03-24 13:21:49 +00:00
Gabor Greif be18ae6781 tighten a type and remove trailing whitespace, no functional changes
llvm-svn: 99398
2010-03-24 11:58:07 +00:00
Gabor Greif 9027ffb918 increase const goodness and remove pointless getUser() calls
llvm-svn: 99395
2010-03-24 10:29:52 +00:00
Gabor Greif 11ff53146f cache result of UI.getOperandNo() instead of calling it twice, it is cheaper this way
llvm-svn: 99394
2010-03-24 10:12:54 +00:00
Duncan Sands 8712da360b Fix comment typo.
llvm-svn: 99392
2010-03-24 09:05:14 +00:00
Daniel Dunbar 7c969558d9 MC: Direct all {fragment,section,symbol} address access through the MCAsmLayout object.
llvm-svn: 99380
2010-03-24 03:43:40 +00:00
Evan Cheng cf7be39e24 dbg_value may end a block.
llvm-svn: 99378
2010-03-24 01:50:28 +00:00
Johnny Chen aa9b1c81a7 Mark VMOVDneon and VMOVQ as having the N2RegFrm form to help the disassembler.
llvm-svn: 99376
2010-03-24 01:29:25 +00:00
Chris Lattner 9096bcdeda Switch INC8r to defining its pattern in terms of X86inc_flag
and defining the add pattern with Pat<>, eliminating a use of
parallel.

llvm-svn: 99375
2010-03-24 01:02:12 +00:00
Johnny Chen 9b1f60adec Renamed NVdVmImmFrm and NVdVmVCVTFrm to the more proper N2RegFrm and NVCVTFrm,
respectively, and add some more comment.

llvm-svn: 99373
2010-03-24 00:57:50 +00:00
Dan Gohman b92c8c849b Remove the ConvertActions table and associated code, which is unused.
llvm-svn: 99372
2010-03-24 00:53:38 +00:00
Chris Lattner 918a2c8661 Add a method to get a StringMapEntry from a pointer to the string
data it contains (similar to GetStringMapEntryFromValue).  
Patch by Greg Clayton!

llvm-svn: 99371
2010-03-24 00:53:27 +00:00
Chris Lattner f9c8bec6c5 switch SDTBinaryArithWithFlags to be a multiple-result node as well.
llvm-svn: 99370
2010-03-24 00:49:29 +00:00
Chris Lattner db1ac3cf3e Switch SDTUnaryArithWithFlags to being modeled as a two-result
ISD node.  The only change in the generated isel code are comments
like:

<                 // Src: (X86dec_flag:i16 GR16:i16:$src)
---
>                 // Src: (X86dec_flag:i16:i32 GR16:i16:$src)

because now it knows that X86dec_flag returns both an i16 (for the result)
and an i32 (for EFLAGS) in this case.  Wewt.

llvm-svn: 99369
2010-03-24 00:47:47 +00:00
Chris Lattner 6c2d178957 add plumbing for handling multiple result nodes
in some more places.

llvm-svn: 99366
2010-03-24 00:41:19 +00:00
Dan Gohman 09a9fbabfa Fix coding style.
llvm-svn: 99362
2010-03-24 00:27:49 +00:00
Dan Gohman ee788af217 Generalize findNearestCommonDominator to work on post-dominators,
based on a suggestion by Jochen Wilhelmy.

llvm-svn: 99361
2010-03-24 00:22:24 +00:00
Chris Lattner cca83a7aa4 remove 64-bit or_is_add parallels.
llvm-svn: 99360
2010-03-24 00:16:52 +00:00
Chris Lattner f5e5004327 remove useless or_is_add parallel's.
llvm-svn: 99359
2010-03-24 00:15:23 +00:00
Chris Lattner 237d38e748 reduce nesting.
llvm-svn: 99358
2010-03-24 00:12:57 +00:00
Chris Lattner 38c99662ff implement SDTCisVTSmallerThanOp with EnforceSmallerThan
instead of reimplementing it wrong and poorly.

llvm-svn: 99357
2010-03-24 00:06:46 +00:00
Jim Grosbach e0874fa02f try being more permissive for if-conversion on ARM V7. see what the nightly
test run permformance numbers say as to whether it helps.

llvm-svn: 99355
2010-03-24 00:03:13 +00:00
Chris Lattner 57ebf63da7 bring sanity to EnforceVectorEltType
llvm-svn: 99354
2010-03-24 00:01:16 +00:00
Chris Lattner 6070ee2a58 Cleanup getImplicitType
llvm-svn: 99353
2010-03-23 23:50:31 +00:00
Jakob Stoklund Olesen a86ccbfe88 Revert "Add a late SSEDomainFix pass that twiddles SSE instructions to avoid domain crossings."
This reverts commit 99345. It was breaking buildbots.

llvm-svn: 99352
2010-03-23 23:48:51 +00:00
Daniel Dunbar 5376c2a431 MC: Sprinkle in some more interesting statistics.
llvm-svn: 99350
2010-03-23 23:47:14 +00:00
Daniel Dunbar b09b8906cb llvm-mc: Support -filetype=null, for timing purposes.
llvm-svn: 99349
2010-03-23 23:47:12 +00:00
Daniel Dunbar 5cfb58719d llvm-mc: Fast path EvaluateAbsolute of constants.
llvm-svn: 99348
2010-03-23 23:47:07 +00:00
Chris Lattner b424faa09c reject void in intrinsic type lists.
llvm-svn: 99347
2010-03-23 23:46:27 +00:00
Chris Lattner 3d9ec39116 [llvm_void_ty] is no longer needed for result types,
just use an empty result list.

llvm-svn: 99346
2010-03-23 23:46:07 +00:00
Jakob Stoklund Olesen 31da45b7af Add a late SSEDomainFix pass that twiddles SSE instructions to avoid domain crossings.
This is work in progress. So far, SSE execution domain tables are added to
X86InstrInfo, and a skeleton pass is enabled with -sse-domain-fix.

llvm-svn: 99345
2010-03-23 23:14:44 +00:00
Johnny Chen 6a64320da8 Renamed NVdImmFrm to N1RegModImmFrm.
llvm-svn: 99344
2010-03-23 23:09:14 +00:00
Bill Wendling 703d0b978a Remove if DISABLED not if not DISABLED...
llvm-svn: 99343
2010-03-23 23:09:03 +00:00
Chris Lattner 00eeac4179 add some accessors to callsite/callinst/invokeinst to check
for the noinline attribute, and make the inliner refuse to
inline a call site when the call site is marked noinline even
if the callee isn't.  This fixes PR6682.

llvm-svn: 99341
2010-03-23 22:59:07 +00:00
Dan Gohman c53d5d6bb4 Revert 99335. getTypeToExpandTo's iterative behavior is actually
needed here.

llvm-svn: 99339
2010-03-23 22:44:42 +00:00
Bill Wendling c941619a73 Use "DISABLE_EDIS" to disable building "edis" explicitly. Don't build it for
Apple-style builds.

llvm-svn: 99336
2010-03-23 22:15:33 +00:00
Dan Gohman 42f8ddeb11 Remove getTypeToExpandTo, since it isn't adding much value
beyond just calling getTypeToTransformTo.

llvm-svn: 99335
2010-03-23 22:15:31 +00:00
Chris Lattner 7d32580e5a make sure to delete the llvm module before calling llvm_shutdown,
this fixes crashes in error cases, PR6683

llvm-svn: 99334
2010-03-23 21:59:43 +00:00
Dan Gohman dcddd5701c Don't back past debug info intrinsics; SCEVExpander's strategy
for ignoring debug info intrinsics everywhere else is to advance
past them, and it needs to be consistent.

llvm-svn: 99332
2010-03-23 21:53:22 +00:00
Chris Lattner ae12e35004 fix an infinite loop in Module::getEndianness, PR6684
patch by Alex Mac!

llvm-svn: 99330
2010-03-23 21:48:41 +00:00
Johnny Chen 8a687233e3 Fix typo in the comment for N3VX class.
llvm-svn: 99328
2010-03-23 21:35:03 +00:00
Johnny Chen 5be6d5a6a9 Add comment.
llvm-svn: 99327
2010-03-23 21:30:12 +00:00
Johnny Chen 5dbf39285d Add New NEON Format NVdVmVCVTFrm.
Converted some of the NEON vcvt instructions to this format.

llvm-svn: 99326
2010-03-23 21:25:38 +00:00
Bill Wendling 04803e8ef6 Skip debugging intrinsics when sinking unused invariants.
llvm-svn: 99324
2010-03-23 21:15:59 +00:00
Johnny Chen 020023a3fa Add New NEON Format NVdVmImmFrm.
llvm-svn: 99322
2010-03-23 20:40:44 +00:00
Evan Cheng 77be42a07f Ignore dbg_value's.
llvm-svn: 99321
2010-03-23 20:36:12 +00:00
Evan Cheng b6dee6e015 Teach isSafeToClobberEFLAGS to ignore dbg_value's. We need a MachineBasicBlock::iterator that does this automatically?
llvm-svn: 99320
2010-03-23 20:35:45 +00:00
Evan Cheng c7d721aa03 Code clean up.
llvm-svn: 99319
2010-03-23 20:33:48 +00:00
Bob Wilson 59f75bba24 Fix VLDMQ and VSTMQ instructions to use the correct encoding and address modes.
These instructions are only needed for codegen, so I've removed all the
explicit encoding bits for now; they should be set in the same way as the for
VLDMD and VSTMD whenever we add encodings for VFP.  The use of addrmode5
requires that the instructions be custom-selected so that the number of
registers can be set in the AM5Opc value.

llvm-svn: 99309
2010-03-23 18:54:46 +00:00
Stuart Hastings 2b9735138e Test case for llvm-gcc r99305. Radar 7659636.
llvm-svn: 99306
2010-03-23 18:39:23 +00:00
Bob Wilson 3968c6a252 Fix bad indentation, 80-column violations, and trailing whitespace.
llvm-svn: 99295
2010-03-23 17:23:59 +00:00
Johnny Chen ac5024bbeb Add New NEON Format NVdImmFrm.
Ref: A7.4.6 One register and a modified immediate value.

llvm-svn: 99288
2010-03-23 16:43:47 +00:00
Evan Cheng c8d0dd1bd4 Add comment.
llvm-svn: 99284
2010-03-23 15:50:49 +00:00
Evan Cheng 5f7b636ee6 Forgot this.
llvm-svn: 99283
2010-03-23 15:49:37 +00:00
Evan Cheng d9e822345c Teach simplify libcall to transform __strcpy_chk to __memcpy_chk to enable optimizations down stream.
llvm-svn: 99282
2010-03-23 15:48:04 +00:00
Gabor Greif 161cb044f3 add assert in argpromotion, which cannot trigger
if Function::hasAddressTaken works as advertised

also included some cosmetic cleanups

llvm-svn: 99276
2010-03-23 14:40:20 +00:00
Gabor Greif 668d700fe3 word-o
llvm-svn: 99275
2010-03-23 13:45:54 +00:00
Bob Wilson 9b680e21c0 Rename some instructions to match the corresponding NEON opcode.
llvm-svn: 99266
2010-03-23 06:26:18 +00:00
Bob Wilson cc0a2a75a0 Change VST1 instructions for loading Q register values to operate on pairs
of D registers.  Add a separate VST1q instruction with a Q register
source operand for use by storeRegToStackSlot.

llvm-svn: 99265
2010-03-23 06:20:33 +00:00
Evan Cheng 3f7842232e Fix an incorrect logic causing instcombine to miss some _chk -> non-chk transformations.
llvm-svn: 99263
2010-03-23 06:06:09 +00:00
Bob Wilson 340861d29e Change VLD1 instructions for loading Q register values to operate on pairs
of D registers.  Add a separate VLD1q instruction with a Q register
destination operand for use by loadRegFromStackSlot.

llvm-svn: 99261
2010-03-23 05:25:43 +00:00
Daniel Dunbar de04b3f62c MC: Switch to using MCInst fragments to do relaxation.
Also, both MCMachOStreamer and MCAssembler are now target independent!

llvm-svn: 99256
2010-03-23 05:09:03 +00:00
Daniel Dunbar 86face8333 MC: Add TargetAsmBackend::MayNeedRelaxation, for checking whether a particular instruction + fixups might need relaxation.
llvm-svn: 99249
2010-03-23 03:13:05 +00:00
Daniel Dunbar a9ae3ae698 MC: Add TargetAsmBackend::WriteNopData and use to eliminate some target dependencies in MCMachOStreamer and MCAssembler.
llvm-svn: 99248
2010-03-23 02:36:58 +00:00
Daniel Dunbar e0c43577c1 MC: Add TargetAsmBackend::RelaxInstruction callback, and custom X86 implementation.
llvm-svn: 99245
2010-03-23 01:39:09 +00:00
Daniel Dunbar 16cbe95dd6 MC: Tweak MCInstFragment to include the encoded data and fixups, so that we don't need to recompute them during relaxation. I will revisit this once all the other pieces of fast relaxation are in place.
llvm-svn: 99244
2010-03-23 01:39:05 +00:00
Jeffrey Yasskin a99d232803 Put MCSectionCOFF::Name into the MCContext instead of leaking it.
llvm-svn: 99231
2010-03-22 23:26:12 +00:00
Daniel Dunbar b31c49a70d MC: Add MCInstFragment, not used yet.
llvm-svn: 99229
2010-03-22 23:16:48 +00:00
Daniel Dunbar a75f01a905 Add a FIXME.
llvm-svn: 99228
2010-03-22 23:16:43 +00:00
Chris Lattner b1c4f62cac Fix PR6673: updating the callback should not clear the map.
llvm-svn: 99227
2010-03-22 23:15:57 +00:00
Devang Patel d22ed622b3 Emit DW_AT_low_pc and DW_AT_high_pc attributes for TAG_compile_unit.
llvm-svn: 99225
2010-03-22 23:11:36 +00:00
Evan Cheng 9a7b270825 Fix 80 col violation.
llvm-svn: 99224
2010-03-22 22:44:31 +00:00
Devang Patel 53e91f0836 DW_AT_stmt_list attribute attached with a compile unit encodes offset of line number information for this compile unit in debug_line section. This offset is always zero when only one compile unit is emitted in a object file.
llvm-svn: 99223
2010-03-22 22:38:48 +00:00
Daniel Dunbar fdc7ccc4e4 MC: Fix a few more cases we were passing an MCDataFragment when a MCFragment would do, and sprinkle in some const.
llvm-svn: 99218
2010-03-22 21:49:41 +00:00
Daniel Dunbar 20ea02fde2 Simplify.
llvm-svn: 99217
2010-03-22 21:49:38 +00:00
Daniel Dunbar 04047fbe14 MCInst: Add ::dump_pretty.
llvm-svn: 99216
2010-03-22 21:49:34 +00:00
Evan Cheng 14694d3666 Reduce indentation.
llvm-svn: 99214
2010-03-22 21:24:33 +00:00
Chris Lattner 2109cb461c Change intrinsic result type for void to store it as an empty list
instead of as a single element list with VoidTy.  Now with a fix
for the verifier.

llvm-svn: 99206
2010-03-22 20:56:36 +00:00
Daniel Dunbar a0ab4bf989 MC: Change MCObjectWriter::RecordRelocation to take an MCFragment (instead of a MCDataFragment). Object files should only need the generic MCFragment features.
llvm-svn: 99205
2010-03-22 20:35:50 +00:00
Daniel Dunbar f1f1827bfa MC/Mach-O: Factor out getOrCreateDataFragment().
llvm-svn: 99204
2010-03-22 20:35:46 +00:00
Daniel Dunbar 9213355a91 MC: Eliminate MCFragment::getMaxFileSize.
llvm-svn: 99203
2010-03-22 20:35:43 +00:00
Daniel Dunbar 32ffc58ca9 MC: Share the MCAsmLayout object, although its still not used for anything important.
llvm-svn: 99202
2010-03-22 20:35:35 +00:00
Bob Wilson e60e3ab624 Rename one more NEON instruction that I missed earlier.
llvm-svn: 99201
2010-03-22 20:31:39 +00:00
Jeffrey Yasskin 54ebc986b1 Fix a memory leak from DIE::addSiblingOffset() by adding the DIEValue
it allocates to DwarfDebug::DIEValues.

llvm-svn: 99196
2010-03-22 18:47:14 +00:00
Evan Cheng 760dc65d59 80 col violation.
llvm-svn: 99195
2010-03-22 18:40:50 +00:00
Bob Wilson c286c88db0 Regroup some instructions. No functional change.
llvm-svn: 99192
2010-03-22 18:22:06 +00:00
Bob Wilson c53a1125ff Rename some VLD1/VST1 instructions to match the implementation, i.e., the
corresponding NEON instructions, instead of operation they are currently
used for.

llvm-svn: 99189
2010-03-22 18:13:18 +00:00
Bob Wilson 98bf5189d7 Remove some redundant instruction classes.
llvm-svn: 99187
2010-03-22 18:02:38 +00:00
Dan Gohman e5732c63c4 llc doesn't need LinkAllVMCore.
llvm-svn: 99186
2010-03-22 16:59:44 +00:00
Bob Wilson debe0bdb13 Refactor instruction encoding arguments for VLDnLN/VSTnLN classes to
specify encoding bits in arguments instead of "let" expressions.

llvm-svn: 99185
2010-03-22 16:43:10 +00:00
Jakob Stoklund Olesen 5db5506093 Completely remove Blackfin patterns that thought JustCC was i1.
Thanks, Chris!

llvm-svn: 99183
2010-03-22 16:30:04 +00:00
Jeffrey Yasskin 7d116ce2e3 Don't leak a MachineInstruction from Thumb1InstrInfo::restoreCalleeSavedRegisters.
llvm-svn: 99182
2010-03-22 16:13:21 +00:00
Jeffrey Yasskin 38da2b015f Avoid leaking the FunctionPassManager from opt.
llvm-svn: 99180
2010-03-22 15:56:04 +00:00
Gabor Greif e1517a084f backing out r99170 because it still fails on clang-x86_64-darwin10-fnt
llvm-svn: 99171
2010-03-22 09:11:00 +00:00
Gabor Greif 7a743e15e3 Now that hopefully all direct accesses to InvokeInst operands are fixed
we can reapply the InvokeInst operand reordering patch. (see r98957).

llvm-svn: 99170
2010-03-22 08:28:00 +00:00
Jeffrey Yasskin a6eedc3c03 Free all Constants in ~LLVMConstantImpl. We avoid assertion failures
by dropping all references from all constants that can use other
constants before trying to destroy any of them.

I also had to free bugpoint's Module in ~BugDriver().

llvm-svn: 99160
2010-03-22 05:23:37 +00:00
Erick Tryzelaar 77eede5776 Fix the ocaml kaleidoscope tutorial to fix linking external libraries.
llvm-svn: 99151
2010-03-21 23:15:13 +00:00
Gabor Greif 9f2284121a modernize the do-all-for-me target to run lit
llvm-svn: 99148
2010-03-21 22:23:02 +00:00
Jeffrey Yasskin cd3706cd1c Re-add the Metadata.h include to LLVMContextImpl.h so that MDNode is complete
where FoldingSet<MDNode> is instantiated.  Clang and MSVC complain; gcc
doesn't.

llvm-svn: 99147
2010-03-21 22:08:41 +00:00
Jeffrey Yasskin 4cfb3a7656 Move the LLVMContextImpl implementation into a .cpp file.
llvm-svn: 99146
2010-03-21 21:17:34 +00:00
Jeffrey Yasskin ade270e225 Memoize InlineAsms into the LLVMContext and delete them on shutdown.
Fixes PR803.

llvm-svn: 99143
2010-03-21 20:37:19 +00:00
Jeffrey Yasskin c91f200c17 XFAIL tests from LLVMC on valgrind or valgrind+leak-checking. We
don't care about leaks from tblgen, and I assume we don't care about
valgrind errors in llvm-gcc/g++.

llvm-svn: 99115
2010-03-21 08:12:46 +00:00
Jeffrey Yasskin 2e4b02d6c1 Free SavedLI even if SimpleRegisterCoalescing::JoinCopy() returns early.
llvm-svn: 99113
2010-03-21 01:47:49 +00:00
Jeffrey Yasskin 544cfd76e7 When we don't pass --vg-leak to lit, pass --leak-check=no to valgrind.
llvm-svn: 99112
2010-03-21 01:47:33 +00:00
Daniel Dunbar d177edf361 Fix suggested parentheses warning.
llvm-svn: 99111
2010-03-21 01:38:21 +00:00
Jeffrey Yasskin 2f87b54f1a Add support for XFAILing valgrind runs with memory leak checking independently
of runs without leak checking.  We add -vg to the triple for non-checked runs,
or -vg_leak for checked runs.  Also use this to XFAIL the TableGen tests, since
tablegen leaks like a sieve.  This includes some valgrindArgs refactoring.

llvm-svn: 99103
2010-03-20 23:08:45 +00:00
Daniel Dunbar fbd12cc36c MC/X86: Fix an MCOperand link, when we parsing shrld $1,%eax and friends; I believe this fixes the last memory leaks under test/MC.
llvm-svn: 99102
2010-03-20 22:36:38 +00:00
Daniel Dunbar d9d5b315ab llvm-mc: Fix MCInstPrinter memory leaks.
llvm-svn: 99101
2010-03-20 22:36:35 +00:00
Daniel Dunbar 98055cc154 MC/Mach-O: Remove Darwin host specific tests, we don't need them anymore.
llvm-svn: 99100
2010-03-20 22:36:32 +00:00
Daniel Dunbar 9f4f9f9cf4 MC/Mach-O: Tweak optimal_nop test to be host independent.
- This also avoids us running valgrind on /usr/bin/as, which has leaks. :)

llvm-svn: 99099
2010-03-20 22:36:29 +00:00
Daniel Dunbar c5621ed07a llvm-mc: Fix memory leak of MCAsmInfo.
llvm-svn: 99098
2010-03-20 22:36:25 +00:00
Daniel Dunbar fed917e078 TargetRegistry: Fix create{AsmInfo,MCDisassembler} to return non-const objects.
llvm-svn: 99097
2010-03-20 22:36:22 +00:00
Bob Wilson 162242b63b pr6652: Use LDM to restore PC to the return address on ARMv4.
Patch by John Tytgat!

llvm-svn: 99096
2010-03-20 22:20:40 +00:00
Bob Wilson ae08a736d6 Re-commit r98683 ("remove redundant writeback flag from ARM address mode 6")
with changes to add a separate optional register update argument.  Change all
the NEON instructions with address register writeback to use it.

llvm-svn: 99095
2010-03-20 22:13:40 +00:00
Bob Wilson 59e5141d44 Add instruction variants for VST2, VST3, and VST4 "store-lane" operations with
address register writeback.

llvm-svn: 99094
2010-03-20 21:57:36 +00:00
Bob Wilson b18adef4ad Add variants of VST2, VST3 and VST4 with address register writeback, and
rewrite the existing VST3 and VST4 instructions to use the same classes as
the others.

llvm-svn: 99093
2010-03-20 21:45:18 +00:00
Bob Wilson 89ba42c4ce Add instructions for double-spaced VST3 and VST4 without address register
writeback, and refactor the existing double-spaced VST2 instructions.
These are only for the disassembler since codegen doesn't use them, at
least for now.

llvm-svn: 99090
2010-03-20 21:15:48 +00:00
Daniel Dunbar e848de3911 tests: Mangle '-vg' onto the end of the triple when running under valgrind, so
we can use the standard XFAIL and XTARGET to conditional tests based on
valgrind.

llvm-svn: 99088
2010-03-20 21:12:48 +00:00
Gabor Greif febf6ab718 Add a setCalledFunction member to InvokeInst (like in CallInst)
and use this (as well as getCalledValue) to access the callee,
instead of {g|s}etOperand(0).

llvm-svn: 99084
2010-03-20 21:00:25 +00:00
Bob Wilson 322cbff3d3 Add VST1 instructions with address register writeback.
llvm-svn: 99083
2010-03-20 20:54:36 +00:00
Bob Wilson 9152d96dfb Add instruction variants for VLD2, VLD3, and VLD4 "load-lane" operations with
address register writeback.

llvm-svn: 99082
2010-03-20 20:47:18 +00:00
Bob Wilson 9b1584245a Tidy some more comments and whitespace.
llvm-svn: 99081
2010-03-20 20:39:53 +00:00
Bob Wilson cf324658f6 Add variants of VLD2, VLD3 and VLD4 with address register writeback, and
rewrite the existing VLD3 and VLD4 instructions to use the same classes as
the others.

llvm-svn: 99080
2010-03-20 20:10:51 +00:00
Bob Wilson 7ee900da22 Tidy some comments and whitespace for consistency.
llvm-svn: 99078
2010-03-20 19:57:03 +00:00
Bob Wilson c0795f8b87 Rename some instructions for consistency and sanity: use "_UPD" suffix for
load/stores with address register writeback, and use "odd" suffix to distinguish
instructions to access odd numbered registers (instead of "a" and "b").
No functional changes.

llvm-svn: 99066
2010-03-20 18:35:24 +00:00