Commit Graph

15209 Commits

Author SHA1 Message Date
Rafael Espindola
1fe9737eb4 Don't print an unused label before .cfi_endproc.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@147763 91177308-0d34-0410-b5e6-96231b3b80d8
2012-01-09 00:17:29 +00:00
Rafael Espindola
547be2699c Don't print a label before .cfi_startproc when we don't need to. This makes
the produce assembly when using CFI just a bit more readable.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@147743 91177308-0d34-0410-b5e6-96231b3b80d8
2012-01-07 22:42:19 +00:00
Benjamin Kramer
86132a721d Make clever use of alignment and padding to shrink GlobalValue.
-8 bytes on x86_64, no change on x86.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@147742 91177308-0d34-0410-b5e6-96231b3b80d8
2012-01-07 21:17:16 +00:00
Benjamin Kramer
f321e1075e Remove VectorExtras. This unused helper was written for a type of API that is discouraged now.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@147738 91177308-0d34-0410-b5e6-96231b3b80d8
2012-01-07 19:42:13 +00:00
Benjamin Kramer
f0be7ca7e4 Port the trick to skip the check for empty buckets from StringMap to DenseMap.
This should fix the odd behavior that find() is slower than lookup().

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@147731 91177308-0d34-0410-b5e6-96231b3b80d8
2012-01-07 13:12:07 +00:00
Rafael Espindola
99b4237c16 Split Finish into Finish and FinishImpl to have a common place to do end of
file error checking. Use that to error on an unfinished cfi_startproc.

The error is not nice, but is already better than a segmentation fault.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@147717 91177308-0d34-0410-b5e6-96231b3b80d8
2012-01-07 03:13:18 +00:00
Evan Cheng
977679d603 Added a late machine instruction copy propagation pass. This catches
opportunities that only present themselves after late optimizations
such as tail duplication .e.g.
## BB#1:
        movl    %eax, %ecx
        movl    %ecx, %eax
        ret

The register allocator also leaves some of them around (due to false
dep between copies from phi-elimination, etc.)

This required some changes in codegen passes. Post-ra scheduler and the
pseudo-instruction expansion passes have been moved after branch folding
and tail merging. They were before branch folding before because it did
not always update block livein's. That's fixed now. The pass change makes
independently since we want to properly schedule instructions after
branch folding / tail duplication.

rdar://10428165
rdar://10640363



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@147716 91177308-0d34-0410-b5e6-96231b3b80d8
2012-01-07 03:02:36 +00:00
Andrew Trick
ee98aa8743 Extended replaceCongruentPhis to handle mixed phi types.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@147707 91177308-0d34-0410-b5e6-96231b3b80d8
2012-01-07 01:12:09 +00:00
Andrew Trick
f8fd841a4b Expose isNonConstantNegative to users of ScalarEvolution.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@147700 91177308-0d34-0410-b5e6-96231b3b80d8
2012-01-07 00:27:31 +00:00
Andrew Trick
260bf5364e Put all IVUsers in the processed set. Allow querying IVUsers with isIVUserOrOperand.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@147686 91177308-0d34-0410-b5e6-96231b3b80d8
2012-01-06 21:41:55 +00:00
Benjamin Kramer
1031111f84 Kill ObjectCodeEmitter and BinaryObject, they were unused and superseded by MC.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@147618 91177308-0d34-0410-b5e6-96231b3b80d8
2012-01-05 22:31:37 +00:00
Danil Malyshev
45a93d6eb4 A small re-factored JIT/MCJIT::getPointerToNamedFunction(), so it could be called with the base class.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@147610 91177308-0d34-0410-b5e6-96231b3b80d8
2012-01-05 21:16:14 +00:00
Sebastian Pop
6e9b5eb51b revert r147542 after comments from Joerg Sonnenberger
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@147608 91177308-0d34-0410-b5e6-96231b3b80d8
2012-01-05 18:28:46 +00:00
Chris Lattner
0fcccd4d45 allow clients of SmallSet to specify their own comparison function for the set.
Patch by Stepan Dyatkovskiy!


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@147607 91177308-0d34-0410-b5e6-96231b3b80d8
2012-01-05 17:35:07 +00:00
Andrew Trick
1130d220a3 comment cleanup
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@147585 91177308-0d34-0410-b5e6-96231b3b80d8
2012-01-05 01:01:01 +00:00
Jakob Stoklund Olesen
d9e5c764bf Freeze reserved registers before starting register allocation.
The register allocators don't currently support adding reserved
registers while they are running.  Extend the MRI API to keep track of
the set of reserved registers when register allocation started.

