Commit Graph

58839 Commits

Author SHA1 Message Date
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