Commit Graph

42501 Commits

Author SHA1 Message Date
Chris Lattner 53c56e4176 Move getCastToEmpty out of DIDescriptor into DIFactory. It is an
implementation detail of DIFactory anyway, and this allows it to avoid
recomputing the same type over and over.

llvm-svn: 58960
2008-11-10 04:10:34 +00:00
Chris Lattner bc09b36016 Fix an over aggressive assumption that struct decls will have a pointer to
an array that is empty.  Instead of requiring this array, allow a null pointer.
This shrinks all forward references of structs.

llvm-svn: 58959
2008-11-10 03:48:55 +00:00
Chris Lattner 85af1ee10d Fix a bug with default arguments that apple gcc doesn't notice that llvmbb does.
llvm-svn: 58958
2008-11-10 03:11:39 +00:00
Chris Lattner 9d5771ea17 move some cases around to silence these sorts of warnings in
release-asserts build:

llvm/CodeGen/SelectionDAGNodes.h:1298: warning: control may reach end of non-void function 'unsigned int llvm::MVT::getSizeInBits() const' being inlined

what an unhelpful warning.

llvm-svn: 58957
2008-11-10 03:05:41 +00:00
Chris Lattner 4978d35967 add new file
llvm-svn: 58955
2008-11-10 02:58:28 +00:00
Chris Lattner 6d3893359e Add a new set of helper classes for creating and reading debug
information.  This logically replaces the "Desc" classes in
MachineModuleInfo.  Nice features of these classes are that they:

1. Are much more efficient than MMI because they don't create a 
   temporary parallel data structure for debug info that has to be
   'serialized' and 'deserialized' into/out of the module.
2. These provide a much cleaner abstraction for debug info than 
   MMI, which will make it easier to change the implementation in 
   the future (to be MDNode-based).
3. These are much easier to use than the MMI interfaces, requiring
   a lot less code in the front-ends.
4. These can be used to both create (for frontends) and read (for
   codegen) debug information.  DebugInfoBuilder can only be used
   to create the nodes.

So far, this is implemented just enough to support the debug info
generation needs of clang.  This can and should be extended to 
support the full set of debug info constructs, and we should switch
llvm-gcc and llc over to using this in the near future.

This code also has a ton of FIXMEs in it, because the way we 
currently represent debug info in LLVM IR is basically insane in a
variety of details.  This sort of issue should be fixed when we
eventually reimplement debug info on top of MDNodes.

llvm-svn: 58954
2008-11-10 02:56:27 +00:00
Oscar Fuentes 9530edd1f4 CMake: Builds a native tblgen when cross-compiling and the user didn't
set LLVM_TABLEGEN.

llvm-svn: 58953
2008-11-10 02:35:55 +00:00
Evan Cheng 0d9db40994 Forgot these.
llvm-svn: 58952
2008-11-10 01:52:24 +00:00
Oscar Fuentes e9edc2cd15 CMake: Implement magic word `all' for selecting all targets. Check
that specified targets are known.

llvm-svn: 58951
2008-11-10 01:47:07 +00:00
Oscar Fuentes e352ca077c CMake: Non-working code for auto-building the native tblgen util when
cross-compiling.

llvm-svn: 58950
2008-11-10 01:32:14 +00:00
Evan Cheng 9f3058f3be Rename isGVNonLazyPtr to isIndirectSym to reflect how it will be used.
llvm-svn: 58949
2008-11-10 01:08:07 +00:00
Bill Wendling 4fb13c051d Correction for the last patch. Should match the conditional in the first part
of the select match, not the select instruction itself.

llvm-svn: 58947
2008-11-09 23:37:53 +00:00
Bill Wendling 1579287550 The method of doing the matching with a 'select' instruction was wrong. The
original code was matching like this:

	if (match(A, m_Not(m_Value(B))))

B was already matched as a 'select' instruction. However, this isn't matching
what we think it's matching. It would match B as a 'Value', so basically
anything would match to it. In this case, a Constant matched. B was replaced
with a constant representation. And then the wrong value would be used in the
SelectInst::Create statement, causing a crash.

After thinking on this for a moment, and after Nick L. told me how the pattern
matching stuff was supposed to work, the solution was to match NOT an m_Value,
but an m_Select.

llvm-svn: 58946
2008-11-09 23:17:42 +00:00
Oscar Fuentes a6da027c18 CMake: Corrected detection of `nm'.
llvm-svn: 58941
2008-11-09 20:26:31 +00:00
Oscar Fuentes b45a43aec4 CMake: Support for cross-compiling. For now, requires a previously
built native tblgen which is passed to cmake in the variable
LLVM_TABLEGEN.

See

http://www.cmake.org/Wiki/CmakeMingw

for a quick example on how to cross-compile with CMake.

llvm-svn: 58939
2008-11-09 18:53:19 +00:00
Chris Lattner 26c744492f fix validation problem.
llvm-svn: 58938
2008-11-09 17:19:14 +00:00
Duncan Sands 3b36fd87a4 XFAIL this while waiting for a fix.
llvm-svn: 58934
2008-11-09 13:07:47 +00:00
Nuno Lopes 2e42927e7c fix leakage of ValueNumbering
llvm-svn: 58933
2008-11-09 12:45:23 +00:00
Dale Johannesen aa4d82d244 Temporarily revert 58825, which breaks PPC bootstrap.
xs

