Commit Graph

91031 Commits

Author SHA1 Message Date
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
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
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
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
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
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
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
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
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
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
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
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
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
Sanjay Patel
aea5485cfe [x86] avoid printing unnecessary sign bits of hex immediates in asm comments (PR20347)
It would be better to check the valid/expected size of the immediate operand, but this is
generally better than what we print right now.

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



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@271114 91177308-0d34-0410-b5e6-96231b3b80d8
2016-05-28 14:58:37 +00:00
Ahmed Bougacha
fe422064d9 [X86] Try to zero elts when lowering 256-bit shuffle with PSHUFB.
Otherwise we fallback to a blend of PSHUFBs later on.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@271113 91177308-0d34-0410-b5e6-96231b3b80d8
2016-05-28 14:38:04 +00:00
Rafael Espindola
68e92aed2a Simplify and clang-format a table.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@271112 91177308-0d34-0410-b5e6-96231b3b80d8
2016-05-28 11:13:34 +00:00
Rafael Espindola
f57428de58 Fix default reloc model on ARM.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@271111 91177308-0d34-0410-b5e6-96231b3b80d8
2016-05-28 10:41:15 +00:00
Petr Hosek
c6eef17f1f [MC] Return early when .fill size is negative
Rather than invoking emitFill with negative size, which may trigger
an undefined behavior, return immediately after emitting the warning.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@271107 91177308-0d34-0410-b5e6-96231b3b80d8
2016-05-28 08:20:08 +00:00
David Majnemer
c12ac37f8d Bounds check the number of bitmap blocks in the name map
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@271105 91177308-0d34-0410-b5e6-96231b3b80d8
2016-05-28 05:59:25 +00:00
David Majnemer
898ae7b4e8 Make sure the directory contains info for all streams
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@271103 91177308-0d34-0410-b5e6-96231b3b80d8
2016-05-28 05:59:19 +00:00
Petr Hosek
27f2fb013f [MC] Support symbolic expressions in assembly directives
This matches the behavior of GNU assembler which supports symbolic
expressions in absolute expressions used in assembly directives.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@271102 91177308-0d34-0410-b5e6-96231b3b80d8
2016-05-28 05:57:48 +00:00
Zachary Turner
5cfb6469b8 [pdb] Finish conversion to zero copy pdb access.
This converts remaining uses of ByteStream, which was still
left in the symbol stream and type stream, to using the new
StreamInterface zero-copy classes.

RecordIterator is finally deleted, so this is the only way left
now.  Additionally, more error checking is added when iterating
the various streams.

With this, the transition to zero copy pdb access is complete.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@271101 91177308-0d34-0410-b5e6-96231b3b80d8
2016-05-28 05:21:57 +00:00
Renato Golin
b0771c89b2 Revert "Revert "Map DynamicNoPIC to Static on non-darwin.""
This reverts commit r271096, as reverting it broke even more buildbots!

But that also means I'll break on ARM again... :(

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@271099 91177308-0d34-0410-b5e6-96231b3b80d8
2016-05-28 04:47:13 +00:00
Sean Silva
9214c0d716 Add a comment about why we need to buffer the attribute changes.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@271097 91177308-0d34-0410-b5e6-96231b3b80d8
2016-05-28 04:24:39 +00:00
Renato Golin
ff7695ffc7 Revert "Map DynamicNoPIC to Static on non-darwin."
This reverts commit r271052, as it broke some ARM buildbots.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@271096 91177308-0d34-0410-b5e6-96231b3b80d8
2016-05-28 04:24:26 +00:00
Kostya Serebryany
8c598528c3 [libFuzzer] fix a failure that occurs when running individual inputs
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@271095 91177308-0d34-0410-b5e6-96231b3b80d8
2016-05-28 04:19:46 +00:00
Sean Silva
28cd01c46e Small cleanup.
Centralize assertion.
Clean up max loop.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@271094 91177308-0d34-0410-b5e6-96231b3b80d8
2016-05-28 04:19:45 +00:00
Sean Silva
74391ad33a Inline this into its only use. NFC.
The name was out of date at this point and it seems simple enough to
have in-line.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@271093 91177308-0d34-0410-b5e6-96231b3b80d8
2016-05-28 04:19:40 +00:00
Sean Silva
21bbb92ca3 Bring back r271090 in a way that doesn't depend on r271089.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@271092 91177308-0d34-0410-b5e6-96231b3b80d8
2016-05-28 04:05:36 +00:00
Sean Silva
c44d843ff4 Revert r271089 and r271090.
It was triggering an msan bot.

Revert "[IRPGO] Set the function entry count metadata."

This reverts commit r271090.

Revert "[IRPGO] Centralize the function attribute inliner hint logic. NFC."

This reverts commit r271089.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@271091 91177308-0d34-0410-b5e6-96231b3b80d8
2016-05-28 03:56:25 +00:00
Sean Silva
ef7704b344 [IRPGO] Set the function entry count metadata.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@271090 91177308-0d34-0410-b5e6-96231b3b80d8
2016-05-28 03:02:54 +00:00
Sean Silva
2abc50b71c [IRPGO] Centralize the function attribute inliner hint logic. NFC.
This keeps the logic in the same function.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@271089 91177308-0d34-0410-b5e6-96231b3b80d8
2016-05-28 03:02:50 +00:00
Krzysztof Parzyszek
537cc1b99b [Hexagon] Add option to enable subregister liveness tracking
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@271088 91177308-0d34-0410-b5e6-96231b3b80d8
2016-05-28 02:02:51 +00:00
Krzysztof Parzyszek
d074accb5e [Hexagon] Separate C8 and USR to avoid unwanted subregister composition
Composing subreg_loreg with subreg_oveflow leads to strange results with
lane masks for register classes with subreg_loreg. In particular, dead
lane detection generates incorrect code.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@271087 91177308-0d34-0410-b5e6-96231b3b80d8
2016-05-28 01:51:16 +00:00
Michael Zolotukhin
a8ae925774 [LoopUnrollAnalyzer] Add a comment to visitCastInst.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@271086 91177308-0d34-0410-b5e6-96231b3b80d8
2016-05-28 01:40:14 +00:00
Matthias Braun
8bcf561616 AArch64: Fix indentation
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@271084 91177308-0d34-0410-b5e6-96231b3b80d8
2016-05-28 01:06:51 +00:00
Matt Arsenault
0c56b68bee AMDGPU: Fix trailing whitespace
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@271081 91177308-0d34-0410-b5e6-96231b3b80d8
2016-05-28 00:50:51 +00:00