Commit Graph

147291 Commits

Author SHA1 Message Date
Jason Molenda becd639c0e Update MachVMMemory::PageSize to get the page size of a specific process
if we have an updated task_info call available; else fall back to getting
the default host-wide page size.

Update all uses of the vm page size to get it via MachVMMemory::PageSize().

<rdar://problem/13477763>, <rdar://problem/13498504> 

llvm-svn: 178953
2013-04-06 07:16:15 +00:00
Richard Smith 85465e608d Remove nondeterminism introduced in r178950.
llvm-svn: 178952
2013-04-06 07:07:44 +00:00
Jason Molenda b861fe5df2 Change the default of 'platform.plugin.darwin-kernel.search-locally-for-kexts'
to 'off' for a week or so while we test the behavior in different environments.

llvm-svn: 178951
2013-04-06 05:25:38 +00:00
Richard Smith df931ce82c When an internal-linkage function or variable is declared within an extern "C"
linkage specification, and is marked as __attribute__((used)), try to also give
it the unmangled name (by emitting an internal linkage alias) if nothing else
within the translation unit would use that name. This allows inline asm in that
translation unit to use the entity via its unmangled name, which people
apparently rely on.

llvm-svn: 178950
2013-04-06 05:00:46 +00:00
Nadav Rotem c4bd84c1d5 typo
llvm-svn: 178949
2013-04-06 04:24:12 +00:00
Rafael Espindola 91af8e84b9 Remove last use of InMemoryStruct from MachOObjectFile.cpp.
llvm-svn: 178948
2013-04-06 03:50:05 +00:00
Rafael Espindola 15e2a9cd57 Don't use InMemoryStruct<macho::SymtabLoadCommand>.
This also required not using the RegisterStringTable API, which is also a
good thing.

llvm-svn: 178947
2013-04-06 03:31:08 +00:00
Rafael Espindola a65f5de499 Don't use InMemoryStruct in getSymbol64TableEntry.
llvm-svn: 178946
2013-04-06 02:15:44 +00:00
Rafael Espindola 2a34c2d8dd Don't use InMemoryStruct in getSymbolTableEntry.
llvm-svn: 178945
2013-04-06 01:59:05 +00:00
Jordan Rose 4db7c1e7e5 [analyzer] When creating a trimmed graph, preserve whether a node is a sink.
This is important because sometimes two nodes are identical, except the
second one is a sink.

This bug has probably been around for a while, but it wouldn't have been an
issue in the old report graph algorithm. I'm ashamed to say I actually looked
at this the first time around and thought it would never be a problem...and
then didn't include an assertion to back that up.

PR15684

llvm-svn: 178944
2013-04-06 01:42:02 +00:00
Rafael Espindola 7caf2fbdc3 Don't use InMemoryStruct in getRelocation.
llvm-svn: 178943
2013-04-06 01:24:11 +00:00
Argyrios Kyrtzidis 501d90bf9f [objcmt] Fix a mishandled conversion to objc directory literal.
rdar://13181413

llvm-svn: 178942
2013-04-06 01:13:17 +00:00
Manman Ren 5b22f9fe18 Dwarf: use utostr on CUID to append to SmallString.
We used to do "SmallString += CUID", which is incorrect, since CUID will
be truncated to a char.

rdar://problem/13573833

llvm-svn: 178941
2013-04-06 01:02:38 +00:00
Michael J. Spencer d4eb47c110 Add VTune as an optional external dependency and add task tracking.
llvm-svn: 178940
2013-04-06 00:56:40 +00:00
Douglas Gregor e9846f7f3c <rdar://problem/13325066> Destroy std::initializer_list temporaries whose lifetime has been extended by reference binding.
llvm-svn: 178939
2013-04-06 00:46:20 +00:00
Anna Zaks a1de8567fc [analyzer] Shorten the malloc checker’s leak message
As per Ted’s suggestion!

llvm-svn: 178938
2013-04-06 00:41:36 +00:00
Ted Kremenek b54457242c Rework how ObjC method inherit deprecated/availability.
New rule:
- Method decls in @implementation are considered "redeclarations"
  and inherit deprecated/availability from the @interface.
- All other cases are consider overrides, which do not inherit
  deprecated/availability.  For example:

  (a) @interface redeclares a method in an adopted protocol.
  (b) A subclass redeclares a method in a superclass.
  (c) A protocol redeclares a method from another protocol it adopts.

