132977 Commits

Author SHA1 Message Date
Lang Hames
f43e7e48eb [Kaleidoscope][BuildingAJIT] Add stub Chapter 5 text.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@271213 91177308-0d34-0410-b5e6-96231b3b80d8
2016-05-30 16:53:19 +00:00
Diana Picus
e7cbdab8a9 [BPF] Remove exit-on-error from tests (PR27768, PR27769)
The exit-on-error flag is necessary to avoid some assertions/unreachables. We
can get past them by creating a few dummy nodes.

Fixes PR27768, PR27769.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@271200 91177308-0d34-0410-b5e6-96231b3b80d8
2016-05-30 08:28:34 +00:00
Sanjoy Das
285ed3c6e4 [IndVars] Assert that the incoming IR is in LCSSA
Since we already assert that the outgoing IR is in LCSSA, it is easy to
get misled into thinking that -indvars broke LCSSA if the incoming IR is
non-LCSSA.  Checking this pre-condition will make such cases break in
more obvious ways.

Inspired by (but does _not_ fix) PR26682.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@271196 91177308-0d34-0410-b5e6-96231b3b80d8
2016-05-30 01:37:39 +00:00
Lang Hames
9aaeb83f58 [Kaleidoscope][BuildingAJIT] Don't build Chapter 5 on Windows for now.
The TCP setup code is currently *nix based and does not build on Windows.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@271194 91177308-0d34-0410-b5e6-96231b3b80d8
2016-05-30 01:18:32 +00:00
Lang Hames
203f697825 [Kaleidoscope][BuildingAJIT] Add code for Chapter 5 - remote JITing.
This chapter demonstrates lazily JITing from ASTs with the expressions being
executed on a remote machine via a TCP connection. It needs some polish, but is
substantially complete.