Target hooks like hasFP() and needsStackRealignment() can look at this
set to avoid reserving more registers during register allocation.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@147577 91177308-0d34-0410-b5e6-96231b3b80d8
2012-01-05 00:26:49 +00:00
Dan Gohman
febaf84017 Generalize isSafeToSpeculativelyExecute to work on arbitrary
Values, rather than just Instructions, since it's interesting
for ConstantExprs too.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@147560 91177308-0d34-0410-b5e6-96231b3b80d8
2012-01-04 23:01:09 +00:00
Benjamin Kramer
da69f3b357 Simplify more DenseMap.find users.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@147550 91177308-0d34-0410-b5e6-96231b3b80d8
2012-01-04 21:41:24 +00:00
Benjamin Kramer
85c07ce048 StringMap.find never points to an empty bucket or tombstone, skip the check.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@147546 91177308-0d34-0410-b5e6-96231b3b80d8
2012-01-04 20:45:14 +00:00
Benjamin Kramer
34b5f0437b Simplify code. No functionality change.
Using DenseMap iterators isn't free as they have to check for empty
buckets. Dominator queries are common so this gives a minor speedup.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@147544 91177308-0d34-0410-b5e6-96231b3b80d8
2012-01-04 20:20:08 +00:00
Sebastian Pop
8a86887ba3 use getHostTriple instead of getDefaultTargetTriple in getClosestTargetForJIT
Get back getHostTriple.

For JIT compilation, use the host triple instead of the default
target: this fixes some JIT testcases that used to fail when the
compiler has been configured as a cross compiler.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@147542 91177308-0d34-0410-b5e6-96231b3b80d8
2012-01-04 19:47:22 +00:00
Chris Lattner
3a4c60ca3b generalize LLVMContext::emitError to take a twine instead of a StringRef.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@147501 91177308-0d34-0410-b5e6-96231b3b80d8
2012-01-03 23:47:05 +00:00
Stepan Dyatkovskiy
2b29d233b9 Fix for PR11652: assertion failures when Type.cpp is compiled with -Os
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@147470 91177308-0d34-0410-b5e6-96231b3b80d8
2012-01-03 20:04:35 +00:00
Stepan Dyatkovskiy
bd47f59afa Type: replaced usage of ID with getTypeID().
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@147446 91177308-0d34-0410-b5e6-96231b3b80d8
2012-01-03 14:05:04 +00:00
Benjamin Kramer
55c6d57734 PatternMatch: Introduce a matcher for instructions with the "exact" bit. Use it to simplify a few matchers.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@147403 91177308-0d34-0410-b5e6-96231b3b80d8
2012-01-01 17:55:30 +00:00
Benjamin Kramer
395363a9b9 PatternMatch: Simplify code by reusing the Operator class.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@147402 91177308-0d34-0410-b5e6-96231b3b80d8
2012-01-01 17:55:23 +00:00
Rafael Espindola
ed23bdb65f Implement cfi_restore. Patch by Brian Anderson!
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@147356 91177308-0d34-0410-b5e6-96231b3b80d8
2011-12-29 21:43:03 +00:00
Rafael Espindola
c25680f728 Rename Remember and Restore to RememberState and RestoreState for consistency.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@147354 91177308-0d34-0410-b5e6-96231b3b80d8
2011-12-29 21:09:08 +00:00
Rafael Espindola
6f0b181bc7 Implement .cfi_escape. Patch by Brian Anderson!
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@147352 91177308-0d34-0410-b5e6-96231b3b80d8
2011-12-29 20:24:47 +00:00
Rafael Espindola
3a023d3180 Fix grammar error noticed by Duncan.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@147333 91177308-0d34-0410-b5e6-96231b3b80d8
2011-12-29 02:15:06 +00:00
Nick Lewycky
b48a18903a Change CaptureTracking to pass a Use* instead of a Value* when a value is
captured. This allows the tracker to look at the specific use, which may be
especially interesting for function calls.