The idea is that API authors should have the ability to easily
move availability/deprecated up and down a class/protocol hierarchy.
A redeclaration means that the availability/deprecation is a blank
slate.

Fixes <rdar://problem/13574571>

llvm-svn: 178937
2013-04-06 00:34:27 +00:00
Jim Ingham f1ff3bb680 Don't call DisableBreakpointSite (i.e. don't try to remove the breakpoint from the target process) if the target
process is no longer alive.

<rdar://problem/13320991>

llvm-svn: 178936
2013-04-06 00:16:39 +00:00
Anna Zaks 4d1e30471d [analyzer] Reword error messages for nil keys and values of NSMutableDictionary.
llvm-svn: 178935
2013-04-05 23:50:18 +00:00
Anna Zaks a4fdefffd0 [analyzer] Remove another redundancy from trackNullOrUndef
llvm-svn: 178934
2013-04-05 23:50:14 +00:00
Anna Zaks 94b48bdbba [analyzer] Fix null tracking for the given test case, by using the proper state and removing redundant code.
llvm-svn: 178933
2013-04-05 23:50:11 +00:00
Michael Gottesman 7924997c36 Removed trailing whitespace.
llvm-svn: 178932
2013-04-05 23:46:45 +00:00
Tom Stellard 754f80ff3a R600/SI: Add support for buffer stores v2
v2:
  - Use the ADDR64 bit

Reviewed-by: Christian König <christian.koenig@amd.com>
llvm-svn: 178931
2013-04-05 23:31:51 +00:00
Tom Stellard 6db08eb42f R600/SI: Use same names for corresponding MUBUF operands and encoding fields
The code emitter knows how to encode operands whose name matches one of
the encoding fields.  If there is no match, the code emitter relies on
the order of the operand and field definitions to determine how operands
should be encoding.  Matching by order makes it easy to accidentally break
the instruction encodings, so we prefer to match by name.

Reviewed-by: Christian König <christian.koenig@amd.com>
llvm-svn: 178930
2013-04-05 23:31:44 +00:00
Tom Stellard 60174bb9ca R600: Add RV670 processor
This is an R600 GPU with double support.

Reviewed-by: Christian König <christian.koenig@amd.com>
llvm-svn: 178929
2013-04-05 23:31:40 +00:00
Tom Stellard 2f21c7e551 R600/SI: Add processor types for each SI variant
Reviewed-by: Christian König <christian.koenig@amd.com>
llvm-svn: 178928
2013-04-05 23:31:35 +00:00
Tom Stellard edbf1eb42b R600/SI: Avoid generating S_MOVs with 64-bit immediates v2
SITargetLowering::analyzeImmediate() was converting the 64-bit values
to 32-bit and then checking if they were an inline immediate.  Some
of these conversions caused this check to succeed and produced
S_MOV instructions with 64-bit immediates, which are illegal.

v2:
  - Clean up logic

Reviewed-by: Christian König <christian.koenig@amd.com>
llvm-svn: 178927
2013-04-05 23:31:20 +00:00
Hal Finkel ed6a28597b Enable early if conversion on PPC
On cores for which we know the misprediction penalty, and we have
the isel instruction, we can profitably perform early if conversion.
This enables us to replace some small branch sequences with selects
and avoid the potential stalls from mispredicting the branches.

Enabling this feature required implementing canInsertSelect and
insertSelect in PPCInstrInfo; isel code in PPCISelLowering was
refactored to use these functions as well.

llvm-svn: 178926
2013-04-05 23:29:01 +00:00
Hal Finkel 85526f2e71 Correct the PPC A2 misprediction penalty
The manual states that there is a minimum of 13 cycles from when the
mispredicted branch is issued to when the correct branch target is
issued.

llvm-svn: 178925
2013-04-05 23:28:58 +00:00
Greg Clayton 1c8ef47681 Added support "__attribute__((__vector_size__(B)))" and "__attribute__((ext_vector_type(N)))".
Now we can:
1 - see the return value for functions that return types that use the "ext_vector_size"
2 - dump values that use the vector attributes ("expr $ymm0")
3 - modified the DWARF parser to correctly parse GNU vector types from the DWARF by turning them into clang::Type::ExtVector types instead of just standard arrays

