Commit Graph

7421 Commits

Author SHA1 Message Date
Devang Patel
c580144f41 Fix grammer.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@56795 91177308-0d34-0410-b5e6-96231b3b80d8
2008-09-29 18:16:38 +00:00
Duncan Sands
5df3186f59 Rename isWeakForLinker to mayBeOverridden. Use it
instead of hasWeakLinkage in a bunch of optimization
passes.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@56782 91177308-0d34-0410-b5e6-96231b3b80d8
2008-09-29 11:25:42 +00:00
Daniel Dunbar
7a3ec1e148 Add IRBuilder::{CreateIsNull, CreateIsNonNull} helper methods.
- I'm open to the idea that these could have better names. I think
   these read better than CreateEQNull and CreateNENull.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@56757 91177308-0d34-0410-b5e6-96231b3b80d8
2008-09-27 23:22:55 +00:00
Evan Cheng
184793fc8a Re-apply 56683 with fixes.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@56748 91177308-0d34-0410-b5e6-96231b3b80d8
2008-09-27 01:56:22 +00:00
Bill Wendling
0b3c079cd5 Add missing #include for asserts.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@56718 91177308-0d34-0410-b5e6-96231b3b80d8
2008-09-27 00:08:24 +00:00
Devang Patel
2c9c3e7368 Implement function notes as function attributes.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@56716 91177308-0d34-0410-b5e6-96231b3b80d8
2008-09-26 23:51:19 +00:00
Devang Patel
19c874638d Now Attributes are divided in three groups
- return attributes - inreg, zext and sext
- parameter attributes
- function attributes - nounwind, readonly, readnone, noreturn

Return attributes use 0 as the index.
Function attributes use ~0U as the index.

This patch requires corresponding changes in llvm-gcc and clang.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@56704 91177308-0d34-0410-b5e6-96231b3b80d8
2008-09-26 22:53:05 +00:00
Bill Wendling
d5d8191b20 Temporarily reverting r56683. This is causing a failure during the build of llvm-gcc:
/Volumes/Gir/devel/llvm/clean/llvm-gcc.obj/./gcc/xgcc -B/Volumes/Gir/devel/llvm/clean/llvm-gcc.obj/./gcc/ -B/Volumes/Gir/devel/llvm/clean/llvm-gcc.install/i386-apple-darwin9.5.0/bin/ -B/Volumes/Gir/devel/llvm/clean/llvm-gcc.install/i386-apple-darwin9.5.0/lib/ -isystem /Volumes/Gir/devel/llvm/clean/llvm-gcc.install/i386-apple-darwin9.5.0/include -isystem /Volumes/Gir/devel/llvm/clean/llvm-gcc.install/i386-apple-darwin9.5.0/sys-include -mmacosx-version-min=10.4 -O2  -O2 -g -O2  -DIN_GCC    -W -Wall -Wwrite-strings -Wstrict-prototypes -Wmissing-prototypes -Wold-style-definition  -isystem ./include  -fPIC -pipe -g -DHAVE_GTHR_DEFAULT -DIN_LIBGCC2 -D__GCC_FLOAT_NOT_NEEDED  -I. -I. -I../../llvm-gcc.src/gcc -I../../llvm-gcc.src/gcc/. -I../../llvm-gcc.src/gcc/../include -I./../intl -I../../llvm-gcc.src/gcc/../libcpp/include  -I../../llvm-gcc.src/gcc/../libdecnumber -I../libdecnumber -I/Volumes/Gir/devel/llvm/clean/llvm.obj/include -I/Volumes/Gir/devel/llvm/clean/llvm.src/include -fexceptions -fvisibility=hidden -DHIDE_EXPORTS -c ../../llvm-gcc.src/gcc/unwind-dw2-fde-darwin.c -o libgcc/./unwind-dw2-fde-darwin.o
Assertion failed: (TargetRegisterInfo::isVirtualRegister(regA) && TargetRegisterInfo::isVirtualRegister(regB) && "cannot update physical register live information"), function runOnMachineFunction, file /Volumes/Gir/devel/llvm/clean/llvm.src/lib/CodeGen/TwoAddressInstructionPass.cpp, line 311.
../../llvm-gcc.src/gcc/unwind-dw2.c:1527: internal compiler error: Abort trap
Please submit a full bug report,
with preprocessed source if appropriate.
See <URL:http://developer.apple.com/bugreporter> for instructions.
{standard input}:3521:non-relocatable subtraction expression, "_dwarf_reg_size_table" minus "L20$pb"
{standard input}:3521:symbol: "_dwarf_reg_size_table" can't be undefined in a subtraction expression
{standard input}:3520:non-relocatable subtraction expression, "_dwarf_reg_size_table" minus "L20$pb"
...


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@56703 91177308-0d34-0410-b5e6-96231b3b80d8
2008-09-26 22:10:44 +00:00
Dan Gohman
7810bfed55 Rename ConstantSDNode's getSignExtended to getSExtValue, for
consistancy with ConstantInt, and re-implement it in terms
of ConstantInt's getSExtValue.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@56700 91177308-0d34-0410-b5e6-96231b3b80d8
2008-09-26 21:54:37 +00:00
Dan Gohman
f275250333 Make some minor reorganizations and comment changes to eliminate trivial
differences between the CallInst and InvokeInst classes.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@56699 91177308-0d34-0410-b5e6-96231b3b80d8
2008-09-26 21:38:45 +00:00
Evan Cheng
36a55023c1 Fix @llvm.frameaddress codegen. FP elimination optimization should be disabled when frame address is desired. Also add support for depth > 0.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@56683 91177308-0d34-0410-b5e6-96231b3b80d8
2008-09-26 19:48:35 +00:00
Dale Johannesen
86098bd6a6 Add "inreg" field to CallSDNode (doesn't increase
its size).  Adjust various lowering functions to
pass this info through from CallInst.  Use it to
implement sseregparm returns on X86.  Remove
X86_ssecall calling convention.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@56677 91177308-0d34-0410-b5e6-96231b3b80d8
2008-09-26 19:31:26 +00:00
Bill Wendling
d751c64a67 If we have a function with an unreachable statement such that the ending debug
information is in an unreachable block, then it's possible that the high/low pc
values won't be set for the dwarf information. E.g., this function:

