Commit Graph

214588 Commits

Author SHA1 Message Date
Johannes Doerfert 475d8e3f42 [FIX] Ensure base pointer origin was preloaded already
If a base pointer of a preloaded value has a base pointer origin, thus it is
  an indirect invariant load, we have to make sure the base pointer origin is
  preloaded first.

llvm-svn: 251946
2015-11-03 16:49:02 +00:00
Johannes Doerfert d6fc0701ee [FIX] Carefully rewrite parameters wrt. invariant equivalence classes
ScalarEvolution doesn't allow the operands of an AddRec to be variant in the
  loop of the AddRec. When we rewrite parameter SCEVs it might seem like the
  new SCEV violates this property and ScalarEvolution will trigger an
  assertion. To avoid this we move the start part out of an AddRec when we
  rewrite it, thus avoid the operands to be possibly variant completely.

llvm-svn: 251945
2015-11-03 16:47:58 +00:00
Rafael Espindola e63e0188e4 Revert "Revert "[Orc] Directly emit machine code for the x86 resolver block and trampolines.""
This reverts commit r251937.

The test was updated to the new API, bring the API back.

llvm-svn: 251944
2015-11-03 16:40:37 +00:00
Angel Garcia Gomez 432ff5e205 Handle correctly containers that are data members in modernize-loop-convert.
Summary:
I recently found that the variable naming wasn't working as expected with containers that are data members. The new index always received the name "Elem" (or equivalent) regardless of the container's name.
The check was assuming that the container's declaration was a VarDecl, which cannot be converted to a FieldDecl (a data member), and then it could never retrieve its name.

This also fixes some cases where the check failed to find the container at all (so it didn't do any fix) because of the same reason.

Reviewers: klimek

Subscribers: cfe-commits, alexfh

Differential Revision: http://reviews.llvm.org/D14289

llvm-svn: 251943
2015-11-03 16:38:31 +00:00
Lang Hames bc78a65adc [Kaleidoscope][Orc] Fix the fully_lazy Orc Kaleidoscope example.
r251933 changed the Orc compile callbacks API, which broke this.

llvm-svn: 251942
2015-11-03 16:35:10 +00:00
David Majnemer 19cd42a558 Remove unused #include
No functionality change is intended.

llvm-svn: 251941
2015-11-03 16:32:15 +00:00
Angel Garcia Gomez 5b5c94ba2c Improve more the const-detection in modernize-loop-convert.
Summary: The previous change was focused in detecting when a non-const object was used in a constant way. Looks like I forgot the most important and trivial case: when the object is already constant. Failing to detect this cases results in compile errors, due to trying to bind a constant object to a non-const reference in the range-for statement. This change should fix that.

Reviewers: klimek

Subscribers: alexfh, cfe-commits

Differential Revision: http://reviews.llvm.org/D14282

llvm-svn: 251940
2015-11-03 16:31:36 +00:00
Rafael Espindola b8c3b1523f Fix thinko.
This would match SHF_ALLOC or SHF_TLS. We want both.

llvm-svn: 251939
2015-11-03 16:30:27 +00:00
Silviu Baranga 308a7c7ed4 Fix PR25372 - teach replaceCongruentPHIs to handle cases where SE evaluates a PHI to a SCEVConstant
Summary:
Since now Scalar Evolution can create non-add rec expressions for PHI
nodes, it can also create SCEVConstant expressions. This will confuse
replaceCongruentPHIs, which previously relied on the fact that SCEV
could not produce constants in this case.

We will now replace the node with a constant in these cases - or avoid
processing the Phi in case of a type mismatch.

Reviewers: sanjoy

Subscribers: llvm-commits, majnemer

Differential Revision: http://reviews.llvm.org/D14230

llvm-svn: 251938
2015-11-03 16:27:04 +00:00
Rafael Espindola 2f344637d6 Revert "[Orc] Directly emit machine code for the x86 resolver block and trampolines."
This reverts commit r251933.

It broke the build of examples/Kaleidoscope/Orc/fully_lazy/toy.cpp.

llvm-svn: 251937
2015-11-03 16:25:20 +00:00
David Blaikie 96a9d8c8e5 Kaleidoscope-ch2: Remove the dependence on LLVM by cloning make_unique into this project
llvm-svn: 251936
2015-11-03 16:23:21 +00:00
Kuba Brecka 77f16f369b [tsan] Allow memchr interceptor to be used before initialization on OS X
On OS X, `memchr` is called on a newly created thread even before `__tsan_thread_start_func` is invoked, which means that the ThreadState object for that thread will not yet be initialized. Let's add `COMMON_INTERCEPTOR_NOTHING_IS_INITIALIZED` into the interceptor to simply call `internal_memchr` in these cases.

Differential Revision: http://reviews.llvm.org/D14283

llvm-svn: 251935
2015-11-03 16:19:37 +00:00
Lang Hames a4a227f7e8 [Orc] Directly emit machine code for the x86 resolver block and trampolines.
Bypassing LLVM for this has a number of benefits:

1) Laziness support becomes asm-syntax agnostic (previously lazy jitting didn't
   work on Windows as the resolver block was in Darwin asm).