llvm-svn: 58930
2008-11-09 06:48:10 +00:00
Bill Wendling 3f547be28f If the LHS of the FCMP is coming from a UIToFP instruction, then we don't want
to generate signed ICMP instructions to replace the FCMP. This would violate
the following:

define i1 @test1(i32 %val) {
  %1 = uitofp i32 %val to double
  %2 = fcmp ole double %1, 0.000000e+00
  ret i1 %2
}

would be transformed into:

define i1 @test1(i32 %val) {
  %1 = icmp slt i33 %val, 1
  ret i1 %1
}

which is obviously wrong. This patch modifes InstCombiner::FoldFCmp_IntToFP_Cst
to handle when the LHS comes from UIToFP.

llvm-svn: 58929
2008-11-09 04:26:50 +00:00
Anton Korobeynikov cfb3bc4a45 Typo fix
llvm-svn: 58928
2008-11-09 02:54:13 +00:00
Scott Michel 5c0378db8e CellSPU: Update expected counts on expected patterns
llvm-svn: 58927
2008-11-09 01:03:41 +00:00
Anton Korobeynikov 9833d8c369 Temporary revert my last commit: it seems it's triggering some subtle bug in backend
and breaks llvm-gcc

llvm-svn: 58926
2008-11-08 23:05:05 +00:00
Oscar Fuentes 4829941a51 CMake: corrected library target name for dependency: LLVMCellSPU ->
LLVMCellSPUCodeGen.

llvm-svn: 58925
2008-11-08 21:23:15 +00:00
Oscar Fuentes 676e5194d0 CMake: Reflected changes on the CellSPU target build. May require a
clean start.

llvm-svn: 58924
2008-11-08 20:37:19 +00:00
Oscar Fuentes b200b648c4 Fixed a pasto.
llvm-svn: 58923
2008-11-08 20:34:18 +00:00
Mikhail Glushenkov f5a294d08d Allow $CALL and $ENV in command names. Fixes #3025.
llvm-svn: 58922
2008-11-08 19:43:32 +00:00
Scott Michel a872e5af8a CellSPU: Bring SPU's assembly printer more in-line with current LLVM code
structure. Assembly printer now outputs the correct section for strings.

llvm-svn: 58921
2008-11-08 18:59:02 +00:00
Duncan Sands 0f3937115d Try to produce better code when scalarizing VSETCC.
llvm-svn: 58920
2008-11-08 18:26:48 +00:00
Anton Korobeynikov 09f51d1fd4 Factor out offset printing code into generic AsmPrinter.
FIXME: it seems, that most of targets don't support
offsets wrt CPI/GlobalAddress', was it intentional?

llvm-svn: 58917
2008-11-08 17:21:38 +00:00
Nicolas Geoffray 5a48f232f7 The Index field of an AttributeWithIndex is of type unsigned, not uint16_t.
llvm-svn: 58908
2008-11-08 15:36:01 +00:00
Anton Korobeynikov 09991ada2d StoreInst does not produce any result thus it's useless to create new
variable for it. This greatly reduces amount of unused variables in
llvm2cpp-generated code

llvm-svn: 58905
2008-11-08 12:58:07 +00:00
Anton Korobeynikov 9278247502 Properly escape dashes in TableGen's LLVMC2 emitter.
Patch by Patrick Walton!

llvm-svn: 58901
2008-11-08 10:16:21 +00:00
Eric Christopher 6e670388c0 Fix syntax of iterate_complex example. Noticed by Martin!
llvm-svn: 58900
2008-11-08 08:20:49 +00:00
Evan Cheng 436bdcdcca Moved InvalidateInstructionCache to ARMJITInfo::emitFunctionStub which knows size of stub.
llvm-svn: 58899
2008-11-08 08:16:49 +00:00
Evan Cheng 686a725b45 Remove a InvalidateInstructionCache call with incorrect size.
llvm-svn: 58898
2008-11-08 08:15:39 +00:00
Evan Cheng b31a717527 Rename startFunctionStub to startGVStub since it's also used for GV non-lazy ptr.
llvm-svn: 58897
2008-11-08 08:02:53 +00:00
Evan Cheng 98161f5f34 Tell ARMJITInfo if codegen relocation is PIC. It changes how function stubs are generated.
llvm-svn: 58896
2008-11-08 07:38:22 +00:00
Evan Cheng 1b889b16da Rename isString -> isExternalSymbol; getString -> getExternalSymbol since these work on externsym machine relocations.
llvm-svn: 58895
2008-11-08 07:37:34 +00:00
Evan Cheng 776f5922fb More debug output.
llvm-svn: 58894
2008-11-08 07:22:53 +00:00
Evan Cheng bb373c4637 Fix relocation for calls to external symbols.
llvm-svn: 58893
2008-11-08 07:22:33 +00:00
Scott Michel 1ccbbc3d07 CellSPU: Fix prologue/epilogue emission when function contains calls but
theframe size is 0; the prologue and epilogue should be emitted in this case.

llvm-svn: 58890
2008-11-08 05:16:20 +00:00
Daniel Dunbar 2b9dce2669 Rework r58829, allowing removal of dbg info intrinsics during alloca
promotion.
 - Eliminate uses after free and simplify tests.