Use this to fix 'nocapture' deduction in FunctionAttrs. The existing one does
not iterate until a fixpoint and does not guarantee that it produces the same
result regardless of iteration order. The new implementation builds up a graph
of how arguments are passed from function to function, and uses a bottom-up walk
on the argument-SCCs to assign nocapture. This gets us nocapture more often, and
does so rather efficiently and independent of iteration order.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@147327 91177308-0d34-0410-b5e6-96231b3b80d8
2011-12-28 23:24:21 +00:00
Benjamin Kramer
c894b02ae0 Switch StringMap from an array of structures to a structure of arrays.
- -25% memory usage of the main table on x86_64 (was wasted in struct padding).
- no significant performance change.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@147294 91177308-0d34-0410-b5e6-96231b3b80d8
2011-12-27 20:35:07 +00:00
Rafael Espindola
ce618af3e8 Section relative fixups are a coff concept, not a x86 one. Replace the
x86 specific reloc_coff_secrel32 with a generic FK_SecRel_4.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@147252 91177308-0d34-0410-b5e6-96231b3b80d8
2011-12-24 14:47:52 +00:00
Rafael Espindola
df09270ae8 Move x86 specific bits of the COFF writer to lib/Target/X86.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@147231 91177308-0d34-0410-b5e6-96231b3b80d8
2011-12-24 02:14:02 +00:00
Rafael Espindola
84070ffbe6 Define trivial destructor inline.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@147230 91177308-0d34-0410-b5e6-96231b3b80d8
2011-12-24 01:53:13 +00:00
Rafael Espindola
ceb09f3884 Make GetRelocType pure virtual.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@147229 91177308-0d34-0410-b5e6-96231b3b80d8
2011-12-24 01:36:25 +00:00
Mon P Wang
d24397a931 When not destroying the source, the linker is not remapping the types. Added support
to CloneFunctionInto to allow remapping for this case.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@147217 91177308-0d34-0410-b5e6-96231b3b80d8
2011-12-23 02:18:32 +00:00
Chris Lattner
8f77c03c39 fix typo
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@147159 91177308-0d34-0410-b5e6-96231b3b80d8
2011-12-22 19:20:51 +00:00
Rafael Espindola
f3a86fb03d Move PPC bits to lib/Target/PowerPC.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@147124 91177308-0d34-0410-b5e6-96231b3b80d8
2011-12-22 01:57:09 +00:00
Akira Hatanaka
bc24985c5f Local dynamic TLS model for direct object output. Create the correct TLS MIPS
ELF relocations.