void abort(void) __attribute__((__noreturn__));
void dead_beef(void) __attribute__ ((noreturn));

int *b;

void dead_beef(void) {
  *b=0xdeadbeef;
  abort();
}

has a call to "@llvm.dbg.region.end" only in the unreachable block:

define void @dead_beef() noreturn nounwind  {
entry:
	call void @llvm.dbg.func.start(...)
	call void @llvm.dbg.stoppoint(...)
...
	call void @abort( ) noreturn nounwind 
	unreachable

return:		; No predecessors!
	call void @llvm.dbg.stoppoint(...)
	call void @llvm.dbg.region.end(...)
	ret void
}

The dwarf information emitted is something like:

0x00000084:     TAG_subprogram [5]  
                 AT_name( "dead_beef" )
                 AT_external( 0x01 )
                 AT_prototyped( 0x01 )
                 AT_decl_file( 0x01 )
                 AT_decl_line( 0x08 )

Note that this is *not* the best fix for this problem, but a band-aid for an
gaping wound. This code needs to be changed when we revamp our debugging
information.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@56628 91177308-0d34-0410-b5e6-96231b3b80d8
2008-09-26 00:28:12 +00:00
Bill Wendling
c4f72dd6e7 Make pointer parameter const for isUsedInBasicBlock.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@56625 91177308-0d34-0410-b5e6-96231b3b80d8
2008-09-25 22:42:01 +00:00
Devang Patel
0598866c05 Large mechanical patch.
s/ParamAttr/Attribute/g
s/PAList/AttrList/g
s/FnAttributeWithIndex/AttributeWithIndex/g
s/FnAttr/Attribute/g

This sets the stage 
- to implement function notes as function attributes and 
- to distinguish between function attributes and return value attributes.