Devang: Please check that this is still doing what you intended.
llvm-svn: 58887
2008-11-08 04:12:17 +00:00
Daniel Dunbar 06ad209fb1 Add LLVMC2 tool definitions for Objective-C and Objective-C++.
llvm-svn: 58885
2008-11-08 03:25:47 +00:00
Evan Cheng 077c8f8832 Skip over two-address use operands.
llvm-svn: 58883
2008-11-08 01:44:13 +00:00
Evan Cheng ffdd91e3b8 Handle ARM machine constantpool entry with non-lazy ptr.
llvm-svn: 58882
2008-11-08 01:31:27 +00:00
Evan Cheng b126422533 Indentation.
llvm-svn: 58881
2008-11-08 01:30:20 +00:00
Ted Kremenek 865da3cae0 remove unavailable clang project
llvm-svn: 58879
2008-11-08 01:02:44 +00:00
Evan Cheng 454ff53d58 Use ARMFunctionInfo to track number of constpool entries and jumptables.
llvm-svn: 58877
2008-11-08 00:51:41 +00:00
Dale Johannesen d70bd61758 Generated code for generic expansion of SETUGT etc.
is noticeably worse than previous PPC-specific code.
Since the latter was also wrong in some cases and
correctness is more important than efficiency, I'm
disabling this test temporarily while I fix it.

llvm-svn: 58876
2008-11-08 00:49:19 +00:00
Dale Johannesen ee04c24bd5 Xfail an incorrect test.
llvm-svn: 58875
2008-11-08 00:40:24 +00:00
Dale Johannesen bb5c9b4b68 Make testb optimization work on big-endian targets.
llvm-svn: 58874
2008-11-08 00:01:16 +00:00
Evan Cheng ef4d78ba67 More code clean up.
llvm-svn: 58872
2008-11-07 22:57:53 +00:00
Dale Johannesen 160be0ffda Make FP tests requiring two compares work on PPC (PR 642).
This is Chris' patch from the PR, modified to realize that
SETUGT/SETULT occur legitimately with integers, plus
two fixes in LegalizeDAG to pass a valid result type into
LegalizeSetCC.  The argument of TLI.getSetCCResultType is
ignored on PPC, but I think I'm following usage elsewhere.

llvm-svn: 58871
2008-11-07 22:54:33 +00:00
Evan Cheng 8467e2459a Get PIC jump table working.
llvm-svn: 58869
2008-11-07 22:30:53 +00:00
Evan Cheng 077f686d4b More debug output.
llvm-svn: 58868
2008-11-07 22:30:29 +00:00
Dan Gohman cc0d2cfa01 Make tablegen print out a nice error message for a const char*
exception, like it does for a std::string exception.

llvm-svn: 58865
2008-11-07 21:01:13 +00:00
Dan Gohman 67feab3b5a Document the acronym RAUW. Patch by Jonathan Brandmeyer!
llvm-svn: 58863
2008-11-07 20:29:17 +00:00
Duncan Sands 2d636b5265 Sign-extend rather than zero-extend when promoting
the condition for a BRCOND, according to what is
returned by getSetCCResultContents.  Since all
targets return the same thing (ZeroOrOneSetCCResult),
this should be harmless!  The point is that all over
the place the result of SETCC is fed directly into
BRCOND.  On machines for which getSetCCResultContents
returns ZeroOrNegativeOneSetCCResult, this is a
sign-extended boolean.  So it seems dangerous to
also feed BRCOND zero-extended booleans in some
circumstances - for example, when promoting the
condition.

llvm-svn: 58861
2008-11-07 20:13:04 +00:00
Dan Gohman cb0df597e0 Flush the raw_ostream after emitting the assembly for a function.
This is a temporary fix for the -print-emitted-asm option, where
errs() is used as the stream, in the case where other code is
using stderr without using errs()' buffer. Hopefully soon we'll
fix errs() to be non-buffered instead. Patch by Preston Gurd.