2) For cross-process JITs, it allows resolver blocks and trampolines to be
   emitted directly in the target process, reducing cross process traffic.

3) It should be marginally faster.

llvm-svn: 251933
2015-11-03 16:10:18 +00:00
Pavel Labath 862432c90e Fix race during process detach
Summary:
The code which was preventing the usage of the OS plugin while detach is in
progress also prevented us to update the thread list correctly. This resulted
in an empty thread list, which confused the detaching logic. Change the
condition do only do what it says (disable the usage of the OS plugin).

Reviewers: clayborg, jingham

Subscribers: lldb-commits

Differential Revision: http://reviews.llvm.org/D14201

llvm-svn: 251932
2015-11-03 16:05:18 +00:00
Martell Malone 53f8a53fb6 Fix r251928 build error
llvm-svn: 251931
2015-11-03 16:04:28 +00:00
Martell Malone eec224eef7 Remove some legacy mingw-w64 gcc struct info
As of gcc 4.7 mingw-w64 no longer emits 128-bit structs as i128

Differential Revision: http://reviews.llvm.org/D14179

llvm-svn: 251930
2015-11-03 15:57:45 +00:00
Martell Malone 40eb83ba56 Support for 32-bit mingw-w64 in compiler-rt.
Add chkstk/alloca for gcc objects.
Replace or instructions with test, the latter should be marginally more
efficent, as it does not write to memory.

Differential Revision: http://reviews.llvm.org/D14044

Patch by vadimcn

llvm-svn: 251928
2015-11-03 15:46:23 +00:00
Rafael Espindola 9eb3e57042 Simplify and fix style.
llvm-svn: 251927
2015-11-03 15:46:15 +00:00
Teresa Johnson 07b825b01c Move metadata linking after lazy global materialization/linking.
Summary:
Currently, named metadata is linked before the LazilyLinkGlobalValues
list is walked and materialized/linked. As a result, references
from DISubprogram and DIGlobalVariable metadata to yet unmaterialized
functions and variables cause them to be added to the lazy linking
list and their definitions are materialized and linked.

This makes the llvm-link -only-needed option not have the intended
effect when debug information is present, as the otherwise unneeded
functions/variables are still linked in.

Additionally, for ThinLTO I have implemented a mechanism to only link
in debug metadata needed by imported functions. Moving named metadata
linking after lazy GV linking will facilitate applying this mechanism
to the LTO and "llvm-link -only-needed" cases as well.

Reviewers: dexonsmith, tra, dblaikie

Subscribers: llvm-commits

Differential Revision: http://reviews.llvm.org/D14195

llvm-svn: 251926
2015-11-03 15:11:27 +00:00
Teresa Johnson 04e5877430 Pass enum instead of bool to new linkInModule call in llvm-link
A new call I added to linkInModule from llvm-link in r251866
was still passing in a boolean for an argument that was changed to an
enum in r246561. I didn't catch this in my merge since the bool false
matched the flag value it mapped to.

llvm-svn: 251925
2015-11-03 15:10:50 +00:00
Kuba Brecka 127f669913 Fixup for r251923 to fix a warning about an extra semicolon.
llvm-svn: 251924
2015-11-03 14:45:32 +00:00
Kuba Brecka 149012153c Reapply r251916 ("[tsan] Port TSan interceptors on OS X").
llvm-svn: 251923
2015-11-03 14:43:39 +00:00
Kuba Brecka 9d71caa9a4 Revert r251916 ("[tsan] Port TSan interceptors on OS X").
llvm-svn: 251922
2015-11-03 14:42:03 +00:00
Rafael Espindola 9b89608698 Remove a redundant boolean.
llvm-svn: 251921
2015-11-03 14:34:11 +00:00
Kuba Brecka cf41c0c930 Reapply r251918 ("[tsan] Fix build errors for TSan on OS X").
llvm-svn: 251920
2015-11-03 14:33:39 +00:00
Kuba Brecka 646e1bef09 Revert r251918 ("[tsan] Fix build errors for TSan on OS X").
llvm-svn: 251919
2015-11-03 14:30:31 +00:00
Kuba Brecka 350a9aaeda [tsan] Fix build errors for TSan on OS X
This patch moves a few functions from `sanitizer_linux_libcdep.cc` to `sanitizer_posix_libcdep.cc` in order to use them on OS X as well. Plus a few more small build fixes.