Patch by Jack Carter.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@147118 91177308-0d34-0410-b5e6-96231b3b80d8
2011-12-22 01:05:17 +00:00
Rafael Espindola
69bbda0391 Move the ARM specific parts of the ELF writer to Target/ARM.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@147115 91177308-0d34-0410-b5e6-96231b3b80d8
2011-12-22 00:37:50 +00:00
Lang Hames
ab26da9e67 Fixed typo.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@147113 91177308-0d34-0410-b5e6-96231b3b80d8
2011-12-22 00:12:51 +00:00
Jakob Stoklund Olesen
a2a98fd0dd Move common code into an MRI function.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@147071 91177308-0d34-0410-b5e6-96231b3b80d8
2011-12-21 19:50:05 +00:00
Manuel Klimek
84cbb6f00d Changes the JSON parser to use the SourceMgr.
Diagnostics are now emitted via the SourceMgr and we use MemoryBuffer
for buffer management. Switched the code to make use of the trailing
'0' that MemoryBuffer guarantees where it makes sense.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@147063 91177308-0d34-0410-b5e6-96231b3b80d8
2011-12-21 18:16:39 +00:00
Rafael Espindola
edae8e1e4d Move the X86 specific bits of the ELF writer to the Target/X86 directory.
Other targets will follow shortly.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@147060 91177308-0d34-0410-b5e6-96231b3b80d8
2011-12-21 17:30:17 +00:00
Rafael Espindola
dc9a8a378d Reduce the exposure of Triple::OSType in the ELF object writer. This will
avoid including ADT/Triple.h in many places when the target specific bits are
moved.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@147059 91177308-0d34-0410-b5e6-96231b3b80d8
2011-12-21 17:00:36 +00:00
Rafael Espindola
d4304031cb Add const.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@147054 91177308-0d34-0410-b5e6-96231b3b80d8
2011-12-21 14:48:04 +00:00
Jakub Staszak
25101bb2a7 Add some constantness to BranchProbabilityInfo and BlockFrequnencyInfo.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@146986 91177308-0d34-0410-b5e6-96231b3b80d8
2011-12-20 20:03:10 +00:00
Devang Patel
45ca049f1f Add support to add named metadata operand.
Patch by Andrew Wilkins!


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@146984 91177308-0d34-0410-b5e6-96231b3b80d8
2011-12-20 19:29:36 +00:00
Manuel Klimek
093147abf4 Fixes a potential compilation error.
Pulling the template implementation into the header to guarantee
that it's visible to all possible instantiations.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@146973 91177308-0d34-0410-b5e6-96231b3b80d8
2011-12-20 11:04:23 +00:00
Manuel Klimek
9ce6937701 Pulls the implementation of skip() into JSONParser.
This is the first step towards migrating more of the parser
implementation into the parser class.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@146971 91177308-0d34-0410-b5e6-96231b3b80d8
2011-12-20 10:42:52 +00:00
Manuel Klimek
c4850c9a06 Addressing style issues in JSON parser.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@146968 91177308-0d34-0410-b5e6-96231b3b80d8
2011-12-20 09:26:26 +00:00
David Blaikie
2d24e2a396 Unweaken vtables as per http://llvm.org/docs/CodingStandards.html#ll_virtual_anch
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@146960 91177308-0d34-0410-b5e6-96231b3b80d8
2011-12-20 02:50:00 +00:00
Chris Lattner
b5e8b8c8f7 fix typo
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@146940 91177308-0d34-0410-b5e6-96231b3b80d8
2011-12-20 01:11:37 +00:00
Chris Lattner
f5c9bd07bc add a method to improve compatibility with SmallVector.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@146928 91177308-0d34-0410-b5e6-96231b3b80d8
2011-12-20 00:03:41 +00:00
Dan Gohman
e3376ecd50 Add basic generic CodeGen support for half.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@146927 91177308-0d34-0410-b5e6-96231b3b80d8
2011-12-20 00:02:33 +00:00
Evan Cheng
8787c5f24e Add a if-conversion optimization that allows 'true' side of a diamond to be
unpredicated. That is, turn
 subeq  r0, r1, #1
 addne  r0, r1, #1                                                                                                                                                                                                     
into
 sub    r0, r1, #1
 addne  r0, r1, #1

For targets where conditional instructions are always executed, this may be
beneficial. It may remove pseudo anti-dependency in out-of-order execution
CPUs. e.g.
 op    r1, ...
 str   r1, [r10]        ; end-of-life of r1 as div result
 cmp   r0, #65
 movne r1, #44  ; raw dependency on previous r1
 moveq r1, #12

If movne is unpredicated, then
 op    r1, ...
 str   r1, [r10]
 cmp   r0, #65
 mov   r1, #44  ; r1 written unconditionally
 moveq r1, #12

Both mov and moveq are no longer depdendent on the first instruction. This gives
the out-of-order execution engine more freedom to reorder them.

This has passed entire LLVM test suite. But it has not been enabled for any ARM
variant pending more performance evaluation.

rdar://8951196


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@146914 91177308-0d34-0410-b5e6-96231b3b80d8
2011-12-19 22:01:30 +00:00
Eli Friedman
638905d90c Add "using" to silence warnings.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@146913 91177308-0d34-0410-b5e6-96231b3b80d8
2011-12-19 21:53:12 +00:00
Eli Friedman
1e2ec6abd4 Attempt to fix PR11607 by shuffling around which class defines which methods.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@146897 91177308-0d34-0410-b5e6-96231b3b80d8
2011-12-19 20:06:03 +00:00
Jakob Stoklund Olesen
570f9a972e Emit a getMatchingSuperRegClass() implementation for every target.
Use information computed while inferring new register classes to emit
accurate, table-driven implementations of getMatchingSuperRegClass().

