Commit Graph

88270 Commits

Author SHA1 Message Date
Chandler Carruth
f5867ab717 Go ahead and get rid of the old page size interface and convert all the
users over to the new one. No sense maintaining this "compatibility"
layer it seems.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@171331 91177308-0d34-0410-b5e6-96231b3b80d8
2012-12-31 23:31:56 +00:00
Chandler Carruth
814afe91cc Flesh out a page size accessor in the new API.
Implement the old API in terms of the new one. This simplifies the
implementation on Windows which can now re-use the self_process's once
initialization.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@171330 91177308-0d34-0410-b5e6-96231b3b80d8
2012-12-31 23:23:35 +00:00
Chandler Carruth
02d75477cd Remove the declspecs from small alignments that we can force with
a union. These don't actually work for by-value function arguments, and
MSVC warns if they exist even while (we hope) it aligns the argument
correctly due to the other union member.

This means MSVC will miss out on optimizations based on the alignment of
the buffer, but really, there aren't that many for x86 and MSVC is
likely not doing a great job of optimizing LLVM and Clang anyways.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@171328 91177308-0d34-0410-b5e6-96231b3b80d8
2012-12-31 22:18:01 +00:00
Chandler Carruth
e0e1985b3b Remove an unused function in the old Process interface.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@171327 91177308-0d34-0410-b5e6-96231b3b80d8
2012-12-31 22:17:59 +00:00
Nuno Lopes
5cec34754d reimplement GetPointerBaseWithConstantOffset().
The new code is an improved copy of the code I deleted from Analysis/Loads.cpp.
One less compute-constant-gep-offset implementation. yay :)

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@171326 91177308-0d34-0410-b5e6-96231b3b80d8
2012-12-31 20:48:35 +00:00
Nuno Lopes
0a9ff4cab3 recommit r171298 (add support for PHI nodes to ObjectSizeOffsetVisitor). Hopefully with bugs corrected now.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@171325 91177308-0d34-0410-b5e6-96231b3b80d8
2012-12-31 20:45:10 +00:00
Michael J. Spencer
3c6f89aa2e [AlignOf] Add AlignedCharArray and refactor AlignedCharArrayUnion.
This adds AlignedCharArray<Alignment, Size>. A templated struct that contains
a member named buffer of type char[Size] that is aligned to Alignment.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@171319 91177308-0d34-0410-b5e6-96231b3b80d8
2012-12-31 19:54:45 +00:00
Benjamin Kramer
44365353a4 Revert "add support for PHI nodes to ObjectSizeOffsetVisitor"
This reverts r171298. Breaks clang selfhost.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@171318 91177308-0d34-0410-b5e6-96231b3b80d8
2012-12-31 19:51:10 +00:00
Jakub Staszak
526057921d Add extra CHECK to make sure that 'or' instruction was replaced.
Also add an assert to avoid confusion in the code where is known that C1 <= C2.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@171310 91177308-0d34-0410-b5e6-96231b3b80d8
2012-12-31 18:26:42 +00:00
Rafael Espindola
5b712efd9a Fix bits check in ELFObjectFile::isSectionZeroInit().
Fixes PR14723.