llvm-svn: 58859
2008-11-07 19:49:17 +00:00
Dale Johannesen 9016882d67 Fix unsigned->ppcf128 conversion.
llvm-svn: 58856
2008-11-07 19:11:43 +00:00
Nick Lewycky 3707f1e6f3 Update to add newer bitcodes.
llvm-svn: 58852
2008-11-07 14:52:51 +00:00
Richard Osborne 75edafc672 Keep CREDITS.TXT sorted by name.
llvm-svn: 58845
2008-11-07 12:44:36 +00:00
Richard Osborne 5923f60099 Add contributer information for XCore backend to CREDITS.TXT
llvm-svn: 58844
2008-11-07 12:41:14 +00:00
Richard Osborne 7b2eae9bdd Add XCore backend to CMake build.
llvm-svn: 58843
2008-11-07 12:37:45 +00:00
Richard Osborne 86d68a492a Add basic test for XCore backend
llvm-svn: 58841
2008-11-07 11:24:12 +00:00
Richard Osborne 3219819ffe Fix compile warnings.
llvm-svn: 58840
2008-11-07 11:21:09 +00:00
Scott Michel 3395d4485d CellSPU: Ensure that C strings are always put in the .rodata section
llvm-svn: 58839
2008-11-07 11:06:44 +00:00
Richard Osborne ca08e0645a Add XCore backend.
llvm-svn: 58838
2008-11-07 10:59:00 +00:00
Evan Cheng 7095cd2af2 Jump table JIT support. Work in progress.
llvm-svn: 58836
2008-11-07 09:06:08 +00:00
Evan Cheng 00203155ad Jump tables may be emitted by target.
llvm-svn: 58835
2008-11-07 09:02:17 +00:00
Evan Cheng a2d1605ac3 Jump table relocation addresses may be resolved by target.
llvm-svn: 58834
2008-11-07 09:01:15 +00:00
Scott Michel 34d93f8572 Teach CellSPU about ELF sections and new section emitter classes.
NB: This is likely to need more work.
llvm-svn: 58832
2008-11-07 04:36:25 +00:00
Bill Wendling b9656df4ac BCUI + 1 doesn't work. Use next instead.
llvm-svn: 58830
2008-11-07 01:59:41 +00:00
Bill Wendling 1af23b035f Refactor code that adjusts the offsets of stack objects.
llvm-svn: 58829
2008-11-07 01:48:58 +00:00
Evan Cheng 98dc53e926 Encode misc arithmetic instructions.
llvm-svn: 58828
2008-11-07 01:41:35 +00:00
Dale Johannesen a129e0b826 Testcase for testb optimization.
llvm-svn: 58827
2008-11-07 01:30:18 +00:00
Devang Patel b8e0d59ceb Handle (delete) dbg intrinsics while promoting alloca.
llvm-svn: 58826
2008-11-07 01:30:07 +00:00
Dale Johannesen 7aad542d35 When we're doing a compare of load-AND-constant to 0
(e.g. a bitfield test) narrow the load as much as possible.
The has the potential to avoid unnecessary partial-word
load-after-store conflicts, which cause stalls on several targets.
Also a size win on x86 (testb vs testl).

llvm-svn: 58825
2008-11-07 01:28:02 +00:00
Bill Wendling eb4268d72f - Modify the stack protector algorithm so that the stack slot is allocated in
LLVM IR code and not in the selection DAG ISel. This is a cleaner solution.

- Fix the heuristic for determining if protectors are necessary. The previous
  one wasn't checking the proper type size.

llvm-svn: 58824
2008-11-07 01:23:58 +00:00
Bill Wendling 87d0746e71 Remove unneeded header file.
llvm-svn: 58823
2008-11-06 23:56:59 +00:00
Bill Wendling a0826e1855 Don't build a vector of returns. Just modify the Function in the loop.
llvm-svn: 58822
2008-11-06 23:55:49 +00:00
Mon P Wang 5ca2ec65bd Fixed scalarizing an extract subvector and prevent an infinite loop
when simplify a vector. 

llvm-svn: 58820
2008-11-06 22:52:21 +00:00
Bill Wendling d939a7b305 The size limit is for individual arrays. So if any array has more than 8 bytes
in it, then emit stack protectors.

llvm-svn: 58819
2008-11-06 22:18:44 +00:00
Evan Cheng 49d665218c Encode extend instructions; more clean up.
llvm-svn: 58818
2008-11-06 22:15:19 +00:00
Dan Gohman 193e4c025e Fix a use of an invalid iterator when -debug-pass=Details is used.
llvm-svn: 58816
2008-11-06 21:57:17 +00:00
Bill Wendling 8b47c1e0a2 Don't recalculate the stack position of the stack protector.
llvm-svn: 58815
2008-11-06 21:37:09 +00:00
Devang Patel 8af0a362f1 Emit label for llvm.dbg.func.start of the inlined function.
llvm-svn: 58814
2008-11-06 21:28:20 +00:00
Devang Patel ef21de946b Clarify documentation. A module pass MP can require a function paqss FP only if FP does not require any module pass.
llvm-svn: 58813
2008-11-06 19:47:49 +00:00
Evan Cheng aa03cd3336 - Improve naming consistency: Branch -> BrFrm, BranchMisc -> BrMiscFrm.
- Consolidate instruction formats.
- Other clean up.

llvm-svn: 58808
2008-11-06 17:48:05 +00:00
Evan Cheng 972fd1a1e0 Improve JIT debugging outputs format consistency.
llvm-svn: 58807
2008-11-06 17:46:04 +00:00
Nuno Lopes 2817338558 plug leakage of mutex data. pthread_mutex_destroy() doesnt free our malloc'ed memory.
llvm-svn: 58805
2008-11-06 16:21:49 +00:00
Duncan Sands f178f8300d Formating/comment changes - no functionality change.
llvm-svn: 58801
2008-11-06 08:51:32 +00:00
Evan Cheng 47b546d75f Remove opcode from instruction TS flags; add MOVCC support; fix addrmode3 encoding bug.
llvm-svn: 58800
2008-11-06 08:47:38 +00:00
Bill Wendling b3f7a39877 - Rename stackprotector_{prologue,epilogue} to stackprotector_{create,check}.
- Get rid of "HasStackProtector" in MachineFrameInfo.
- Modify intrinsics to tell which are doing what with memory.

llvm-svn: 58799
2008-11-06 07:23:03 +00:00
Steve Naroff ef625263ef Update VC++ projects.
llvm-svn: 58798
2008-11-06 06:24:59 +00:00
Mon P Wang 9a8d60a7c0 Widening cleanup
llvm-svn: 58796
2008-11-06 05:31:54 +00:00
Evan Cheng 36ae40342f Handle smul<x><y>, smulw<y>, smla<x><y>, smlaw<y>.
llvm-svn: 58793
2008-11-06 03:35:07 +00:00
Bill Wendling 43de293d75 Adjust the stack protector heuristic to care about only arrays or calls to
"alloca".