Delete the old manual, error-prone implementations in the targets.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@146873 91177308-0d34-0410-b5e6-96231b3b80d8
2011-12-19 16:53:34 +00:00
Joerg Sonnenberger
3470693641 Allow inlining of functions with returns_twice calls, if they have the
attribute themselve.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@146851 91177308-0d34-0410-b5e6-96231b3b80d8
2011-12-18 20:35:43 +00:00
Chandler Carruth
1243cdda63 As Doug pointed out (and I really should know), it is perfectly easy to
make VariadicFunction actually be trivial. Do so, and also make it look
more like your standard trivial functor by making it a struct with no
access specifiers. The unit test is updated to initialize its functors
properly.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@146827 91177308-0d34-0410-b5e6-96231b3b80d8
2011-12-17 10:20:15 +00:00
Pete Cooper
2e33944c10 Refactor code used in InstCombine::FoldAndOfICmps to new file.
This will be used by SimplifyCfg in a later commit.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@146803 91177308-0d34-0410-b5e6-96231b3b80d8
2011-12-17 01:20:32 +00:00
Rafael Espindola
8f7d12ccfd Add back the MC bits of 126425. Original patch by Nathan Jeffords. I added the
asm parsing and testcase.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@146801 91177308-0d34-0410-b5e6-96231b3b80d8
2011-12-17 01:14:52 +00:00
Dan Gohman
ce16339930 The powers that be have decided that LLVM IR should now support 16-bit
"half precision" floating-point with a first-class type.

This patch adds basic IR support (but not codegen support).


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@146786 91177308-0d34-0410-b5e6-96231b3b80d8
2011-12-17 00:04:22 +00:00
Manuel Klimek
76f13017fc Adds a JSON parser and a benchmark (json-bench) to catch performance regressions.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@146735 91177308-0d34-0410-b5e6-96231b3b80d8
2011-12-16 13:09:10 +00:00
Chandler Carruth
a602aec869 Make GCC happy by using makeAraryRef instead of the implicit conversion.
I have no idea why GCC can't cope with the implicit conversion and Clang
can, or whose bug it is. Grr.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@146732 91177308-0d34-0410-b5e6-96231b3b80d8
2011-12-16 09:36:16 +00:00
Chandler Carruth
d916ce3c8e Add a generic collection of class templates to ADT for building
variadic-like functions in C++98. See the comments in the header file
for a more detailed description of how these work. We plan to use these
extensively in the AST matching library. This code and idea were
originally authored by Zhanyong Wan. I've condensed it using macros
to reduce repeatition and adjusted it to fit better with LLVM's ADT.

Thanks to both David Blaikie and Doug Gregor for the review!

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@146729 91177308-0d34-0410-b5e6-96231b3b80d8
2011-12-16 08:58:59 +00:00
Kostya Serebryany
7bcfc9950b [asan] fix a bug (issue 19) where dlclose and the following mmap caused a false positive. compiler part.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@146688 91177308-0d34-0410-b5e6-96231b3b80d8
2011-12-15 21:59:03 +00:00
Eli Friedman
b012eb8cc4 Zap unnecessary semicolons.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@146682 91177308-0d34-0410-b5e6-96231b3b80d8
2011-12-15 21:11:38 +00:00
Devang Patel
0508d047fe Update DebugLoc while merging nodes at -O0.
Patch by Kyriakos Georgiou!


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@146670 91177308-0d34-0410-b5e6-96231b3b80d8
2011-12-15 18:21:18 +00:00
Dan Gohman
f042660197 Move Instruction::isSafeToSpeculativelyExecute out of VMCore and
into Analysis as a standalone function, since there's no need for
it to be in VMCore. Also, update it to use isKnownNonZero and
other goodies available in Analysis, making it more precise,
enabling more aggressive optimization.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@146610 91177308-0d34-0410-b5e6-96231b3b80d8
2011-12-14 23:49:11 +00:00
Evan Cheng
020f4106f8 Model ARM predicated write as read-mod-write. e.g.
r0 = mov #0
r0 = moveq #1

Then the second instruction has an implicit data dependency on the first
instruction. Sadly I have yet to come up with a small test case that
demonstrate the post-ra scheduler taking advantage of this.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@146583 91177308-0d34-0410-b5e6-96231b3b80d8
2011-12-14 20:00:08 +00:00
Akira Hatanaka
3faac0a78c Add support for local dynamic TLS model in LowerGlobalTLSAddress. Direct object
emission is not supported yet, but a patch that adds the support should follow
soon.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@146572 91177308-0d34-0410-b5e6-96231b3b80d8
2011-12-14 18:26:41 +00:00
Evan Cheng
12dfdb424d Allow target to specify register output dependency. Still default to one.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@146547 91177308-0d34-0410-b5e6-96231b3b80d8
2011-12-14 02:28:53 +00:00
Evan Cheng
ddfd1377d2 - Add MachineInstrBundle.h and MachineInstrBundle.cpp. This includes a function
to finalize MI bundles (i.e. add BUNDLE instruction and computing register def
  and use lists of the BUNDLE instruction) and a pass to unpack bundles.