This is part of an effort to port TSan to OS X, and it's one the very first steps. Don't expect TSan on OS X to actually work or pass tests at this point.

Differential Revision: http://reviews.llvm.org/D14235

llvm-svn: 251918
2015-11-03 14:26:00 +00:00
Ravitheja Addepally 46bcbaafb5 Changes for Bug 25251
Summary:
The solution to bug 24074,rL249673 needed
to parse the function information from the Dwarf in order
to set the SymbolContext. For that, GetFunction was called
for the parent in GetTypeForDIE, which parses the
ChildParameters and in the flow, GetTypeForDIE was called
for one of the sibling die and so an infinite
loop was triggered by calling GetFunction repeatedly for the
same function.

The changes in this revision modify the GetTypeForDIE to only
resolve the function context in the Type Lookup flow and so
prevent the infinite loop.

A testcase has also been added to check for regression in the
future and a test vector had been added to the testcase of
24074.

Reviewers: jingham, tberghammer, clayborg

Differential Revision: http://reviews.llvm.org/D14202

llvm-svn: 251917
2015-11-03 14:24:24 +00:00
Kuba Brecka 0ca1e2c3f9 [tsan] Port TSan interceptors on OS X
This patch modifies `tsan_interceptors.cc` to be buildable on OS X. Several of the intercepted methods are not available on OS X, so we need to `#if !SANITIZER_MAC` them. Plus a few other fixes, e.g. `pthread_yield` doesn't exist, let's use `internal_sched_yield` instead.

This is part of an effort to port TSan to OS X, and it's one the very first steps. Don't expect TSan on OS X to actually work or pass tests at this point.

Differential Revision: http://reviews.llvm.org/D14237

llvm-svn: 251916
2015-11-03 14:22:51 +00:00
Kuba Brecka c9249498ce [tsan] CMake support for TSan on OS X
Hi, this patch adds a CMake flag called `COMPILER_RT_ENABLE_TSAN_OSX`, which is off by default. If enabled, the build system will be building the OS X version of the TSan runtime library (called `libclang_rt.tsan_osx_dynamic.dylib`). I'll submit patches that fix OS X build errors shortly.

This is part of an effort to port TSan to OS X, and it's one the very first steps. Don't expect TSan on OS X to actually work or pass tests at this point.

llvm-svn: 251915
2015-11-03 14:13:59 +00:00
Rafael Espindola 115f0f365d Two small fixes to copy relocation processing.
* We can determine the alignment requirement.
* We have to update the bss alignment with it.

llvm-svn: 251914
2015-11-03 14:13:40 +00:00
Rafael Espindola 31b71a921a Make the test a bit more strict and fix the math.
llvm-svn: 251913
2015-11-03 14:08:43 +00:00
Rafael Espindola e1bd952ea9 Simplify. NFC.
llvm-svn: 251912
2015-11-03 14:03:11 +00:00
Rafael Espindola f486beab7e Make this input a bit more readable.
llvm-svn: 251911
2015-11-03 13:58:27 +00:00
Filipe Cabecinhas 7aae2f23c8 Don't assert if materializing before seeing any function bodies
This assert was reachable from user input. A minimized test case (no
FUNCTION_BLOCK_ID record) is attached.

Bug found with afl-fuzz

llvm-svn: 251910
2015-11-03 13:48:26 +00:00
Filipe Cabecinhas f3e167af4b Don't use Twine objects after their lifetimes end.
No test, since it would depend on what the compiler can optimize/reuse.
My next commit made this bug visible on Linux Release compiles with some
versions of gcc.

llvm-svn: 251909
2015-11-03 13:48:21 +00:00
Rafael Espindola de212f1589 Delete dead getter.
llvm-svn: 251908
2015-11-03 13:36:38 +00:00
Elena Demikhovsky 2b06b0fe2a LoopVectorizer - skip 'bitcast' between GEP and load.
Skipping 'bitcast' in this case allows to vectorize load:

  %arrayidx = getelementptr inbounds double*, double** %in, i64 %indvars.iv
  %tmp53 = bitcast double** %arrayidx to i64*
  %tmp54 = load i64, i64* %tmp53, align 8

Differential Revision http://reviews.llvm.org/D14112