Patch by Sami Liedes!

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@171309 91177308-0d34-0410-b5e6-96231b3b80d8
2012-12-31 18:20:51 +00:00
Nuno Lopes
2e594fa85c revert r171306, since we cannot compare APInts with different bitwidths
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@171308 91177308-0d34-0410-b5e6-96231b3b80d8
2012-12-31 18:01:36 +00:00
Nuno Lopes
1ef05b1a2a use ValueTracking's GetPointerBaseWithConstantOffset() function instead of a local implementation
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@171307 91177308-0d34-0410-b5e6-96231b3b80d8
2012-12-31 17:42:11 +00:00
Nuno Lopes
a44766a4dd minor code simplification
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@171306 91177308-0d34-0410-b5e6-96231b3b80d8
2012-12-31 17:25:24 +00:00
Rafael Espindola
87b47ccc5a Use the generic dump template. Extracted from a patch by Sami Liedes.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@171305 91177308-0d34-0410-b5e6-96231b3b80d8
2012-12-31 16:53:01 +00:00
Rafael Espindola
fc73847d8f Dump sections. Extracted from a patch by Sami Liedes.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@171304 91177308-0d34-0410-b5e6-96231b3b80d8
2012-12-31 16:29:44 +00:00
Nuno Lopes
41be2fb1f9 add support for GlobalAlias to ObjectSizeOffsetVisitor
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@171303 91177308-0d34-0410-b5e6-96231b3b80d8
2012-12-31 16:23:48 +00:00
Rafael Espindola
148ee4f224 Print a header above the symbols. Extracted from a patch by Sami Liedes.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@171302 91177308-0d34-0410-b5e6-96231b3b80d8
2012-12-31 16:05:21 +00:00
Rafael Espindola
ad784790ad Check for errors. Extracted from a patch by Sami Liedes.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@171301 91177308-0d34-0410-b5e6-96231b3b80d8
2012-12-31 15:45:31 +00:00
Rafael Espindola
1318e14f3e Fix indentation. Extracted from a patch by Sami Liedes!
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@171300 91177308-0d34-0410-b5e6-96231b3b80d8
2012-12-31 15:30:58 +00:00
Rafael Espindola
663cebc4ad Style fixes in llvm-readobj.cpp. Extracted from a patch by Sami Liedes!
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@171299 91177308-0d34-0410-b5e6-96231b3b80d8
2012-12-31 15:27:42 +00:00
Nuno Lopes
729e602082 add support for PHI nodes to ObjectSizeOffsetVisitor
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@171298 91177308-0d34-0410-b5e6-96231b3b80d8
2012-12-31 13:52:36 +00:00
Bill Wendling
6931055232 Remove dead method.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@171295 91177308-0d34-0410-b5e6-96231b3b80d8
2012-12-31 11:52:55 +00:00
Bill Wendling
92e287f5bd Add some comparison operators to compare the Attribute object with the AttrKind value.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@171294 91177308-0d34-0410-b5e6-96231b3b80d8
2012-12-31 11:51:54 +00:00
Sean Silva
5d0d67f3d1 docs: Fix FIXME
I actually made a think-o when writing this FIXME since I wrote LangRef
but it should actually have said WritingAnLLVMBackend.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@171293 91177308-0d34-0410-b5e6-96231b3b80d8
2012-12-31 11:49:51 +00:00
Chandler Carruth
9b4aba85a8 Switch this code to a more idiomatic double using namespace directive.
Fix a truly odd namespace qualifier that was flat out wrong in the
process. The fully qualified namespace would have been
llvm::sys::TimeValue, llvm::TimeValue makes no sense.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@171292 91177308-0d34-0410-b5e6-96231b3b80d8
2012-12-31 11:45:20 +00:00
Chandler Carruth
8e98c1f254 Delete a cut/paste-o from r171290. Very sorry about the noise.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@171291 91177308-0d34-0410-b5e6-96231b3b80d8
2012-12-31 11:40:04 +00:00
Chandler Carruth
c9bdcac412 Suppress a MSVC warning complaining about the code working as intended.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@171290 91177308-0d34-0410-b5e6-96231b3b80d8
2012-12-31 11:39:02 +00:00
Chandler Carruth
0184a841d3 Begin sketching out the process interface.
The coding style used here is not LLVM's style because this is modeled
after a Boost interface and thus done in the style of a candidate C++
standard library interface. I'll probably end up proposing it as
a standard C++ library if it proves to be reasonably portable and
useful.

This is just the most basic parts of the interface -- getting the
process ID out of it. However, it helps sketch out some of the boiler
plate such as the base class, derived class, shared code, and static
factory function. It also introduces a unittest so that I can
incrementally ensure this stuff works.

