Dan Gohman [Fri, 31 Jul 2009 23:37:33 +0000 (23:37 +0000)]
Use setPreservesAll and setPreservesCFG in CodeGen passes.
llvm-svn: 77754
Dan Gohman [Fri, 31 Jul 2009 23:36:22 +0000 (23:36 +0000)]
SelectionDAGISel does not "preserve all", since it makes lots of changes
to the MachineFunction.
llvm-svn: 77753
Dan Gohman [Fri, 31 Jul 2009 23:36:06 +0000 (23:36 +0000)]
Use a range insert instead of an explicit loop.
llvm-svn: 77752
Mike Stump [Fri, 31 Jul 2009 23:15:31 +0000 (23:15 +0000)]
Add beginnigs of rtti generation, wire up more of -fno-exceptions.
llvm-svn: 77751
Daniel Dunbar [Fri, 31 Jul 2009 23:13:12 +0000 (23:13 +0000)]
llvm-mc: Add -triple, and fix some typos
llvm-svn: 77750
Daniel Dunbar [Fri, 31 Jul 2009 23:04:32 +0000 (23:04 +0000)]
llvm-mc: Fix .s output to quote section & symbol names when necessary.
llvm-svn: 77749
Owen Anderson [Fri, 31 Jul 2009 22:45:43 +0000 (22:45 +0000)]
Privatize all but one of the remaining constant tables.
llvm-svn: 77748
Bob Wilson [Fri, 31 Jul 2009 22:41:21 +0000 (22:41 +0000)]
Allow target intrinsics that return multiple values, i.e., struct types,
in SelectionDAGLowering::visitTargetIntrinsic.
This removes a bit of special-case code for vector types. After staring
at it for a while, I managed to convince myself that it is not necessary.
The only case where TLI.getValueType() differs from MVT::getMVT is for iPTR,
so this code could potentially make a difference for a vector of pointers.
But, it looks like that is not supported. Calling TLI.getValueType() on
a vector of pointers leads to the following sequence of calls:
TargetLowering::getValueType
MVT::getMVT
MVT::getVectorVT(iPTR, num elements)
MVT::getExtendedVectorVT
MVT::getTypeForMVT for iPTR
assertion fails "Type is not extended!"
So, unless I'm really missing something, this bit of code is irrelevant to
the current version of LLVM, which is consistent with the fact that I don't
see this code in other similar places.
llvm-svn: 77747
Mikhail Glushenkov [Fri, 31 Jul 2009 22:24:20 +0000 (22:24 +0000)]
Add a warning.
llvm-svn: 77746
Daniel Dunbar [Fri, 31 Jul 2009 22:22:54 +0000 (22:22 +0000)]
llvm-mc: A few more parsing / match tweaks.
- Operands which are just a label should be parsed as immediates, not memory
operands (from the assembler perspective).
- Match a few more flavors of immediates.
- Distinguish match functions for memory operands which don't take a segment
register.
- We match the .s for "hello world" now!
llvm-svn: 77745
Evan Cheng [Fri, 31 Jul 2009 22:22:22 +0000 (22:22 +0000)]
t2BR_JT is mov pc, it's 2 byte long, not 4.
llvm-svn: 77744
Evan Cheng [Fri, 31 Jul 2009 22:21:55 +0000 (22:21 +0000)]
Thumb2 movcc need .w suffix.
llvm-svn: 77743
Chris Lattner [Fri, 31 Jul 2009 22:18:14 +0000 (22:18 +0000)]
add some comments on how this is *supposed* to work. We don't
need the PreferredEHDataFormat hook, but I have yet-more refactoring to
do before I can zap it.
llvm-svn: 77742
Chris Lattner [Fri, 31 Jul 2009 22:03:47 +0000 (22:03 +0000)]
rearrange a conditional. Even if this weren't #if 0'd out, this would
have no functionality change.
llvm-svn: 77741
David Greene [Fri, 31 Jul 2009 21:57:10 +0000 (21:57 +0000)]
Simplify operand padding by keying off tabs in the asm stream. If
padding is disabled, tabs get replaced by spaces except in the case of
the first operand, where the tab is output to line up the operands after
the mnemonics.
Add some better comments and eliminate redundant code.
Fix some testcases to not assume tabs.
llvm-svn: 77740
Daniel Dunbar [Fri, 31 Jul 2009 21:55:09 +0000 (21:55 +0000)]
llvm-mc: Support quoted identifiers.
- Uses MCAsmToken::getIdentifier which returns the (sub)string representing the
meaningfull contents a string or identifier token.
- Directives aren't done yet.
llvm-svn: 77739
Anders Carlsson [Fri, 31 Jul 2009 21:48:56 +0000 (21:48 +0000)]
Remove the old struct builder code.
llvm-svn: 77738
Mike Stump [Fri, 31 Jul 2009 21:43:43 +0000 (21:43 +0000)]
And now we can generate a simple vtable. Still a work in progress...
llvm-svn: 77737
Chris Lattner [Fri, 31 Jul 2009 21:39:55 +0000 (21:39 +0000)]
PreferredEHDataFormat is always call with data and global, but this whole
thing is #if0'd out anyway. Just simplify the code by reducing the interface.
Not deleting this is essential for Bill's continuing happiness.
llvm-svn: 77736
Anders Carlsson [Fri, 31 Jul 2009 21:38:39 +0000 (21:38 +0000)]
Move code from EmitUnion directly into the function that handles cast-to-union.
llvm-svn: 77735
Owen Anderson [Fri, 31 Jul 2009 21:38:10 +0000 (21:38 +0000)]
Fix unit tests.
llvm-svn: 77734
Owen Anderson [Fri, 31 Jul 2009 21:35:40 +0000 (21:35 +0000)]
Move the metadata constructors back to 2.5 syntax.
llvm-svn: 77733
Anders Carlsson [Fri, 31 Jul 2009 21:34:04 +0000 (21:34 +0000)]
Use the struct builder for unions.
llvm-svn: 77732
Mike Stump [Fri, 31 Jul 2009 21:31:32 +0000 (21:31 +0000)]
Fixup spacing and 80-col violations.
llvm-svn: 77731
Benjamin Kramer [Fri, 31 Jul 2009 20:56:31 +0000 (20:56 +0000)]
Update unittest for LLVM API change.
llvm-svn: 77730
Dan Gohman [Fri, 31 Jul 2009 20:56:29 +0000 (20:56 +0000)]
LibCallAliasAnalysis doesn't use TargetData.
llvm-svn: 77729
Daniel Dunbar [Fri, 31 Jul 2009 20:53:16 +0000 (20:53 +0000)]
llvm-mc/X86: Sketch match functions for immediates and memory operands.
Also, change scale value to always be 1 when unspecified to machine MachineInst
encoding.
llvm-svn: 77728
Dan Gohman [Fri, 31 Jul 2009 20:53:12 +0000 (20:53 +0000)]
Make TargetData optional in MemoryDependenceAnalysis.
llvm-svn: 77727
Chris Lattner [Fri, 31 Jul 2009 20:52:39 +0000 (20:52 +0000)]
move emitUsedDirectiveFor to TargetLoweringObjectFile and rename it to
indicate that it is a predicate, not an emitter. This eliminates TAI
dependencies on Mangler and GlobalValue.
llvm-svn: 77726
Dan Gohman [Fri, 31 Jul 2009 20:47:45 +0000 (20:47 +0000)]
Remove an unnecessary header.
llvm-svn: 77725
Chris Lattner [Fri, 31 Jul 2009 20:43:26 +0000 (20:43 +0000)]
remove the PPCLinuxTargetAsmInfo implementation of PreferredEHDataFormat,
because it just calls the default impl.
Remove the PPCDarwinTargetAsmInfo version of PreferredEHDataFormat because
it just returns DW_EH_PE_absptr unless on 10.6. However, 10.6 doesn't support
PPC, so the default impl is just fine.
llvm-svn: 77724
Chris Lattner [Fri, 31 Jul 2009 20:36:15 +0000 (20:36 +0000)]
remove a pointless override.
llvm-svn: 77723
Owen Anderson [Fri, 31 Jul 2009 20:28:54 +0000 (20:28 +0000)]
Update for LLVM API change.
llvm-svn: 77722
Owen Anderson [Fri, 31 Jul 2009 20:28:14 +0000 (20:28 +0000)]
Move a few more APIs back to 2.5 forms. The only remaining ones left to change back are
metadata related, which I'm waiting on to avoid conflicting with Devang.
llvm-svn: 77721
Dan Gohman [Fri, 31 Jul 2009 20:24:18 +0000 (20:24 +0000)]
Fix GVN's debug output, now that operator<< on Value* doesn't print
a trailing newline.
llvm-svn: 77719
Eric Christopher [Fri, 31 Jul 2009 20:07:27 +0000 (20:07 +0000)]
Whitespace and 80-col cleanup.
llvm-svn: 77718
Bill Wendling [Fri, 31 Jul 2009 19:52:24 +0000 (19:52 +0000)]
- Convert the rest of the DOUTs to DEBUG+errs().
- One formatting change.
No intended functionality change.
llvm-svn: 77717
Eli Friedman [Fri, 31 Jul 2009 19:36:47 +0000 (19:36 +0000)]
PR4662: Fix a crash introduced by the recent LLVMContext changes.
llvm-svn: 77716
Dan Gohman [Fri, 31 Jul 2009 19:26:54 +0000 (19:26 +0000)]
Fix a typo in a comment.
llvm-svn: 77715
Benjamin Kramer [Fri, 31 Jul 2009 19:12:33 +0000 (19:12 +0000)]
Adjust unit test for the MCSection changes.
llvm-svn: 77714
Argyrios Kyrtzidis [Fri, 31 Jul 2009 19:02:11 +0000 (19:02 +0000)]
For a CXXOperatorCallExpr, fix the order that StmtLocResolver uses to check subexpressions.
llvm-svn: 77713
Dan Gohman [Fri, 31 Jul 2009 18:59:29 +0000 (18:59 +0000)]
Delete spurious semicolons.
llvm-svn: 77712
Benjamin Kramer [Fri, 31 Jul 2009 18:58:46 +0000 (18:58 +0000)]
Fix build.
llvm-svn: 77711
Ted Kremenek [Fri, 31 Jul 2009 18:50:22 +0000 (18:50 +0000)]
Update CMake files.
llvm-svn: 77709
Chris Lattner [Fri, 31 Jul 2009 18:48:30 +0000 (18:48 +0000)]
switch off of 'Section' onto MCSection. We're not properly using
MCSection subclasses yet, but this is a step in the right direction.
llvm-svn: 77708
Douglas Gregor [Fri, 31 Jul 2009 18:36:42 +0000 (18:36 +0000)]
Make the recanonicalization-for-an-out-of-line-definition test case a bit trickier
llvm-svn: 77707
Dan Gohman [Fri, 31 Jul 2009 18:36:25 +0000 (18:36 +0000)]
Remove Annotation.h, which is no longer used in the LLVM tree.
llvm-svn: 77706
Evan Cheng [Fri, 31 Jul 2009 18:35:56 +0000 (18:35 +0000)]
Until we have a "ALIGN" pseudo instruction, have asm printer emitted a .align
to ensure the instruction that follows a TBB (when the number of table entries
is odd) is 2-byte aligned.
Patch by Sandeep Patel.
llvm-svn: 77705
Dan Gohman [Fri, 31 Jul 2009 18:35:51 +0000 (18:35 +0000)]
MachineFunction no longer needs Annotation.
llvm-svn: 77704
Douglas Gregor [Fri, 31 Jul 2009 18:34:30 +0000 (18:34 +0000)]
Allow one to update the type representation of the declaration specifiers. Will be used by an upcoming commit.
llvm-svn: 77703
Douglas Gregor [Fri, 31 Jul 2009 18:32:42 +0000 (18:32 +0000)]
Remove a redundant getCanonicalType call
llvm-svn: 77702
Evan Cheng [Fri, 31 Jul 2009 18:28:05 +0000 (18:28 +0000)]
- Teach TBB / TBH offset limits are 510 and 131070 respectively since the offset
is scaled by two.
- Teach GetInstSizeInBytes about TBB and TBH.
llvm-svn: 77701
Chris Lattner [Fri, 31 Jul 2009 18:27:48 +0000 (18:27 +0000)]
fix some more issues where we expected GetSection to do "get or create"
llvm-svn: 77700
Mike Stump [Fri, 31 Jul 2009 18:25:34 +0000 (18:25 +0000)]
Add code to setup the vtable pointer in the constructor. Work in progress.
llvm-svn: 77699
Devang Patel [Fri, 31 Jul 2009 18:24:12 +0000 (18:24 +0000)]
New test case for rev. 77694.
llvm-svn: 77698
Dan Gohman [Fri, 31 Jul 2009 18:23:24 +0000 (18:23 +0000)]
Fix printing of Alloca instructions with null operands.
llvm-svn: 77697
Dan Gohman [Fri, 31 Jul 2009 18:21:48 +0000 (18:21 +0000)]
Fix some problems with ASTCallbackVH in its use as a DenseMap key.
llvm-svn: 77696
Dan Gohman [Fri, 31 Jul 2009 18:20:18 +0000 (18:20 +0000)]
Teach ValueHandleBase to treat DenseMap's special Empty and Tombstone
values the same way it treats null pointers. This is needed to allow
CallbackVH to be used as a key in a DenseMap.
llvm-svn: 77695
Devang Patel [Fri, 31 Jul 2009 18:18:52 +0000 (18:18 +0000)]
Process DbgDeclareInst.
llvm-svn: 77694
Dan Gohman [Fri, 31 Jul 2009 18:18:19 +0000 (18:18 +0000)]
Split DenseMapInfo into a separate header file, so that it can be
included separately.
llvm-svn: 77693
Daniel Dunbar [Fri, 31 Jul 2009 18:16:53 +0000 (18:16 +0000)]
Normalize target registration code.
llvm-svn: 77692
Dan Gohman [Fri, 31 Jul 2009 18:16:33 +0000 (18:16 +0000)]
Reapply r77654 with a fix: MachineFunctionPass's getAnalysisUsage
shouldn't do AU.setPreservesCFG(), because even though CodeGen passes
don't modify the LLVM IR CFG, they may modify the MachineFunction CFG,
and passes like MachineLoop are registered with isCFGOnly set to true.
llvm-svn: 77691
Daniel Dunbar [Fri, 31 Jul 2009 18:12:18 +0000 (18:12 +0000)]
MultiTestRunner: Fix invalid warning when pointing 'lit' directly at a test.
llvm-svn: 77690
Chris Lattner [Fri, 31 Jul 2009 17:47:16 +0000 (17:47 +0000)]
fix a bunch of failing tests now that MCContext::GetSection doesn't create sections.
llvm-svn: 77689
Mike Stump [Fri, 31 Jul 2009 17:46:44 +0000 (17:46 +0000)]
Fix spacing.
llvm-svn: 77688
Chris Lattner [Fri, 31 Jul 2009 17:42:42 +0000 (17:42 +0000)]
refactor section construction in TLOF to be through an explicit
initialize method, which can be called when an MCContext is available.
llvm-svn: 77687
Owen Anderson [Fri, 31 Jul 2009 17:39:36 +0000 (17:39 +0000)]
Update for LLVM API change.
llvm-svn: 77686
Owen Anderson [Fri, 31 Jul 2009 17:39:07 +0000 (17:39 +0000)]
Move getTrue() and getFalse() to 2.5-like APIs.
llvm-svn: 77685
Chris Lattner [Fri, 31 Jul 2009 17:02:00 +0000 (17:02 +0000)]
split MCSection stuff out to its own .cpp file, add a new
MCSectionWithKind subclass of MCSection.
llvm-svn: 77684
Douglas Gregor [Fri, 31 Jul 2009 16:50:39 +0000 (16:50 +0000)]
Fix 80-col violation
llvm-svn: 77683
Chris Lattner [Fri, 31 Jul 2009 16:47:16 +0000 (16:47 +0000)]
move the sectionkind and section classes to TargetLoweringObjectFile.h
llvm-svn: 77681
Chris Lattner [Fri, 31 Jul 2009 16:43:49 +0000 (16:43 +0000)]
create sections with MCSection::Create instead of Context->getOrCreateSection.
This is needed to allow polymorphic sections.
llvm-svn: 77680
Chris Lattner [Fri, 31 Jul 2009 16:17:13 +0000 (16:17 +0000)]
fix PR4650: we only track sizes for certain objects, so only put something
into the mergable section if it is one of our special cases. This could
obviously be improved, but this is the minimal fix and restores us to the
previous behavior.
llvm-svn: 77679
Douglas Gregor [Fri, 31 Jul 2009 16:07:31 +0000 (16:07 +0000)]
Make canonicalization of overloaded function declarations match the
Itanium C++ ABI's name mangling, since both are related to the notion
of "equivalent" function templates.
llvm-svn: 77678
Douglas Gregor [Fri, 31 Jul 2009 15:46:56 +0000 (15:46 +0000)]
Canonicalize template template parameters. We can't test this yet, but
it's "obviously correct" :)
llvm-svn: 77677
Douglas Gregor [Fri, 31 Jul 2009 15:45:02 +0000 (15:45 +0000)]
Canonicalize function parameters
llvm-svn: 77676
Benjamin Kramer [Fri, 31 Jul 2009 14:22:13 +0000 (14:22 +0000)]
Work around a dangling pointer dereference when enumerating NamedMDNodes.
llvm-svn: 77675
Benjamin Kramer [Fri, 31 Jul 2009 11:35:26 +0000 (11:35 +0000)]
Fix a struct/class mismatch, to silence a MSVC warning.
llvm-svn: 77673
Daniel Dunbar [Fri, 31 Jul 2009 07:59:05 +0000 (07:59 +0000)]
MultiTestRunner: Add module for lexing 'sh' commands.
llvm-svn: 77668
Sanjiv Gupta [Fri, 31 Jul 2009 07:35:57 +0000 (07:35 +0000)]
define target names for std libcalls.
llvm-svn: 77667
Daniel Dunbar [Fri, 31 Jul 2009 05:57:11 +0000 (05:57 +0000)]
Add missing test suffixes.
llvm-svn: 77666
Daniel Dunbar [Fri, 31 Jul 2009 05:54:17 +0000 (05:54 +0000)]
MultiTestRunner: Simplify, cleanup, and rename!
- MultiTestRunner will eventually be renamed to 'lit', for LLVM integrated
tester/testing. This has the pros of being pronouncable and short.
- "Project" level configuration lives in 'lit.cfg', which is also what lit uses
to find the root testing directory in some cases. This can be overridden for
use in project files which want to precisely specify where things are.
- TestRunner.py is not longer able to be invoked directly.
- Moved some code to Util.py.
- Introduced a configuration object.
- Cleaned up --help, removed a few not-very-useful options.
- Tried not to break anything that works. :)
llvm-svn: 77665
Douglas Gregor [Fri, 31 Jul 2009 05:24:01 +0000 (05:24 +0000)]
Canonicalization and profiling for overloaded function declarations,
for those extra-esoteric cases. Not that any two given C++ compilers
agree on this test case, but this change gives us a strong definition
of equivalent types.
llvm-svn: 77664
Douglas Gregor [Fri, 31 Jul 2009 03:54:25 +0000 (03:54 +0000)]
Canonicalize dependent extended vector types.
llvm-svn: 77663
Daniel Dunbar [Fri, 31 Jul 2009 03:11:49 +0000 (03:11 +0000)]
Add this test back, the check pattern was too strict.
llvm-svn: 77662
Daniel Dunbar [Fri, 31 Jul 2009 03:02:41 +0000 (03:02 +0000)]
Revert r77654, it appears to be causing llvm-gcc bootstrap failures, and many
failures when building assorted projects with clang.
--- Reverse-merging r77654 into '.':
U include/llvm/CodeGen/Passes.h
U include/llvm/CodeGen/MachineFunctionPass.h
U include/llvm/CodeGen/MachineFunction.h
U include/llvm/CodeGen/LazyLiveness.h
U include/llvm/CodeGen/SelectionDAGISel.h
D include/llvm/CodeGen/MachineFunctionAnalysis.h
U include/llvm/Function.h
U lib/Target/CellSPU/SPUISelDAGToDAG.cpp
U lib/Target/PowerPC/PPCISelDAGToDAG.cpp
U lib/CodeGen/LLVMTargetMachine.cpp
U lib/CodeGen/MachineVerifier.cpp
U lib/CodeGen/MachineFunction.cpp
U lib/CodeGen/PrologEpilogInserter.cpp
U lib/CodeGen/MachineLoopInfo.cpp
U lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp
D lib/CodeGen/MachineFunctionAnalysis.cpp
D lib/CodeGen/MachineFunctionPass.cpp
U lib/CodeGen/LiveVariables.cpp
llvm-svn: 77661
Ryan Flynn [Fri, 31 Jul 2009 02:52:19 +0000 (02:52 +0000)]
PR3679 - enable #pragma weak aliasing.
llvm-svn: 77660
Daniel Dunbar [Fri, 31 Jul 2009 02:46:36 +0000 (02:46 +0000)]
Remove this test while I figure out why it is failing.
llvm-svn: 77659
John McCall [Fri, 31 Jul 2009 02:45:11 +0000 (02:45 +0000)]
Rename Action::TagKind to Action::TagUseKind, which removes both a misnomer
and a name collision.
llvm-svn: 77658
Daniel Dunbar [Fri, 31 Jul 2009 02:32:59 +0000 (02:32 +0000)]
llvm-mc: Match a few X86 instructions.
- This is "experimental" code, I am feeling my way around and working out the
best way to do things (and learning tblgen in the process). Comments welcome,
but keep in mind this stuff will change radically.
- This is enough to match "subb" and friends, but not much else. The next step is to
automatically generate the matchers for individual operands.
llvm-svn: 77657
John McCall [Fri, 31 Jul 2009 02:20:35 +0000 (02:20 +0000)]
sp.
llvm-svn: 77656
Mike Stump [Fri, 31 Jul 2009 02:02:20 +0000 (02:02 +0000)]
Whitespace around else canonicalization and fix 80-col violations.
llvm-svn: 77655
Dan Gohman [Fri, 31 Jul 2009 01:52:50 +0000 (01:52 +0000)]
Manage MachineFunctions with an analysis Pass instead of the Annotable
mechanism. To support this, make MachineFunctionPass a little more
complete.
llvm-svn: 77654
Eli Friedman [Fri, 31 Jul 2009 01:43:05 +0000 (01:43 +0000)]
Make the check for the linkage of a template handle the case of nested
linkage specifications correctly.
llvm-svn: 77653
Anders Carlsson [Fri, 31 Jul 2009 01:23:52 +0000 (01:23 +0000)]
Add CK_DerivedToBase and use it PerformObjectMemberConversion.
llvm-svn: 77652
Mike Stump [Fri, 31 Jul 2009 01:10:29 +0000 (01:10 +0000)]
Fix build warnings.
llvm-svn: 77651
Anders Carlsson [Fri, 31 Jul 2009 00:48:10 +0000 (00:48 +0000)]
Add a CastKind enum to CastExpr. Right now it's not used for much but it will be :)
llvm-svn: 77650
Benjamin Kramer [Fri, 31 Jul 2009 00:35:23 +0000 (00:35 +0000)]
Fix cmake build.
llvm-svn: 77649
Ted Kremenek [Fri, 31 Jul 2009 00:34:52 +0000 (00:34 +0000)]
Fix use-after-release bug introduced in r77585 where the PathDiagnosticClient
created by AnalysisConsumer would be released by an instance of AnalysisManager
and then reused by later instances of AnalysisManager. Ownership of the
PathDiagnosticClient now belongs (for now) in AnalysisConsumer.
We also need this layering (for now) because the HTMLDiagnostiClient requires
that the entire translation unit be processed before emitting diagnostics. This
is done in its destructor (which should also be fixed, but that is another
issue).
This fixes PR 4653.
llvm-svn: 77648
Douglas Gregor [Fri, 31 Jul 2009 00:23:35 +0000 (00:23 +0000)]
Build canonical types for dependently-sized array types.
llvm-svn: 77647