llvm-svn: 251907
2015-11-03 10:29:34 +00:00
Mohit K. Bhakkad f22bc197e1 [LLDB][MIPS] Fix GetUserRegisterInfoCount to count no of regs which are physically present
Reviewers: clayborg, labath.
Subscribers: jaydeep, bhushan, sagar, nitesh.jain, lldb-commits.
Differential Revision: http://reviews.llvm.org/D13859

llvm-svn: 251906
2015-11-03 09:13:45 +00:00
Mohit K. Bhakkad 13763c3046 [LLDB][Watchpoint] Change ignore_count condition location to fix watchpoint ignore feature for architectures with watchpoint_exceptions_received=before
Reviewers: jingham.
Subscribers: clayborg, jaydeep, bhushan, sagar, nitesh.jain, lldb-commits.
Differential Revision: http://reviews.llvm.org/D13296

llvm-svn: 251905
2015-11-03 09:04:33 +00:00
Michael Kuperstein 73dc85293f [X86] Generate .cfi_adjust_cfa_offset correctly when pushing arguments
When push instructions are being used to pass function arguments on
the stack, and either EH or debugging are enabled, we need to generate
.cfi_adjust_cfa_offset directives appropriately. For (synch) EH, it is
enough for the CFA offset to be correct at every call site, while
for debugging we want to be correct after every push.

Darwin does not support this well, so don't use pushes whenever it
would be required.

Differential Revision: http://reviews.llvm.org/D13767

llvm-svn: 251904
2015-11-03 08:17:25 +00:00
Igor Breger 4ec5abffae AVX512: add encoding tests for vmovq/d instructions.
llvm-svn: 251903
2015-11-03 07:30:17 +00:00
Craig Topper 5ea50fc806 [X86] Rounding mode for roundps/pd/ss/sd builtins should be an ICE.
llvm-svn: 251902
2015-11-03 07:20:07 +00:00
Tobias Grosser 526d52691a Revert "[IndVarSimplify] Rewrite loop exit values with their initial values from loop preheader"
Commit 251839 triggers miscompiles on some bots:

http://lab.llvm.org:8011/builders/perf-x86_64-penryn-O3-polly-fast/builds/13723

(The commit is listed in 13722, but due to an existing failure introduced in
13721 and reverted in 13723 the failure is only visible in 13723)

To verify r251839 is indeed the only change that triggered the buildbot failures
and to ensure the buildbots remain green while investigating I temporarily
revert this commit. At the current state it is unclear if this commit introduced
some miscompile or if it only exposed code to Polly that is subsequently
miscompiled by Polly.

llvm-svn: 251901
2015-11-03 07:14:39 +00:00
Craig Topper 991d499457 Fix a couple intrinsic header comments. NFC
llvm-svn: 251900
2015-11-03 06:16:31 +00:00
Richard Smith 5cd86f8cec [modules] Rationalize the behavior of Decl::declarationReplaces, and in
particular don't assume that two declarations of the same kind in the same
context are declaring the same entity. That's not true when the same name is
declared multiple times as internal-linkage symbols within a module.
(getCanonicalDecl is cheap now, so we can just use it here.)

llvm-svn: 251898
2015-11-03 03:13:11 +00:00
Enrico Granata 7339b9d75f Do not try to copy host memory from address 0
llvm-svn: 251889
2015-11-03 02:34:43 +00:00
Matthias Braun f538e133cc Fix build problme introduced in r251883
llvm-svn: 251888
2015-11-03 02:19:07 +00:00
Jim Ingham 19a63fc6fa Add the ability to pass an EvaluateExpressionOptions when you make a UserExpression. This
isn't used in this commit but will be in a future commit.

llvm-svn: 251887
2015-11-03 02:11:24 +00:00
Zachary Turner 95c453a221 Tighten up sys.path, and use absolute imports everywhere.
For convenience, we had added the folder that dotest.py was in
to sys.path, so that we could easily write things like
`import lldbutil` from anywhere and any test.  This introduces
a subtle problem when using Python's package system, because when
unittest2 imports a particular test suite, the test suite is detached
from the package.  Thus, writing "import lldbutil" from dotest imports
it as part of the package, and writing the same line from a test
does a fresh import since the importing module was not part of
the same package.

The real way to fix this is to use absolute imports everywhere.  Instead
of writing "import lldbutil", we need to write "import
lldbsuite.test.util".  This patch fixes up that and all other similar
cases, and additionally removes the script directory from sys.path
to ensure that this can't happen again.

llvm-svn: 251886
2015-11-03 02:06:18 +00:00