However, I've not even compiled this code for Windows yet. I'll try to
fix any Windows fallout from the bots, and if I can't fix it I'll revert
and get someone on Windows to help out. There isn't a lot more that is
mandatory, so soon I'll switch to just stubbing out the Windows side and
get Michael Spencer to help with implementation as he can test it
directly.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@171289 91177308-0d34-0410-b5e6-96231b3b80d8
2012-12-31 11:17:50 +00:00
Chandler Carruth
dac1eeb4b7 Start sketching out a roadmap for better subprocess management in the
LLVM libraries. Also, clean up the doxygen and formatting of the
existing interfaces.

With this change I'm calling the existing interface "legacy" because I'd
like to replace it with something much better. My end goal is to expose
a common set of interfaces for inspecting various properties of
a process, and implementations to expose those both for the current
process and for child processes. This will also expose more rich
interfaces for spawning and controling a subprocess, notably to use
system calls like wait3 and wait4 where available and gather detailed
resource usage stats about the subprocess.

My plan (discussed with Michael Spencer on IRC) is to base this loosely
around the proposed Boost.Process interface, but to implement
a relatively small subset of that functionality based around the needs
of LLVM, Clang, the Clang driver, etc.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@171285 91177308-0d34-0410-b5e6-96231b3b80d8
2012-12-31 09:29:16 +00:00
Chris Lattner
503fc1c488 Fix LICM's memory promotion optimization to preserve TBAA tags when
promoting a store in a loop.  This was noticed when working on PR14753,
but isn't directly related.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@171281 91177308-0d34-0410-b5e6-96231b3b80d8
2012-12-31 08:37:17 +00:00
Chris Lattner
240b9b1d80 teach instcombine to preserve TBAA tag when merging two stores, part of
PR14753


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@171279 91177308-0d34-0410-b5e6-96231b3b80d8
2012-12-31 08:10:58 +00:00
Jakub Staszak
b6d9c4181a Grammo.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@171272 91177308-0d34-0410-b5e6-96231b3b80d8
2012-12-31 01:40:44 +00:00
Bill Wendling
9d30e7208e Remove the getAttributesAtIndex and getNumAttrs methods in favor of using the getAttrSomewhere predicate. This prevents the uses of 'Attribute' as a collection of attributes.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@171271 91177308-0d34-0410-b5e6-96231b3b80d8
2012-12-31 00:49:59 +00:00
Jakub Staszak
d60b8ac64f Transform (A == C1 || A == C2) into (A & ~(C1 ^ C2)) == C1
if C1 and C2 differ only with one bit.
Fixes PR14708.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@171270 91177308-0d34-0410-b5e6-96231b3b80d8
2012-12-31 00:34:55 +00:00
Hal Finkel
6eb7a4270b Support ppcf128 in SelectionDAG::getConstantFP
Fixes pr14751.

Patch by Kai; Thanks!

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@171261 91177308-0d34-0410-b5e6-96231b3b80d8
2012-12-30 19:03:32 +00:00
Nuno Lopes
98281a2050 convert a bunch of callers from DataLayout::getIndexedOffset() to GEP::accumulateConstantOffset().
The later API is nicer than the former, and is correct regarding wrap-around offsets (if anyone cares).
There are a few more places left with duplicated code, which I'll remove soon.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@171259 91177308-0d34-0410-b5e6-96231b3b80d8
2012-12-30 16:25:48 +00:00
Dmitri Gribenko
0d80c9c8c7 Documentation: add a section to prevent spurious test failures like the one
fixed in r171243.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@171258 91177308-0d34-0410-b5e6-96231b3b80d8
2012-12-30 14:51:03 +00:00
Bill Wendling
94e94b3506 Use the predicate methods off of AttributeSet instead of Attribute.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@171257 91177308-0d34-0410-b5e6-96231b3b80d8
2012-12-30 13:50:49 +00:00
Bill Wendling
8b62abdd7b Remove the Function::getRetAttributes method in favor of using the AttributeSet accessor method.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@171256 91177308-0d34-0410-b5e6-96231b3b80d8
2012-12-30 13:01:51 +00:00
Bill Wendling
39cd0c8e47 Remove Function::getParamAttributes and use the AttributeSet accessor methods instead.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@171255 91177308-0d34-0410-b5e6-96231b3b80d8
2012-12-30 12:45:13 +00:00
Bill Wendling
831737d329 Remove the Function::getFnAttributes method in favor of using the AttributeSet
directly.