Currently x86-64 SysV ABI (Darwin and Linux) only, but other architectures
can be supported by changing the server code to use alternative ABI support
classes from llvm/include/llvm/ExecutionEngine/Orc/OrcABISupport.h.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@271193 91177308-0d34-0410-b5e6-96231b3b80d8
2016-05-30 00:09:26 +00:00
Joerg Sonnenberger
d703145852 Make it easier to process merges in a normal buildable directory tree by
allowing the user to specify the base directory of the checkout.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@271192 91177308-0d34-0410-b5e6-96231b3b80d8
2016-05-29 22:09:54 +00:00
Sanjoy Das
8b95cd30c2 [IndVarSimplify] Extract the logic of -indvars out into a class; NFC
This will be used later to port IndVarSimplify to the new pass manager.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@271190 91177308-0d34-0410-b5e6-96231b3b80d8
2016-05-29 21:42:00 +00:00
Lang Hames
b995206114 [Orc] Fix a type in the OrcRemoteClientUtility.
This function failed to type-check as it was. No test case yet (we only have
regression tests for the remote-JIT code, and LLI don't use this function), but
an upcoming chapter of the Kaleidoscope Building A JIT tutorials will use
this.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@271189 91177308-0d34-0410-b5e6-96231b3b80d8
2016-05-29 21:17:13 +00:00
Kostya Serebryany
a736e85343 [libFuzzer] fix a use-after-free (!) in libFuzzer caused by r270905: that CL caused a push_back in the main corpus invalidating the vector<> iterators in rare cases.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@271186 91177308-0d34-0410-b5e6-96231b3b80d8
2016-05-29 15:58:57 +00:00
Benjamin Kramer
ac307e44e3 Remove some 'const' specifiers that do nothing but prevent moving the argument.
Found by clang-tidy's misc-move-const-arg. While there drop some
obsolete c_str() calls.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@271181 91177308-0d34-0410-b5e6-96231b3b80d8
2016-05-29 10:46:35 +00:00
Benjamin Kramer
2ff22b74ed [ProfileData] Clean up string handling a bit.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@271180 91177308-0d34-0410-b5e6-96231b3b80d8
2016-05-29 10:31:00 +00:00
Sanjoy Das
a83f08e633 [SCEV] Remove the singleton apply function (re-apply r271155)
Polly has been updated in r271177 to not use it.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@271178 91177308-0d34-0410-b5e6-96231b3b80d8
2016-05-29 07:53:21 +00:00
Craig Topper
05fc931b14 [X86] Remove some unnecessary declarations for old intrinsics from a test.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@271175 91177308-0d34-0410-b5e6-96231b3b80d8
2016-05-29 06:37:39 +00:00
Craig Topper
fab36bcca4 [X86] Simplify some of the autoupgrade code. NFC
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@271174 91177308-0d34-0410-b5e6-96231b3b80d8
2016-05-29 06:37:33 +00:00
David Majnemer
02cabd40cd Don't dereference a symbol iterator before checking for the end case
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@271173 91177308-0d34-0410-b5e6-96231b3b80d8
2016-05-29 06:18:08 +00:00
David Majnemer
b829a5d681 Make sure we don't add an empty string to the stringmap
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@271172 91177308-0d34-0410-b5e6-96231b3b80d8
2016-05-29 06:18:06 +00:00
David Majnemer
25a1911fd0 [CVRecord] Don't assume that the record has two bytes of data in it
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@271171 91177308-0d34-0410-b5e6-96231b3b80d8
2016-05-29 06:18:04 +00:00
David Majnemer
03506feed0 Don't let the readArray size calculation overflow
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@271170 91177308-0d34-0410-b5e6-96231b3b80d8
2016-05-29 06:18:01 +00:00
Zachary Turner
36c9a0fc68 [pdb] Make an abstract base class for PDBFile.
This will allow us to mock it out in a unit test to begin
writing unit tests for the various PDB and codeview classes.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@271168 91177308-0d34-0410-b5e6-96231b3b80d8
2016-05-29 05:36:01 +00:00
Sanjoy Das
48ef4cdcae Revert "[SCEV] Remove unused function; NFC"
This reverts commit r271155.  The `apply` function is actually used by
Polly.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@271167 91177308-0d34-0410-b5e6-96231b3b80d8
2016-05-29 04:08:50 +00:00
Craig Topper
159551729d [IR] Teach the ArrayRef<int> form of IRBuilder::CreateShuffleVector to use ConstantDataVector.
This will be used in a follow up commit to simplify code in clang that creates a ConstantDataVector and calls the other form.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@271164 91177308-0d34-0410-b5e6-96231b3b80d8
2016-05-29 02:39:20 +00:00
Rafael Espindola
65123b902b Add RelaxELFRelocations to TargetOptions.h.
It will be used in clang.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@271161 91177308-0d34-0410-b5e6-96231b3b80d8
2016-05-29 01:57:20 +00:00
Rafael Espindola
c615a826fd Move RelaxELFRel out to llvm-mc.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@271160 91177308-0d34-0410-b5e6-96231b3b80d8
2016-05-29 01:11:00 +00:00
Davide Italiano
50d2d2143e [PM] Reassociate: cache analyses more aggressively.
While here, add a FIXME for setPreserveCFG().

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@271159 91177308-0d34-0410-b5e6-96231b3b80d8
2016-05-29 00:41:17 +00:00
Sanjoy Das
1c85d76aa3 [SCEV] Remove \brief from comments; NFC
With autobrief, \brief is not required.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@271158 91177308-0d34-0410-b5e6-96231b3b80d8
2016-05-29 00:38:29 +00:00
Sanjoy Das
ab146e08b8 [SCEV] Consolidate comments; NFC
Consolidate documentation by removing comments from the .cpp file where
the comments in the .cpp file were copy-pasted from the header.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@271157 91177308-0d34-0410-b5e6-96231b3b80d8
2016-05-29 00:38:22 +00:00
Sanjoy Das
e2c1e5e43c [SCEV] Rename functions to LLVM style; NFC
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@271156 91177308-0d34-0410-b5e6-96231b3b80d8
2016-05-29 00:38:00 +00:00
Sanjoy Das
9a56c0505b [SCEV] Remove unused function; NFC
Moreover, I've never seen globally scoped `static inline` functions
elsewhere in LLVM, so this pattern is unusual if not unidiomatic.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@271155 91177308-0d34-0410-b5e6-96231b3b80d8
2016-05-29 00:37:45 +00:00
Sanjoy Das
8a2a6b2cef [SCEV] Comment and whitesapce changes in header
- Use doxygen-style comments
 - Don't repeat member names in comments
 - Add newlines between declarations

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@271154 91177308-0d34-0410-b5e6-96231b3b80d8
2016-05-29 00:36:42 +00:00
Sanjoy Das
59287c36a0 [IndVars] Eliminate op.with.overflow when possible (re-apply)
Summary:
If we can prove that an op.with.overflow intrinsic does not overflow, we
can get rid of the intrinsic, and replace it with non-wrapping
arithmetic.

This was first checked in at r265913 but reverted in r265950 because it
exposed some issues around how SCEV handled post-inc add recurrences.
Those issues have now been fixed.

Reviewers: atrick, regehr

Subscribers: sanjoy, mcrosier, llvm-commits

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@271153 91177308-0d34-0410-b5e6-96231b3b80d8
2016-05-29 00:36:25 +00:00
Sanjoy Das
09cfc1ebb1 [SCEV] See through op.with.overflow intrinsics (re-apply)
Summary:
This change teaches SCEV to see reduce `(extractvalue
0 (op.with.overflow X Y))` into `op X Y` (with a no-wrap tag if
possible).

This was first checked in at r265912 but reverted in r265950 because it
exposed some issues around how SCEV handled post-inc add recurrences.
Those issues have now been fixed.

Reviewers: atrick, regehr

Subscribers: mcrosier, mzolotukhin, llvm-commits

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@271152 91177308-0d34-0410-b5e6-96231b3b80d8
2016-05-29 00:34:42 +00:00
Sanjoy Das
11ed8edc19 [SCEV] Don't always add no-wrap flags to post-inc add recs
Fixes PR27315.

The post-inc version of an add recurrence needs to "follow the same
rules" as a normal add or subtract expression.  Otherwise we miscompile
programs like

```
int main() {
  int a = 0;
  unsigned a_u = 0;
  volatile long last_value;
  do {
    a_u += 3;
    last_value = (long) ((int) a_u);
    if (will_add_overflow(a, 3)) {
      // Leave, and don't actually do the increment, so no UB.
      printf("last_value = %ld\n", last_value);
      exit(0);
    }
    a += 3;
  } while (a != 46);
  return 0;
}
```

This patch changes SCEV to put no-wrap flags on post-inc add recurrences
only when the poison from a potential overflow will go ahead to cause
undefined behavior.

To avoid regressing performance too much, I've assumed infinite loops
without side effects is undefined behavior to prove poison<->UB
equivalence in more cases.  This isn't ideal, but is not new to LLVM as
a whole, and far better than the situation I'm trying to fix.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@271151 91177308-0d34-0410-b5e6-96231b3b80d8
2016-05-29 00:32:17 +00:00
Sanjoy Das
2f6c3f7e20 [ValueTracking] ICmp instructions propagate poison
This is a stripped down version of D19211, leaving out the questionable
"branching in poison is UB" bit.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@271150 91177308-0d34-0410-b5e6-96231b3b80d8
2016-05-29 00:31:18 +00:00
Davide Italiano
e557ebe45a [PM] SCCP should preserve GlobalsAA even if the IR is mutated.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@271149 91177308-0d34-0410-b5e6-96231b3b80d8
2016-05-29 00:31:15 +00:00
David Majnemer
52b8c95368 [COFFDumper] Validate that the next offset is not too large
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@271147 91177308-0d34-0410-b5e6-96231b3b80d8
2016-05-28 20:04:50 +00:00
David Majnemer
03348eaac6 [COFFDumper] Make sure there is sufficient padding left in the string table
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@271146 91177308-0d34-0410-b5e6-96231b3b80d8
2016-05-28 20:04:48 +00:00
David Majnemer
efdb5ca295 [SymbolDumper] Validate the string table offset before using it
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@271145 91177308-0d34-0410-b5e6-96231b3b80d8
2016-05-28 20:04:46 +00:00
David Majnemer
f535fa1a36 [COFFDumper] Make sure there is sufficient padding left in the checksum
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@271143 91177308-0d34-0410-b5e6-96231b3b80d8
2016-05-28 19:45:58 +00:00
David Majnemer
6a561385b2 [SymbolDumper] Validate the string table offset before using it
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@271142 91177308-0d34-0410-b5e6-96231b3b80d8
2016-05-28 19:45:56 +00:00
David Majnemer
d5b688a4d0 [CVSymbolVisitor] It's possible for an error to occur in begin()
If the begin iterator fails, we cannot dereference it's contents.
Instead, we must immediately stop processing symbols.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@271141 91177308-0d34-0410-b5e6-96231b3b80d8
2016-05-28 19:45:54 +00:00
David Majnemer
ddd4585661 [Object] Return an error code instead of asserting
This makes it easier to report errors up the stack.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@271140 91177308-0d34-0410-b5e6-96231b3b80d8
2016-05-28 19:45:51 +00:00
David Majnemer
d0404d3057 [llvm-readobj] Validate the string table offset before using it
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@271139 91177308-0d34-0410-b5e6-96231b3b80d8
2016-05-28 19:45:49 +00:00
David Majnemer
baa5e7155c Use consume instead of manually using drop_front
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@271137 91177308-0d34-0410-b5e6-96231b3b80d8
2016-05-28 19:17:48 +00:00
David Majnemer
32f7ec64e7 Update test to deal with non-zero exit codes
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@271135 91177308-0d34-0410-b5e6-96231b3b80d8
2016-05-28 19:02:12 +00:00
David Majnemer
872acbc405 llvm-pdbdump should have a non-zero exit code on error
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@271132 91177308-0d34-0410-b5e6-96231b3b80d8
2016-05-28 18:25:15 +00:00
Simon Pilgrim
687467768e [X86][SSE] (Reapplied) Replace (V)PMOVSX and (V)PMOVZX integer extension intrinsics with generic IR (llvm)
This patch removes the llvm intrinsics VPMOVSX and (V)PMOVZX sign/zero extension intrinsics and auto-upgrades to SEXT/ZEXT calls instead. We already did this for SSE41 PMOVSX sometime ago so much of that implementation can be reused.

Reapplied now that the the companion patch (D20684) removes/auto-upgrade the clang intrinsics has been committed.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@271131 91177308-0d34-0410-b5e6-96231b3b80d8
2016-05-28 18:03:41 +00:00
David Majnemer
667a9bfce4 Tighten some of the name map checks further
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@271130 91177308-0d34-0410-b5e6-96231b3b80d8
2016-05-28 18:03:37 +00:00
Mehdi Amini
d10baa15d2 ValueMapper: fix assertion when null-mapping a constant for linking metadata
Summary:
When RF_NullMapMissingGlobalValues is set, mapValue can return null
for GlobalValue. When mapping the operands of a constant that is
referenced from metadata, we need to handle this case and actually
return null instead of mapping this constant.

Reviewers: dexonsmith, rafael

Subscribers: llvm-commits

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@271129 91177308-0d34-0410-b5e6-96231b3b80d8
2016-05-28 17:26:03 +00:00
Sanjay Patel
021b449e3b [InstCombine] add tests to show bitcast interference
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@271125 91177308-0d34-0410-b5e6-96231b3b80d8
2016-05-28 16:10:37 +00:00
Rafael Espindola
61c74dc4d5 Fix production of R_X86_64_GOTPCRELX/R_X86_64_REX_GOTPCRELX.
We were producing R_X86_64_GOTPCRELX for invalid instructions and
sometimes producing R_X86_64_GOTPCRELX instead of
R_X86_64_REX_GOTPCRELX.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@271118 91177308-0d34-0410-b5e6-96231b3b80d8
2016-05-28 15:51:38 +00:00