llvm-svn: 58792
2008-11-06 02:38:58 +00:00
Bill Wendling d970ea3eac Implement the stack protector stack accesses via intrinsics:
- stackprotector_prologue creates a stack object and stores the guard there.

- stackprotector_epilogue reads the stack guard from the stack position created
  by stackprotector_prologue.

- The PrologEpilogInserter was changed to make sure that the stack guard is
  first on the stack frame.

llvm-svn: 58791
2008-11-06 02:29:10 +00:00
Evan Cheng b870fd8874 Fix so_imm encoding bug; add support for MOVi2pieces.
llvm-svn: 58790
2008-11-06 02:25:39 +00:00
Evan Cheng 2686c8fb34 Fix encoding of multiple instructions with 3 src operands; also handle smmul, smmla, and smmls.
llvm-svn: 58789
2008-11-06 01:21:28 +00:00
Evan Cheng 3aeeb3a47c Need a \n.
llvm-svn: 58788
2008-11-06 01:18:29 +00:00
Devang Patel 5a5ab730e0 InstructionNamer preserves everything.
llvm-svn: 58787
2008-11-06 01:00:16 +00:00
Devang Patel 9e3e776e28 Emit label for llvm.dbg.func.start of the inlined function.
llvm-svn: 58786
2008-11-06 00:30:09 +00:00
Steve Naroff 0b0c99610c Add post-build event for clangDriver (to copy clang.exe into "dstroot").
llvm-svn: 58783
2008-11-06 00:11:31 +00:00
Evan Cheng d1c5c7f499 Undo 58778 but makes the binary dump prettier.
llvm-svn: 58782
2008-11-05 23:44:08 +00:00
Bill Wendling f5f6f74c16 Add comments to function.
llvm-svn: 58781
2008-11-05 23:42:27 +00:00
Evan Cheng fd2adbfa28 Encode pic load / store instructions; fix some encoding bugs.
llvm-svn: 58780
2008-11-05 23:22:34 +00:00
Evan Cheng 6158254d1d Add command line option -entry-funcion to override entry function (default is main).
llvm-svn: 58779
2008-11-05 23:21:52 +00:00
Evan Cheng 51b9b9f6e2 Remove debug output that's not really useful.
llvm-svn: 58778
2008-11-05 23:21:11 +00:00
Dan Gohman 3777ed765f Make ISel ignore dead nodes. The DAGCombiner normally eliminates
dead nodes, but in this case its missing one. Fixing the DAGCombiner
is desirable, but it's somewhat involved.

llvm-svn: 58777
2008-11-05 22:56:47 +00:00
Andrew Lenharth 912e7131a4 opt was not exporting the Mangler symbols
llvm-svn: 58775
2008-11-05 22:42:50 +00:00
Devang Patel f53d7ff870 Add PR number.
llvm-svn: 58765
2008-11-05 18:41:15 +00:00
Evan Cheng 81889d010c Restructure ARM code emitter to use instruction formats instead of addressing modes to determine how to encode instructions.
llvm-svn: 58764
2008-11-05 18:35:52 +00:00
Dan Gohman ce2417f4e1 Use an assert to check that SelectCode isn't called on
nodes that are already selected.

llvm-svn: 58763
2008-11-05 18:30:52 +00:00
Dan Gohman 87002dbea1 The HadDelete field is no longer used.
llvm-svn: 58761
2008-11-05 17:35:14 +00:00
Dan Gohman 7a638a8c7e Reintroduce a comment that was removed with the AddToISelQueue
changes.

llvm-svn: 58760
2008-11-05 17:16:24 +00:00
Dan Gohman 22079067e1 Update some comments to reflect the new code.
llvm-svn: 58759
2008-11-05 17:13:57 +00:00
Richard Osborne bfd58d87f3 Test commit, add Makefile for XCore target, more to follow.
llvm-svn: 58755
2008-11-05 09:53:58 +00:00
Duncan Sands 68035d4076 Fix thinko in ppcf128 expansion of truncating store.
llvm-svn: 58753
2008-11-05 07:17:27 +00:00
Evan Cheng 27889ab29f Add more vector move low and zero-extend patterns.
llvm-svn: 58752
2008-11-05 06:04:51 +00:00
Evan Cheng c7b04a12bb Type of shuffle mask has changed.
llvm-svn: 58751
2008-11-05 06:04:18 +00:00
Evan Cheng 3cd5e8c97b Indentation.
llvm-svn: 58750
2008-11-05 06:03:38 +00:00
Dan Gohman f14b77ebf1 Eliminate the ISel priority queue, which used the topological order for a
priority function. Instead, just iterate over the AllNodes list, which is
already in topological order. This eliminates a fair amount of bookkeeping,
and speeds up the isel phase by about 15% on many testcases.

The impact on most targets is that AddToISelQueue calls can be simply removed.

In the x86 target, there are two additional notable changes.

The rule-bending AND+SHIFT optimization in MatchAddress that creates new
pre-isel nodes during isel is now a little more verbose, but more robust.
Instead of either creating an invalid DAG or creating an invalid topological
sort, as it has historically done, it can now just insert the new nodes into
the node list at a position where they will be consistent with the topological
ordering.