llvm-svn: 178924
2013-04-05 23:27:21 +00:00
Richard Trieu 05c4d023f3 When -Woverloaded-virtual is triggered, call HandleFunctionTypeMismatch to add
more information to the notes.  This information is already present on other
diagnostic messages that involves overloads.

llvm-svn: 178923
2013-04-05 23:02:24 +00:00
Michael Gottesman 31ba23aa56 An objc_retain can serve as a use for a different pointer.
This is the counterpart to commit r160637, except it performs the action
in the bottomup portion of the data flow analysis.

llvm-svn: 178922
2013-04-05 22:54:32 +00:00
Michael Gottesman 1d8d25777d Properly model precise lifetime when given an incomplete dataflow sequence.
The normal dataflow sequence in the ARC optimizer consists of the following
states:

    Retain -> CanRelease -> Use -> Release

The optimizer before this patch stored the uses that determine the lifetime of
the retainable object pointer when it bottom up hits a retain or when top down
it hits a release. This is correct for an imprecise lifetime scenario since what
we are trying to do is remove retains/releases while making sure that no
``CanRelease'' (which is usually a call) deallocates the given pointer before we
get to the ``Use'' (since that would cause a segfault).

If we are considering the precise lifetime scenario though, this is not
correct. In such a situation, we *DO* care about the previous sequence, but
additionally, we wish to track the uses resulting from the following incomplete
sequences:

  Retain -> CanRelease -> Release   (TopDown)
  Retain <- Use <- Release          (BottomUp)

*NOTE* This patch looks large but the most of it consists of updating
test cases. Additionally this fix exposed an additional bug. I removed
the test case that expressed said bug and will recommit it with the fix
in a little bit.

llvm-svn: 178921
2013-04-05 22:54:28 +00:00
Jason Molenda 3b59f5c804 Reorder the Platform plugin settings so that they're now
platform.plugin.darwin-kernel.kext-directories
platform.plugin.darwin-kernel.search-locally-for-kexts

and fix a few FileSpec handling issues for the kext-directories setting.

llvm-svn: 178920
2013-04-05 22:40:42 +00:00
Hal Finkel 3005c299b5 Reapply r178845 with fix - Fix bug in PEI's virtual-register scavenging
This fixes PEI as previously described, but correctly handles the case where
the instruction defining the virtual register to be scavenged is the first in
the block. Arnold provided me with a bugpoint-reduced test case, but even that
seems too large to use as a regression test. If I'm successful in cleaning it
up then I'll commit that as well.

Original commit message:

    This change fixes a bug that I introduced in r178058. After a register is
    scavenged using one of the available spills slots the instruction defining the
    virtual register needs to be moved to after the spill code. The scavenger has
    already processed the defining instruction so that registers killed by that
    instruction are available for definition in that same instruction. Unfortunately,
    after this, the scavenger needs to iterate through the spill code and then
    visit, again, the instruction that defines the now-scavenged register. In order
    to avoid confusion, the register scavenger needs the ability to 'back up'
    through the spill code so that it can again process the instructions in the
    appropriate order. Prior to this fix, once the scavenger reached the
    just-moved instruction, it would assert if it killed any registers because,
    having already processed the instruction, it believed they were undefined.

    Unfortunately, I don't yet have a small test case. Thanks to Pranav Bhandarkar
    for diagnosing the problem and testing this fix.

llvm-svn: 178919
2013-04-05 22:31:56 +00:00
Michael J. Spencer e6d5609de4 Revert "Correctly pass ownership of MemoryBuffers."
llvm-svn: 178918
2013-04-05 22:04:44 +00:00
Bill Wendling eb108bad50 Use the target options specified on a function to reset the back-end.
During LTO, the target options on functions within the same Module may
change. This would necessitate resetting some of the back-end. Do this for X86,
because it's a Friday afternoon.

llvm-svn: 178917
2013-04-05 21:52:40 +00:00
Hal Finkel 81c46d0809 Revert r178845 - Fix bug in PEI's virtual-register scavenging
Reverting because this breaks one of the LTO builders. Original commit message:

    This change fixes a bug that I introduced in r178058. After a register is
    scavenged using one of the available spills slots the instruction defining the
    virtual register needs to be moved to after the spill code. The scavenger has
    already processed the defining instruction so that registers killed by that
    instruction are available for definition in that same instruction. Unfortunately,
    after this, the scavenger needs to iterate through the spill code and then
    visit, again, the instruction that defines the now-scavenged register. In order
    to avoid confusion, the register scavenger needs the ability to 'back up'
    through the spill code so that it can again process the instructions in the
    appropriate order. Prior to this fix, once the scavenger reached the
    just-moved instruction, it would assert if it killed any registers because,
    having already processed the instruction, it believed they were undefined.

    Unfortunately, I don't yet have a small test case. Thanks to Pranav Bhandarkar
    for diagnosing the problem and testing this fix.