This requires corresponding changes in llvm-gcc and clang.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@56622 91177308-0d34-0410-b5e6-96231b3b80d8
2008-09-25 21:00:45 +00:00
Anton Korobeynikov
32b952a2a6 Reapply 56585:56589 with proper fix for some gcc versions
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@56621 91177308-0d34-0410-b5e6-96231b3b80d8
2008-09-25 21:00:33 +00:00
Dale Johannesen
c9c6da61ac Accept 'inreg' attribute on x86 functions as
meaning sse_regparm (i.e. float/double values go
in XMM0 instead of ST0).  Update documentation
to reflect reality.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@56619 91177308-0d34-0410-b5e6-96231b3b80d8
2008-09-25 20:47:45 +00:00
Dan Gohman
33134c4a75 FastISel support for debug info.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@56610 91177308-0d34-0410-b5e6-96231b3b80d8
2008-09-25 17:05:24 +00:00
Evan Cheng
688535e005 Temporarily backing out 56585:56589 to unbreak the build.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@56607 91177308-0d34-0410-b5e6-96231b3b80d8
2008-09-25 07:38:08 +00:00
Dan Gohman
2c4bf119be Enable DeadMachineInstructionElim when Fast-ISel is enabled.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@56604 91177308-0d34-0410-b5e6-96231b3b80d8
2008-09-25 01:14:49 +00:00
Dan Gohman
02dae4ba06 Refactor the code that adds standard LLVM codegen passes into
a separate function, eliminating duplication between the
add-passes-for-file and add-passes-for-machine-code code.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@56599 91177308-0d34-0410-b5e6-96231b3b80d8
2008-09-25 00:37:07 +00:00
Anton Korobeynikov
b7679bd0cb Finally get rid of virtual inheritance in TAI
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@56589 91177308-0d34-0410-b5e6-96231b3b80d8
2008-09-24 22:23:17 +00:00
Anton Korobeynikov
8490322fa9 Use crazy template-based inheritance instead of virtual one.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@56585 91177308-0d34-0410-b5e6-96231b3b80d8
2008-09-24 22:21:39 +00:00
Anton Korobeynikov
00181a33d8 Get rid of ReadOnlySection duplicate
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@56582 91177308-0d34-0410-b5e6-96231b3b80d8
2008-09-24 22:20:27 +00:00
Anton Korobeynikov
6481873dc0 Get rid of now unused {Four,Eight,Sixteen}ByteConstantSection
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@56580 91177308-0d34-0410-b5e6-96231b3b80d8
2008-09-24 22:18:54 +00:00
Anton Korobeynikov
088ae8393f Use generic section-handling stuff to emit constant pool entries
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@56579 91177308-0d34-0410-b5e6-96231b3b80d8
2008-09-24 22:17:59 +00:00
Anton Korobeynikov
36133dd324 Get rid of duplicate char*/Section* stuff for TLS sections
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@56577 91177308-0d34-0410-b5e6-96231b3b80d8
2008-09-24 22:17:06 +00:00
Anton Korobeynikov
315690ec2a Get rid of duplicate char*/Section* DataSection
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@56575 91177308-0d34-0410-b5e6-96231b3b80d8
2008-09-24 22:16:16 +00:00
Anton Korobeynikov
d7ca416d6c Get rid of duplicate char*/Section* TextSection
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@56574 91177308-0d34-0410-b5e6-96231b3b80d8
2008-09-24 22:15:21 +00:00
Anton Korobeynikov
c25e1ea5e9 Move actual section printing stuff to AsmPrinter from TAI reducing heap traffic.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@56573 91177308-0d34-0410-b5e6-96231b3b80d8
2008-09-24 22:14:23 +00:00
Anton Korobeynikov
0c8e80607b Drop obsolete hook and change all usage to new interface
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@56572 91177308-0d34-0410-b5e6-96231b3b80d8
2008-09-24 22:13:07 +00:00
Anton Korobeynikov
b5a32e2e8c Provide direct function to switch to Section
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@56571 91177308-0d34-0410-b5e6-96231b3b80d8
2008-09-24 22:12:10 +00:00
Evan Cheng
446531e7bb Add DisableGVCompilation which forces the JIT to assert when it tries to allocate space for a GlobalVariable.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@56557 91177308-0d34-0410-b5e6-96231b3b80d8
2008-09-24 16:25:55 +00:00
Bill Wendling
f3cbca279d Reapplying r56550
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@56553 91177308-0d34-0410-b5e6-96231b3b80d8
2008-09-24 10:25:02 +00:00
Eric Christopher
83e05c48de Temporarily revert r56550 until missing commit can be added.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@56551 91177308-0d34-0410-b5e6-96231b3b80d8
2008-09-24 08:30:44 +00:00
Bill Wendling
df0c7bc52d Refactor the constant folding code into it's own function. And call it from both
the SelectionDAG and DAGCombiner code. The only functionality change is that now
the DAG combiner is performing the constant folding for these operations instead
of being a no-op.