- Teach more of MachineBasic and MachineInstr methods to be bundle aware.
- Switch Thumb2 IT block to MI bundles and delete the hazard recognizer hack to
  prevent IT blocks from being broken apart.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@146542 91177308-0d34-0410-b5e6-96231b3b80d8
2011-12-14 02:11:42 +00:00
Chad Rosier
c6cff9daf4 Per discussion on the list, remove BitcodeVerify pass to reimplement as a free function.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@146531 91177308-0d34-0410-b5e6-96231b3b80d8
2011-12-14 00:29:31 +00:00
Michael J. Spencer
5b08230930 Support/FileSystem: Add file_magic and move a vew clients over to it.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@146523 91177308-0d34-0410-b5e6-96231b3b80d8
2011-12-13 23:17:12 +00:00
Michael J. Spencer
b92cb30cf5 Support/Program: Make Change<stream>ToBinary return error_code.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@146522 91177308-0d34-0410-b5e6-96231b3b80d8
2011-12-13 23:16:49 +00:00
Chandler Carruth
63974b2144 Initial CodeGen support for CTTZ/CTLZ where a zero input produces an
undefined result. This adds new ISD nodes for the new semantics,
selecting them when the LLVM intrinsic indicates that the undef behavior
is desired. The new nodes expand trivially to the old nodes, so targets
don't actually need to do anything to support these new nodes besides
indicating that they should be expanded. I've done this for all the
operand types that I could figure out for all the targets. Owners of
various targets, please review and let me know if any of these are
incorrect.

Note that the expand behavior is *conservatively correct*, and exactly
matches LLVM's current behavior with these operations. Ideally this
patch will not change behavior in any way. For example the regtest suite
finds the exact same instruction sequences coming out of the code
generator. That's why there are no new tests here -- all of this is
being exercised by the existing test suite.

Thanks to Duncan Sands for reviewing the various bits of this patch and
helping me get the wrinkles ironed out with expanding for each target.
Also thanks to Chris for clarifying through all the discussions that
this is indeed the approach he was looking for. That said, there are
likely still rough spots. Further review much appreciated.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@146466 91177308-0d34-0410-b5e6-96231b3b80d8
2011-12-13 01:56:10 +00:00
Chad Rosier
b3025864e5 Begin sketching out a bitcode verifier pass. Idea is to emit a .bc file and
then read the file back in to verify use-list serialization/deserialization.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@146439 91177308-0d34-0410-b5e6-96231b3b80d8
2011-12-12 22:57:31 +00:00
Tony Linthicum
b4b54153ad Hexagon backend support
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@146412 91177308-0d34-0410-b5e6-96231b3b80d8
2011-12-12 21:14:40 +00:00
Chad Rosier
7ae606a2a8 Revert r146363 to allow buildbots to make forward progress.
Original commit message:
Support/FileSystem: Implement canonicalize.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@146378 91177308-0d34-0410-b5e6-96231b3b80d8
2011-12-12 17:58:31 +00:00
Roman Divacky
a0c17a495b Add support for gnu_indirect_function.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@146377 91177308-0d34-0410-b5e6-96231b3b80d8
2011-12-12 17:34:04 +00:00
Michael J. Spencer
d45fbe6227 Support/FileSystem: Implement bool equivalent(file_status A, file_status B);
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@146364 91177308-0d34-0410-b5e6-96231b3b80d8
2011-12-12 06:04:28 +00:00
Michael J. Spencer
c3b00e8040 Support/FileSystem: Implement canonicalize.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@146363 91177308-0d34-0410-b5e6-96231b3b80d8
2011-12-12 06:04:01 +00:00
Chandler Carruth
ccbf1e36d3 Switch llvm.cttz and llvm.ctlz to accept a second i1 parameter which
indicates whether the intrinsic has a defined result for a first
argument equal to zero. This will eventually allow these intrinsics to
accurately model the semantics of GCC's __builtin_ctz and __builtin_clz
and the X86 instructions (prior to AVX) which implement them.