Also, the address-matching code has logic that checked to see if a node was
"already selected". However, when a node is selected, it has all its uses
taken away via ReplaceAllUsesWith or equivalent, so it won't recieve any
further visits from MatchAddress. This code is now removed.

llvm-svn: 58748
2008-11-05 04:14:16 +00:00
Dan Gohman fd820528ab Use getTargetConstant instead of getConstant for nodes that should not be visited
by isel and potentially forced into registers.

llvm-svn: 58747
2008-11-05 02:06:09 +00:00
Evan Cheng 132de1983f Rename isGVLazyPtr to isGVNonLazyPtr relocation. This represents Mac OS X
indirect gv reference. Please don't call it lazy.

llvm-svn: 58746
2008-11-05 01:50:32 +00:00
Devang Patel f04bfc6989 New test case.
llvm-svn: 58745
2008-11-05 01:40:30 +00:00
Devang Patel f0ef35738c Do now allow InlineAlways pass to remove dead functions.
llvm-svn: 58744
2008-11-05 01:39:16 +00:00
Devang Patel e94321305f Silence unused variable warnings.
llvm-svn: 58743
2008-11-05 01:37:40 +00:00
Devang Patel 7a848b0ee3 Check Attribute::NoInline.
llvm-svn: 58742
2008-11-05 01:37:05 +00:00
Bill Wendling db045a3048 Remove dead variable.
llvm-svn: 58741
2008-11-05 00:56:35 +00:00
Bill Wendling f1b4e2626b Simplify the allocated size calculation.
llvm-svn: 58740
2008-11-05 00:54:27 +00:00
Bill Wendling 75e38fedc8 Fix comment
llvm-svn: 58739
2008-11-05 00:46:15 +00:00
Owen Anderson 26c10f1b4a Use the new predicate to control when we do prealloc splitting. Fix a small bug.
llvm-svn: 58738
2008-11-05 00:32:13 +00:00
Evan Cheng 33ba5e78d2 Debugging output tweak.
llvm-svn: 58737
2008-11-05 00:22:28 +00:00
Oscar Fuentes 076e048cf7 CMake: updated list of source files.
llvm-svn: 58736
2008-11-05 00:11:22 +00:00
Bill Wendling 782e8346a5 Some code simplification. It now doesn't generate a prologue if the epilogue
isn't going to be generated.

llvm-svn: 58734
2008-11-05 00:00:21 +00:00
Dan Gohman 8cdea717a3 Add a new pass to simplify specific half_powr function calls. This is
a specialized pass that it not likely to be generally useful.

llvm-svn: 58732
2008-11-04 23:41:45 +00:00
Devang Patel db9d785338 On darwin, 32-bit x86 target is i386-apple-darwin...
llvm-svn: 58731
2008-11-04 23:13:50 +00:00
Nuno Lopes 0460bb27e0 fix memory leak in pass manager when adding an analysis pass that already existed. as pass manager takes ownership of the added passes, it has to delete the pass if it isnt added to the pass list
tweak the opt tool so that it doesnt access a Pass after the ownership was taken by the pass manager

llvm-svn: 58730
2008-11-04 23:03:58 +00:00
Anton Korobeynikov d6948315b7 Fix tests not to emit IR output
llvm-svn: 58729
2008-11-04 23:02:39 +00:00
Bill Wendling d31fc54f34 Small simplification of the stack guard type.
llvm-svn: 58728
2008-11-04 22:54:43 +00:00
Bill Wendling 2f40956c68 - Add a "getOrInsertGlobal" method to the Module class. This acts similarly to
"getOrInsertFunction" in that it either adds a new declaration of the global
  and returns it, or returns the current one -- optionally casting it to the
  correct type.
- Use the new getOrInsertGlobal in the stack protector code.
- Use "splitBasicBlock" in the stack protector code.

llvm-svn: 58727
2008-11-04 22:51:24 +00:00
Owen Anderson a926ed4b50 First pass at checking for the creation of a new join point when doing pre-alloc splitting. This is not turned on yet.
llvm-svn: 58726
2008-11-04 22:22:41 +00:00
Evan Cheng e3827d9061 Actually ARM / Mac OS X does have UINTTOFP_I64_F{64|32} libcalls.
llvm-svn: 58725
2008-11-04 22:19:55 +00:00
Bill Wendling 64adc71e9a Update in response to feedback from Chris:
- Use enums instead of magic numbers.

- Rework algorithm to use the bytes size from the target to determine when to
  emit stack protectors.

- Get rid of "propolice" in any comments.

- Renamed an option to its expanded form.

- Other miscellanenous changes.

More changes will come after this.

llvm-svn: 58723
2008-11-04 21:53:09 +00:00
Gabor Greif e5f9d67a68 fix two validation errors
llvm-svn: 58722
2008-11-04 21:50:59 +00:00
Gabor Greif 6b7bb1f127 fix typos, harmonize formatting
llvm-svn: 58721
2008-11-04 21:48:10 +00:00
Tanya Lattner e842074c48 Revert 58687. This breaks mingw.
llvm-svn: 58719
2008-11-04 21:06:11 +00:00
Dale Johannesen 0a7b4f5800 Allow SROA of vectors. Removing this caused a
huge performance regression in something we care
about.  This may not be final fix.