llvm-svn: 178916
2013-04-05 21:30:40 +00:00
Jim Grosbach bdbd73460c Tidy up a bit. No functional change.
llvm-svn: 178915
2013-04-05 21:20:12 +00:00
Michael J. Spencer ce1e53e19c Correctly pass ownership of MemoryBuffers.
llvm-svn: 178914
2013-04-05 21:08:30 +00:00
Michael J. Spencer 096ea03f31 Fix uninitialized variables. Found by ubsan.
llvm-svn: 178913
2013-04-05 21:07:44 +00:00
Shuxin Yang 95adf5258f Disable the optimization about promoting vector-element-access with symbolic index.
This optimization is unstable at this moment; it 
  1) block us on a very important application
  2) PR15200
  3) test6 and test7 in test/Transforms/ScalarRepl/dynamic-vector-gep.ll
     (the CHECK command compare the output against wrong result)

   I personally believe this optimization should not have any impact on the
autovectorized code, as auto-vectorizer is supposed to put gather/scatter
in a "right" way.  Although in theory downstream optimizaters might reveal 
some gather/scatter optimization opportunities, the chance is quite slim.

   For the hand-crafted vectorizing code, in term of redundancy elimination,
load-CSE, copy-propagation and DSE can collectively achieve the same result,
but in much simpler way. On the other hand, these optimizers are able to 
improve the code in a incremental way; in contrast, SROA is sort of all-or-none
approach. However, SROA might slighly win in stack size, as it tries to figure 
out a stretch of memory tightenly cover the area accessed by the dynamic index.

 rdar://13174884
 PR15200

llvm-svn: 178912
2013-04-05 21:07:08 +00:00
Argyrios Kyrtzidis 2ec76747f4 [libclang] Fix cursor visitation to not ignore template arguments in out-of-line member functions.
rdar://13535645

llvm-svn: 178911
2013-04-05 21:04:10 +00:00
Akira Hatanaka fac2db4a3d [mips] XFAIL test-interp-vec-loadstore.ll in an attempt to turn builder
llvm-mips-linux green.

llvm-mips-linux runs on a big endian machine. This test passes if I change 'e'
to 'E' in the target data layout string.

llvm-svn: 178910
2013-04-05 20:54:46 +00:00
Douglas Gregor 0cb6846090 <rdar://problem/13551789> Fix a race in the LockFileManager.
It's possible for the lock file to disappear and the owning process to
return before we're able to see the generated file. Spin for a little
while to see if it shows up before failing. 

llvm-svn: 178909
2013-04-05 20:53:57 +00:00
Douglas Gregor 6bd4d8cf72 <rdar://problem/13551789> Fix yet another race in unique_file.
If the directory that will contain the unique file doesn't exist when
we tried to create the file, but another process creates it before we
get a chance to try creating it, we would bail out rather than try to
create the unique file.

llvm-svn: 178908
2013-04-05 20:48:36 +00:00
Ariel J. Bernal 005daf1bc6 Fix UseNullptr fails to replace explict casts surrounded by another implicit
cast

UseNullptr previously matched the implicit cast to const pointer as well as
the explicit cast within that has an implicit cast to nullptr as a descendant.

-Refactored UseNullptr to avoid special-casing certain kinds of cast sequences
-Added test cases.

llvm-svn: 178907
2013-04-05 20:32:36 +00:00
Tanya Lattner 713eef4f7c Add an error to check that all program scope variables are in the constant address space in OpenCL.
llvm-svn: 178906
2013-04-05 20:14:50 +00:00
Michael J. Spencer b8055cbc9d [Support][FileSystem] Fix identify_magic for big endian ELF.
llvm-svn: 178905
2013-04-05 20:10:04 +00:00
Rafael Espindola 3add3e9c4a Move yaml2obj to tools too.
llvm-svn: 178904
2013-04-05 20:00:35 +00:00