This patch merely sets the stage by extending the signature of these
intrinsics and establishing auto-upgrade logic so that the old spelling
still works both in IR and in bitcode. The upgrade logic preserves the
existing (inefficient) semantics. This patch should not change any
behavior. CodeGen isn't updated because it can use the existing
semantics regardless of the flag's value.

Note that this will be followed by API updates to Clang and DragonEgg.

Reviewed by Nick Lewycky!

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@146357 91177308-0d34-0410-b5e6-96231b3b80d8
2011-12-12 04:26:04 +00:00
Dylan Noblesmith
9ea47179e6 ExecutionEngine: refactor interface
The OptLevel is now redundant with the TargetMachine*.
And selectTarget() isn't really JIT-specific and could probably
get refactored into one of the lower level libraries.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@146355 91177308-0d34-0410-b5e6-96231b3b80d8
2011-12-12 04:20:36 +00:00
Nick Lewycky
531bb82556 Minimize #include's and forward-declares in Target.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@146335 91177308-0d34-0410-b5e6-96231b3b80d8
2011-12-10 22:35:47 +00:00
Nick Lewycky
46c313fb5a Fix typo, reported by Eitan Adler!
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@146316 91177308-0d34-0410-b5e6-96231b3b80d8
2011-12-10 03:16:20 +00:00
Bill Wendling
f4374e46fd Add dump method for debugging.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@146293 91177308-0d34-0410-b5e6-96231b3b80d8
2011-12-09 23:18:34 +00:00
Jakub Staszak
2fac1d5d61 SplitBlockPredecessors uses ArrayRef instead of Data and Size.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@146277 91177308-0d34-0410-b5e6-96231b3b80d8
2011-12-09 21:19:53 +00:00
Chad Rosier
cd462d055f [fast-isel] Add support for selecting insertvalue.
rdar://10530851

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@146276 91177308-0d34-0410-b5e6-96231b3b80d8
2011-12-09 20:09:54 +00:00
Kevin Enderby
94c2e85bea The second part of support for generating dwarf for assembly source files. This
generates the dwarf Compile Unit DIE and a dwarf subprogram DIE for each
non-temporary label.

The next part will be to get the clang driver to enable this when assembling
a .s file.  rdar://9275556


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@146262 91177308-0d34-0410-b5e6-96231b3b80d8
2011-12-09 18:09:40 +00:00
Evan Cheng
32f9763017 Move isUnpredicatedTerminator() default implementation to TargetInstrInfoImpl to break Target's dependency on CodeGen.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@146247 91177308-0d34-0410-b5e6-96231b3b80d8
2011-12-09 06:41:08 +00:00
Andrew Trick
5d73448bb7 Add -unroll-runtime for unrolling loops with run-time trip counts.
Patch by Brendon Cahoon!

This extends the existing LoopUnroll and LoopUnrollPass. Brendon
measured no regressions in the llvm test suite with -unroll-runtime
enabled. This implementation works by using the existing loop
unrolling code to unroll the loop by a power-of-two (default 8). It
generates an if-then-else sequence of code prior to the loop to
execute the extra iterations before entering the unrolled loop.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@146245 91177308-0d34-0410-b5e6-96231b3b80d8
2011-12-09 06:19:40 +00:00
Michael J. Spencer
a81ac8f2b5 Support/FileSystem: Implement recursive_directory_iterator and make
directory_iterator preserve InputIterator semantics on copy.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@146200 91177308-0d34-0410-b5e6-96231b3b80d8
2011-12-08 22:50:09 +00:00
Eli Friedman
0572c7d31e Remove reference to dead GEPSplitterPass. PR11506.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@146195 91177308-0d34-0410-b5e6-96231b3b80d8
2011-12-08 22:28:17 +00:00
Owen Anderson
243eb9ecbb Enhance both TargetLibraryInfo and SelectionDAGBuilder so that the latter can use the former to prevent the formation of libm SDNode's when -fno-builtin is passed.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@146193 91177308-0d34-0410-b5e6-96231b3b80d8
2011-12-08 22:15:21 +00:00
Evan Cheng
43d5d4ca1c Make MachineInstr instruction property queries more flexible. This change all
clients to decide whether to look inside bundled instructions and whether
the query should return true if any / all bundled instructions have the
queried property.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@146168 91177308-0d34-0410-b5e6-96231b3b80d8
2011-12-08 19:23:10 +00:00