This is *not* in response to a bug, so there isn't a testcase.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@56550 91177308-0d34-0410-b5e6-96231b3b80d8
2008-09-24 07:11:26 +00:00
Dale Johannesen
86b49f8e2d Next round of earlyclobber handling. Approach the
RA problem by expanding the live interval of an
earlyclobber def back one slot.  Remove
overlap-earlyclobber throughout.  Remove 
earlyclobber bits and their handling from
live internals.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@56539 91177308-0d34-0410-b5e6-96231b3b80d8
2008-09-24 01:07:17 +00:00
Devang Patel
e3d76d37e9 s/ParamAttrsWithIndex/FnAttributeWithIndex/g
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@56535 91177308-0d34-0410-b5e6-96231b3b80d8
2008-09-24 00:55:02 +00:00
Devang Patel
1e48000966 s/ParamAttributeListImpl/AttributeListImpl/g
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@56532 91177308-0d34-0410-b5e6-96231b3b80d8
2008-09-24 00:29:49 +00:00
Dan Gohman
3e4fb70c6a Add a method to MachineInstr for testing whether it makes
any volatile memory references.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@56528 91177308-0d34-0410-b5e6-96231b3b80d8
2008-09-24 00:06:15 +00:00
Devang Patel
20bcaff6a7 Put FN_NOTE_AlwaysInline and others in FnAttr namespace.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@56527 91177308-0d34-0410-b5e6-96231b3b80d8
2008-09-24 00:06:15 +00:00
Evan Cheng
da43bcf624 Properly handle 'm' inline asm constraints. If a GV is being selected for the addressing mode, it requires the same logic for PIC relative addressing, etc.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@56526 91177308-0d34-0410-b5e6-96231b3b80d8
2008-09-24 00:05:32 +00:00
Devang Patel
dd4924c564 Move FN_NOTE_AlwaysInline and other out of ParamAttrs namespace.
Do not check isDeclaration() in hasNote(). It is clients' responsibility.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@56524 91177308-0d34-0410-b5e6-96231b3b80d8
2008-09-23 23:52:03 +00:00
Devang Patel
06117b6598 80 cols
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@56521 91177308-0d34-0410-b5e6-96231b3b80d8
2008-09-23 23:32:15 +00:00
Devang Patel
b700c3f367 Remove tabs.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@56515 91177308-0d34-0410-b5e6-96231b3b80d8
2008-09-23 23:18:26 +00:00
Devang Patel
eaf42abab6 s/ParameterAttributes/Attributes/g
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@56513 91177308-0d34-0410-b5e6-96231b3b80d8
2008-09-23 23:03:40 +00:00
Devang Patel
d9b4a5f859 Use parameter attribute store (soon to be renamed) for
Function Notes also. Function notes are stored at index ~0.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@56511 91177308-0d34-0410-b5e6-96231b3b80d8
2008-09-23 22:35:17 +00:00
Dan Gohman
d57dd5f4e6 Arrange for FastISel code to have access to the MachineModuleInfo
object. This will be needed to support debug info.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@56508 91177308-0d34-0410-b5e6-96231b3b80d8
2008-09-23 21:53:34 +00:00
Chris Lattner
013766707b allow inreg on the result of a function
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@56501 91177308-0d34-0410-b5e6-96231b3b80d8
2008-09-23 21:18:08 +00:00
Dan Gohman
987756308b Update the comment to reflect the new name.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@56496 91177308-0d34-0410-b5e6-96231b3b80d8
2008-09-23 18:27:53 +00:00