llvm-svn: 58718
2008-11-04 20:54:03 +00:00
Dale Johannesen db6b956585 80 columns
llvm-svn: 58717
2008-11-04 20:52:49 +00:00
Evan Cheng 297b32a367 Custom lower bit_convert i64 -> f64 into FMDRR. This is now happening with legalizetypes.
llvm-svn: 58714
2008-11-04 19:57:48 +00:00
Tanya Lattner 81edfc172e Add note about cmake. Patch by Oscar Fuentes.
llvm-svn: 58712
2008-11-04 18:40:27 +00:00
Dan Gohman daca2240b1 Give tablegen's Type a destructor, to suppress spurious
"Type has virtual functions but non-virtual destructor"
warnings.

llvm-svn: 58710
2008-11-04 18:09:07 +00:00
Duncan Sands dd571d325e Fix typo. Patch by nlewycky.
llvm-svn: 58709
2008-11-04 18:05:30 +00:00
Evan Cheng 4eaff40147 Debug output tweak.
llvm-svn: 58708
2008-11-04 17:58:53 +00:00
Evan Cheng 453844c352 LDM_RET restores pc, do not set 's' bit which would restore CPSR from SPSR.
llvm-svn: 58707
2008-11-04 17:57:07 +00:00
Duncan Sands d5f935921a Fix PR3011: LegalizeTypes support for scalarizing
SELECT_CC.

llvm-svn: 58706
2008-11-04 17:31:08 +00:00
Dan Gohman 20687e99b7 Duncan pointed out that the Extended case in getTypeForMVT could
be considerably simplified.

llvm-svn: 58703
2008-11-04 16:19:44 +00:00
Dan Gohman 72d10ab9ad Add a return statement to suppress warnings in NDEBUG builds.
llvm-svn: 58702
2008-11-04 16:08:57 +00:00
Dan Gohman ade09cd9d3 Add some asserts to verify MVT invariant assumptions.
llvm-svn: 58701
2008-11-04 16:03:56 +00:00
Nuno Lopes c6a5b0979f regenerate
llvm-svn: 58697
2008-11-04 14:43:20 +00:00
Nuno Lopes 0e92081b04 fix leakage of APFloats in getExistingVal()
llvm-svn: 58696
2008-11-04 14:42:19 +00:00
Nuno Lopes e4f5c9495f regenerate
llvm-svn: 58694
2008-11-04 14:28:33 +00:00
Nuno Lopes 724e67ec75 fix leakage of APSInt in getVal()
llvm-svn: 58693
2008-11-04 14:26:58 +00:00
Nuno Lopes 57c6594e97 fix leakage of IfcvtTokens
llvm-svn: 58690
2008-11-04 13:02:59 +00:00
Evan Cheng 9340be4641 For some targets, it's not possible to place GVs in the same memory buffer as the MachineCodeEmitter allocated memory. Code and data has different read / write / execution privilege requirements.
This is a short term workaround. The current solution is for the JIT memory manager to manage code and data memory separately.

llvm-svn: 58688
2008-11-04 09:30:48 +00:00
Nick Lewycky a6dee4e28f Don't "shell out" to resolve paths. Using pure perl makes llvm-config
friendlier to non-Unixes that happen to have perl. Patch from Sascha Othman!

llvm-svn: 58687
2008-11-04 08:05:21 +00:00
Evan Cheng 09053e62a9 80 col violation.
llvm-svn: 58684
2008-11-04 06:10:31 +00:00
Evan Cheng 2299c99d79 Stylistic change.
llvm-svn: 58683
2008-11-04 06:10:06 +00:00
Evan Cheng c1d10e6b42 hasDisassembler should return false if disassembler isn't available.
llvm-svn: 58682
2008-11-04 06:09:38 +00:00
Oscar Fuentes a69d8c50dc CMakeLists: removed asmprinter component from
tools/llc/CMakeLists.txt.

llvm-svn: 58678
2008-11-04 03:28:37 +00:00
Oscar Fuentes 7751a7b78d CMake: Support for building 32 bit mode libs and binaries on
Linux/x86-64.

llvm-svn: 58677
2008-11-04 03:27:24 +00:00
Oscar Fuentes 8881a91ae8 CMake: Updated list of source files.
llvm-svn: 58676
2008-11-04 03:24:04 +00:00
Bill Wendling 05d8417fa0 Initial checkin for stack protectors. Here's what it does:
* The prologue is modified to read the __stack_chk_guard global and insert it
  onto the stack.

* The epilogue is modified to read the stored guard from the stack and compare
  it to the original __stack_chk_guard value. If they differ, then the
  __stack_chk_fail() function is called.

* The stack protector needs to be first on the stack (after the parameters) to
  catch any stack-smashing activities.

Front-end support will follow after a round of beta testing.

llvm-svn: 58673
2008-11-04 02:10:20 +00:00
Evan Cheng 6dd08b6604 Handle ARM machine constantpool entries.
llvm-svn: 58671
2008-11-04 00:50:32 +00:00
Dan Gohman b9110e7fbb The ANDMask node folds to a constant, and isn't the node that needs to
have its node id set. The new and and shift nodes are the nodes that need
the IDs. This fixes PR2982.

