Commit Graph

58971 Commits

Author SHA1 Message Date
Devang Patel
ea7b6bb323 Include isFunctionLocal while calculating folding node set provide for a MDNode.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@99484 91177308-0d34-0410-b5e6-96231b3b80d8
2010-03-25 05:36:13 +00:00
Eric Christopher
f27e6088a3 Reapply r99451 with a fix to move the NoInline check to the cost functions
instead of InlineFunction.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@99483 91177308-0d34-0410-b5e6-96231b3b80d8
2010-03-25 04:49:10 +00:00
Chris Lattner
3d7d07ef03 reapply 99444/99445, which I speculatively reverted in
r99453.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@99482 91177308-0d34-0410-b5e6-96231b3b80d8
2010-03-25 04:41:16 +00:00
Daniel Dunbar
5d428511ca MC: Route access to SectionData offset and file size through MCAsmLayout.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@99474 91177308-0d34-0410-b5e6-96231b3b80d8
2010-03-25 02:00:07 +00:00
Daniel Dunbar
432cd5fd9b MC: Route access to Fragment offset and effective size through MCAsmLayout.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@99473 91177308-0d34-0410-b5e6-96231b3b80d8
2010-03-25 02:00:02 +00:00
Eric Christopher
4750cb9da9 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.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@99472 91177308-0d34-0410-b5e6-96231b3b80d8
2010-03-25 01:46:07 +00:00
Evan Cheng
bfcb305189 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.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@99469 91177308-0d34-0410-b5e6-96231b3b80d8
2010-03-25 01:38:16 +00:00
Daniel Dunbar
7c3d45a03e MC: Eliminate MC{Fragment,{Section,Symbol}Data}::getAddress.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@99467 91177308-0d34-0410-b5e6-96231b3b80d8
2010-03-25 01:03:24 +00:00
Daniel Dunbar
e9cfd685f5 MC: Fix refacto in MCExpr evaluation, I mistakenly replaced a fragment address with a symbol address.
- This fixes the integrated-as nightly test regressions.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@99466 91177308-0d34-0410-b5e6-96231b3b80d8
2010-03-25 01:03:17 +00:00
Evan Cheng
48f2cb926e Avoid being influenced by dbg_value instructions.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@99465 91177308-0d34-0410-b5e6-96231b3b80d8
2010-03-25 01:01:37 +00:00
Eric Christopher
1f2ae40efd Fix unused parameter warning.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@99463 91177308-0d34-0410-b5e6-96231b3b80d8
2010-03-25 00:59:51 +00:00
Evan Cheng
cb0f06e05c 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.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@99455 91177308-0d34-0410-b5e6-96231b3b80d8
2010-03-25 00:10:31 +00:00
Dan Gohman
6a4824c466 Docuemntation corrections from John Myers.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@99454 91177308-0d34-0410-b5e6-96231b3b80d8
2010-03-25 00:03:04 +00:00
Chris Lattner
d41952da10 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.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@99453 91177308-0d34-0410-b5e6-96231b3b80d8
2010-03-24 23:41:19 +00:00
Eric Christopher
0623e90398 Temporarily revert this, it's causing an issue with an internal project.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@99451 91177308-0d34-0410-b5e6-96231b3b80d8
2010-03-24 23:35:21 +00:00
Bob Wilson
014dc4e720 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


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@99450 91177308-0d34-0410-b5e6-96231b3b80d8
2010-03-24 23:26:29 +00:00
Chris Lattner
375cf52638 add a convenient TargetInstrDesc::getNumImplicitUses/Defs method.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@99446 91177308-0d34-0410-b5e6-96231b3b80d8
2010-03-24 23:07:47 +00:00
Chris Lattner
4020670195 remove dead argument.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@99445 91177308-0d34-0410-b5e6-96231b3b80d8
2010-03-24 22:47:12 +00:00
Chris Lattner
c243dea003 split EmitNode in half to reduce indentation.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@99444 91177308-0d34-0410-b5e6-96231b3b80d8
2010-03-24 22:45:47 +00:00
Kevin Enderby
760c2f34d9 Added the Advanced Encryption Standard (AES) Instructions.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@99440 91177308-0d34-0410-b5e6-96231b3b80d8
2010-03-24 22:33:33 +00:00
Jim Grosbach
2676737e5e 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.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@99436 91177308-0d34-0410-b5e6-96231b3b80d8
2010-03-24 22:31:46 +00:00
Kevin Enderby
044be39090 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.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@99435 91177308-0d34-0410-b5e6-96231b3b80d8
2010-03-24 22:28:42 +00:00
Nate Begeman
1449f29100 Per chris's request, add some comments.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@99434 91177308-0d34-0410-b5e6-96231b3b80d8
2010-03-24 22:19:06 +00:00
Devang Patel
9bb59a2bdc Use SP filename directly instead of SP's context's filename.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@99429 91177308-0d34-0410-b5e6-96231b3b80d8
2010-03-24 21:30:35 +00:00
Johnny Chen
69631b1327 Trivial formating change.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@99428 91177308-0d34-0410-b5e6-96231b3b80d8
2010-03-24 21:25:07 +00:00
Nate Begeman
fdea31a463 BUILD_VECTOR was missing out on some prime opportunities to use SSE 4.1 inserts.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@99423 91177308-0d34-0410-b5e6-96231b3b80d8
2010-03-24 20:49:50 +00:00
Bob Wilson
d6a6b3b756 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


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@99419 91177308-0d34-0410-b5e6-96231b3b80d8
2010-03-24 20:25:25 +00:00
Evan Cheng
eb8c6459fc Move OptChkCall off LibCallOptimization into StrCpyOpt.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@99418 91177308-0d34-0410-b5e6-96231b3b80d8
2010-03-24 20:19:04 +00:00
Dan Gohman
51ecc389a9 Trim #includes.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@99416 91177308-0d34-0410-b5e6-96231b3b80d8
2010-03-24 19:56:17 +00:00
Johnny Chen
2fadd6b221 Reverted r99326 which added NVdVmVCVTFrm, and later renamed to NVCVTFrm.
NVCVTFrm will later be used to describe "vcvt with fractional bits".

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@99415 91177308-0d34-0410-b5e6-96231b3b80d8
2010-03-24 19:47:14 +00:00
Dan Gohman
16e02097d2 Fix minor style issues.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@99414 91177308-0d34-0410-b5e6-96231b3b80d8
2010-03-24 19:38:02 +00:00
Dan Gohman
34b96f4fb3 It's not necessary to call raw_ostream::close explicitly on automatic
raw_ostream variables immediately before they go out of scope.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@99413 91177308-0d34-0410-b5e6-96231b3b80d8
2010-03-24 19:00:02 +00:00
Devang Patel
8fe7979c41 Do not rely on getCompileUnit() to find source file information for a subprogram.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@99410 91177308-0d34-0410-b5e6-96231b3b80d8
2010-03-24 18:48:00 +00:00
Johnny Chen
7d85ac09f8 Reverted r99376. The disassembler will deal with the 2-reg format of these two
N3VX instructions using special case code.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@99409 91177308-0d34-0410-b5e6-96231b3b80d8
2010-03-24 18:46:34 +00:00
Jim Grosbach
35075a7e81 tweak the arm if conversion heuristic
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@99402 91177308-0d34-0410-b5e6-96231b3b80d8
2010-03-24 16:15:14 +00:00
Torok Edwin
15417383b9 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)


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@99400 91177308-0d34-0410-b5e6-96231b3b80d8
2010-03-24 13:50:36 +00:00
Gabor Greif
c9f7500d17 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.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@99399 91177308-0d34-0410-b5e6-96231b3b80d8
2010-03-24 13:21:49 +00:00
Gabor Greif
6d6aaeca4f tighten a type and remove trailing whitespace, no functional changes
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@99398 91177308-0d34-0410-b5e6-96231b3b80d8
2010-03-24 11:58:07 +00:00
Gabor Greif
bd1f99341e increase const goodness and remove pointless getUser() calls
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@99395 91177308-0d34-0410-b5e6-96231b3b80d8
2010-03-24 10:29:52 +00:00
Gabor Greif
5eff285d8d cache result of UI.getOperandNo() instead of calling it twice, it is cheaper this way
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@99394 91177308-0d34-0410-b5e6-96231b3b80d8
2010-03-24 10:12:54 +00:00
Duncan Sands
bbdca3f68e Fix comment typo.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@99392 91177308-0d34-0410-b5e6-96231b3b80d8
2010-03-24 09:05:14 +00:00
Daniel Dunbar
207e06ea04 MC: Direct all {fragment,section,symbol} address access through the MCAsmLayout object.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@99380 91177308-0d34-0410-b5e6-96231b3b80d8
2010-03-24 03:43:40 +00:00
Evan Cheng
2250425d6e dbg_value may end a block.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@99378 91177308-0d34-0410-b5e6-96231b3b80d8
2010-03-24 01:50:28 +00:00
Johnny Chen
b7ba5781e6 Mark VMOVDneon and VMOVQ as having the N2RegFrm form to help the disassembler.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@99376 91177308-0d34-0410-b5e6-96231b3b80d8
2010-03-24 01:29:25 +00:00
Chris Lattner
c54a2f150d Switch INC8r to defining its pattern in terms of X86inc_flag
and defining the add pattern with Pat<>, eliminating a use of
parallel.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@99375 91177308-0d34-0410-b5e6-96231b3b80d8
2010-03-24 01:02:12 +00:00
Johnny Chen
c5f413a74c Renamed NVdVmImmFrm and NVdVmVCVTFrm to the more proper N2RegFrm and NVCVTFrm,
respectively, and add some more comment.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@99373 91177308-0d34-0410-b5e6-96231b3b80d8
2010-03-24 00:57:50 +00:00
Dan Gohman
0f920e55fc Remove the ConvertActions table and associated code, which is unused.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@99372 91177308-0d34-0410-b5e6-96231b3b80d8
2010-03-24 00:53:38 +00:00
Chris Lattner
8ee0769612 Add a method to get a StringMapEntry from a pointer to the string
data it contains (similar to GetStringMapEntryFromValue).  
Patch by Greg Clayton!


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@99371 91177308-0d34-0410-b5e6-96231b3b80d8
2010-03-24 00:53:27 +00:00
Chris Lattner
1aec4d7596 switch SDTBinaryArithWithFlags to be a multiple-result node as well.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@99370 91177308-0d34-0410-b5e6-96231b3b80d8
2010-03-24 00:49:29 +00:00
Chris Lattner
74c8d67af8 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.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@99369 91177308-0d34-0410-b5e6-96231b3b80d8
2010-03-24 00:47:47 +00:00