This is in preparation for removing the use of the 'Attribute' class as a
collection of attributes. That will shift to the AttributeSet class instead.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@171253 91177308-0d34-0410-b5e6-96231b3b80d8
2012-12-30 10:32:01 +00:00
Bill Wendling
377660355c s/hasAttribute/contains/g to be more consistent with other method names.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@171252 91177308-0d34-0410-b5e6-96231b3b80d8
2012-12-30 09:17:46 +00:00
Nadav Rotem
db2367512e LoopVectorizer: Fix a bug in the code that updates the loop exiting block.
LCSSA PHIs may have undef values. The vectorizer updates values that are used by outside users such as PHIs.
The bug happened because undefs are not loop values. This patch handles these PHIs.

PR14725



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@171251 91177308-0d34-0410-b5e6-96231b3b80d8
2012-12-30 07:47:00 +00:00
Dmitri Gribenko
a6542923b8 Tests: rewrite 'opt ... %s' to 'opt ... < %s' so that opt does not emit a ModuleID
This is done to avoid odd test failures, like the one fixed in r171243.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@171250 91177308-0d34-0410-b5e6-96231b3b80d8
2012-12-30 02:33:22 +00:00
Bill Wendling
979aff6399 Add a few more c'tors:
* One that accepts a single Attribute::AttrKind.

* One that accepts an Attribute::AttrKind plus a list of values. This is for
  attributes defined like this:

    #1 = attributes { align = 4 }

* One that accepts a string, for target-specific attributes like this:

    #2 = attributes { "cpu=cortex-a8" }


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@171249 91177308-0d34-0410-b5e6-96231b3b80d8
2012-12-30 02:22:16 +00:00
Dmitri Gribenko
a51edf0986 Add a check to the test Analysis/ScalarEvolution/2010-09-03-RequiredTransitive.ll
This test did not test anything at all (except for opt crashing, but that was
not the reason why it was added).


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@171248 91177308-0d34-0410-b5e6-96231b3b80d8
2012-12-30 01:42:34 +00:00
Bill Wendling
529ec718ac Add a few (as yet unused) query methods to determine if the attribute that's
stored here is of a certain kind. This is in preparation for when an Attribute
object represents a single attribute, instead of a bitmask of attributes.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@171247 91177308-0d34-0410-b5e6-96231b3b80d8
2012-12-30 01:38:39 +00:00
Dmitri Gribenko
b4912b9dcc Tests: rewrite 'opt ... %s' to 'opt ... < %s' so that opt does not emit a ModuleID
This is done to avoid odd test failures, like the one fixed in r171243.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@171246 91177308-0d34-0410-b5e6-96231b3b80d8
2012-12-30 01:28:40 +00:00
Bill Wendling
435654b181 Uniquify the AttributeImpl based on the Constant pointer, since those are
already uniquified.

Note: This will be expanded in the future to add more than just one pointer
value.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@171245 91177308-0d34-0410-b5e6-96231b3b80d8
2012-12-30 01:23:08 +00:00
Bill Wendling
c966e08a98 s/Raw/getBitMask/g to be more in line with current naming conventions. This method won't be sticking around.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@171244 91177308-0d34-0410-b5e6-96231b3b80d8
2012-12-30 01:05:42 +00:00