llvm-svn: 58655
2008-11-03 23:43:55 +00:00
Devang Patel d26344d252 Fix unused variable warnings.
llvm-svn: 58653
2008-11-03 23:20:04 +00:00
Devang Patel f33f8a8606 Fix unused variable warnings.
llvm-svn: 58651
2008-11-03 23:14:09 +00:00
Dan Gohman d5104a5de6 Add C bindings for extractvalue and insertvalue. Patch by Frits van Bommel!
llvm-svn: 58650
2008-11-03 22:55:43 +00:00
Evan Cheng f60e5aaaac Remove a dead switch statement.
llvm-svn: 58644
2008-11-03 21:26:52 +00:00
Evan Cheng 3620e685b5 Minor code restructuring. No functionality change.
llvm-svn: 58643
2008-11-03 21:02:39 +00:00
Dale Johannesen 08535d2507 Fix some ppcf128 regressions: make ExpandFloatRes_LOAD
work correctly, and bring over a late change to ppcf128
SetCC handling.

llvm-svn: 58642
2008-11-03 20:47:45 +00:00
Duncan Sands 6692dec2a0 Make VAARG promotion work correctly with large funky
sized integers like i129, and also reduce the number
of assumptions made about how vaarg is implemented.
This still doesn't work correctly for small integers
like (eg) i1 on x86, since x86 passes each of them
(essentially an i8) in a 4 byte stack slot, so the
pointer needs to be advanced by 4 bytes not by 1 byte
as now.  But this is no longer a LegalizeTypes problem
(it was also wrong in LT before): it is a bug in the
operation expansion in LegalizeDAG: now LegalizeTypes
turns an i1 vaarg into an i8 vaarg which would work
fine if only the i8 vaarg was turned into correct code
later.

llvm-svn: 58635
2008-11-03 20:22:12 +00:00
Dan Gohman bde853911f Overload AddInteger on int/long/long long instead of on int/int64_t,
to avoid overload ambiguities. This fixes build errors introduced
by r58623.

llvm-svn: 58632
2008-11-03 19:40:18 +00:00
Devang Patel fe57d109b6 Ignore conditions that are outside the loop.
llvm-svn: 58631
2008-11-03 19:38:07 +00:00
Andrew Lenharth 348f3fa6a7 add a period at the end of the comment, ignoring the fact that the comment would be hard pressed to be considered a sentence, but if it makes Bill happy...
llvm-svn: 58630
2008-11-03 19:29:29 +00:00
Jim Grosbach 4d0549e3be Add binary encoding support for multiply instructions. Some blanks left to fill in, but the basics are there.
llvm-svn: 58626
2008-11-03 18:38:31 +00:00
Devang Patel c1631db93b Turn floating point IVs into integer IVs where possible.
This allows SCEV users to effectively calculate trip count.
LSR later on transforms back integer IVs to floating point IVs
later on to avoid int-to-float casts inside the loop.

llvm-svn: 58625
2008-11-03 18:32:19 +00:00
Dan Gohman ac41d9f5d8 Refactor various TargetAsmInfo subclasses' TargetMachine members away
adding a TargetMachine member to the base TargetAsmInfo class instead.

llvm-svn: 58624
2008-11-03 18:22:42 +00:00
Dan Gohman d7546abb8a Change how extended types are represented in MVTs. Instead of fiddling
bits, use a union of a SimpleValueType enum and a regular Type*.

This increases the size of MVT on 64-bit hosts from 32 bits to 64 bits.
In most cases, this doesn't add significant overhead. There are places
in codegen that use arrays of MVTs, so these are now larger, but
they're small in common cases.

This eliminates restrictions on the size of integer types and vector
types that can be represented in codegen. As the included testcase
demonstrates, it's now possible to codegen very large add operations.
There are still some complications with using very large types. PR2880
is still open so they can't be used as return values on normal targets,
there are no libcalls defined for very large integers so operations
like multiply and divide aren't supported.

This also introduces a minimal tablgen Type library, capable of
handling IntegerType and VectorType. This will allow parts of
TableGen that don't depend on using SimpleValueType values to handle
arbitrary integer and vector types.

llvm-svn: 58623
2008-11-03 17:56:27 +00:00
Daniel Dunbar d395a1722d Comment fix.
llvm-svn: 58621
2008-11-03 17:33:36 +00:00
Dan Gohman f9e7f69141 Remove redundant inline keywords from functions defined within
class definitions.

llvm-svn: 58620
2008-11-03 17:10:24 +00:00
Andrew Lenharth 45b86322f2 Ensure that we are checking only calls to the function we are interested in specializing
llvm-svn: 58615
2008-11-03 16:05:35 +00:00
Anton Korobeynikov fb2f87bbfe Testcase for recent llvm-gcc fix
llvm-svn: 58611
2008-11-03 14:43:31 +00:00
Duncan Sands 0207a3f897 Make VAARG work with x86 long double (which is
10 bytes long, but is passed in 12/16 bytes).

llvm-svn: 58608
2008-11-03 11:51:11 +00:00
Matthijs Kooijman 2530f5fe43 Make MachineFrameInfo::print not crash when no TargetFrameInfo is available.
llvm-svn: 58606
2008-11-03 11:16:43 +00:00
Evan Cheng 3a9aead4d4 Silence a compiler warning.
llvm-svn: 58598
2008-11-03 07:14:02 +00:00
Nick Lewycky 7874fe900a Typo
llvm-svn: 58594
2008-11-03 03:50:40 +00:00