OSDN Git Service

android-x86/external-llvm.git
6 years agoAttempt to fix some MSVC build errors.
Erik Pilkington [Mon, 13 Aug 2018 17:39:19 +0000 (17:39 +0000)]
Attempt to fix some MSVC build errors.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@339587 91177308-0d34-0410-b5e6-96231b3b80d8

6 years ago[ADT] Implemented unittests for ImmutableList
Kristof Umann [Mon, 13 Aug 2018 17:32:48 +0000 (17:32 +0000)]
[ADT] Implemented unittests for ImmutableList

Also fixed a typo that wasn't discovered as `create` was never instantiated.

Differential Revision: https://reviews.llvm.org/D50646

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@339586 91177308-0d34-0410-b5e6-96231b3b80d8

6 years ago[InstCombine] Limit simplifyAllocaArraySize constant folding to values that fit into...
Simon Pilgrim [Mon, 13 Aug 2018 16:50:20 +0000 (16:50 +0000)]
[InstCombine] Limit simplifyAllocaArraySize constant folding to values that fit into a uint64_t

Fixes OSS-Fuzz: https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=5223

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@339584 91177308-0d34-0410-b5e6-96231b3b80d8

6 years ago[itanium demangler] Add llvm::itaniumFindTypesInMangledName()
Erik Pilkington [Mon, 13 Aug 2018 16:37:47 +0000 (16:37 +0000)]
[itanium demangler] Add llvm::itaniumFindTypesInMangledName()

This function calls a callback whenever a <type> is parsed.

This is necessary to implement FindAlternateFunctionManglings in LLDB, which
uses a similar hack in FastDemangle. Once that function has been updated to use
this version, FastDemangle can finally be removed.

Differential revision: https://reviews.llvm.org/D50586

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@339580 91177308-0d34-0410-b5e6-96231b3b80d8

6 years ago[InstCombine] auto-generate full checks and add cos intrinsic test; NFC
Sanjay Patel [Mon, 13 Aug 2018 16:29:01 +0000 (16:29 +0000)]
[InstCombine] auto-generate full checks and add cos intrinsic test; NFC

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@339579 91177308-0d34-0410-b5e6-96231b3b80d8

6 years ago[SLC] Expand simplification of pow() for vector types
Evandro Menezes [Mon, 13 Aug 2018 16:12:37 +0000 (16:12 +0000)]
[SLC] Expand simplification of pow() for vector types

Also consider vector constants when simplifying `pow()`.

Differential revision: https://reviews.llvm.org/D50035

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@339578 91177308-0d34-0410-b5e6-96231b3b80d8

6 years ago[Tablegen] Replace uses of formatted_raw_ostream with raw_ostream in the predicate...
Andrea Di Biagio [Mon, 13 Aug 2018 15:13:35 +0000 (15:13 +0000)]
[Tablegen] Replace uses of formatted_raw_ostream with raw_ostream in the predicate expander. NFCI

This is a follow-up of r339552.

As pointed out by Craig in D50566, we don't need a formatted_raw_ostream to
indent strings. We can use instead raw_ostream::indent().

Internally, class PredicateExpander already keeps track of the current
indentation level. Also, the grammar for predicates is well parenthesized, and
therefore we don't need to use a formatted_raw_ostream to continuously track the
column number. Instead we can safely replace all the uses of
formatted_raw_ostream::PadToColumn() with uses of raw_ostream::indent().

By replacing formatted_raw_ostream with a simpler raw_ostream, we also avoid the
implicit check on the newline character on every print to stream.

No functional change intended.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@339577 91177308-0d34-0410-b5e6-96231b3b80d8

6 years ago[Hexagon] Silence -Wuninitialized warning from GCC 5.4, NFC
Krzysztof Parzyszek [Mon, 13 Aug 2018 15:08:25 +0000 (15:08 +0000)]
[Hexagon] Silence -Wuninitialized warning from GCC 5.4, NFC

Patch by Kim Gräsman.

Differential Revision: https://reviews.llvm.org/D50623

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@339576 91177308-0d34-0410-b5e6-96231b3b80d8

6 years agoRevert "[Sparc] Add support for the cycle counter available in GR740"
Daniel Cederman [Mon, 13 Aug 2018 14:18:09 +0000 (14:18 +0000)]
Revert "[Sparc] Add support for the cycle counter available in GR740"

It breaks when using EXPENSIVE_CHECKS with the error message
"Bad machine code: Using an undefined physical register".

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@339570 91177308-0d34-0410-b5e6-96231b3b80d8

6 years agoCheck for tied operands
Sid Manning [Mon, 13 Aug 2018 14:01:25 +0000 (14:01 +0000)]
Check for tied operands

Differential Revision: https://reviews.llvm.org/D50592

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@339567 91177308-0d34-0410-b5e6-96231b3b80d8

6 years ago[SystemZ] Increase the amount of inlining.
Jonas Paulsson [Mon, 13 Aug 2018 13:31:30 +0000 (13:31 +0000)]
[SystemZ]  Increase the amount of inlining.

Implement getInliningThresholdMultiplier() and have it return 3.

Review: Ulrich Weigand

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@339563 91177308-0d34-0410-b5e6-96231b3b80d8

6 years ago[X86] Add tests showing missing div/rem 0, X -> 0 combines
Simon Pilgrim [Mon, 13 Aug 2018 13:29:54 +0000 (13:29 +0000)]
[X86] Add tests showing missing div/rem 0, X -> 0 combines

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@339562 91177308-0d34-0410-b5e6-96231b3b80d8

6 years ago[DAGCombiner] simplifyDivRem - add comment describing divide by undef/zero combine...
Simon Pilgrim [Mon, 13 Aug 2018 13:12:25 +0000 (13:12 +0000)]
[DAGCombiner] simplifyDivRem - add comment describing divide by undef/zero combine. NFC.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@339561 91177308-0d34-0410-b5e6-96231b3b80d8

6 years ago[CGP] Fix GEP issue with out of range APInt constant values not fitting in int64_t
Simon Pilgrim [Mon, 13 Aug 2018 12:10:09 +0000 (12:10 +0000)]
[CGP] Fix GEP issue with out of range APInt constant values not fitting in int64_t

Test case reduced from https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=7173

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@339556 91177308-0d34-0410-b5e6-96231b3b80d8

6 years ago[Tablegen][SubtargetEmitter] Improve expansion of predicates of a variant scheduling...
Andrea Di Biagio [Mon, 13 Aug 2018 11:09:04 +0000 (11:09 +0000)]
[Tablegen][SubtargetEmitter] Improve expansion of predicates of a variant scheduling class.

This patch refactors the logic that expands predicates of a variant scheduling
class.

The idea is to improve the readability of the auto-generated code by removing
redundant parentheses around predicate expressions, and by removing redundant
if(true) statements.

This patch replaces the definition of NoSchedPred in TargetSchedule.td with an
instance of MCSchedPredicate. The new definition is sematically equivalent to
the previous one. The main difference is that now SubtargetEmitter knows that it
represents predicate "true".

Before this patch, we always generated an if (true) for the default transition
of a variant scheduling class.

Example (taken from AArch64GenSubtargetInfo.inc) :

```
if (SchedModel->getProcessorID() == 3) { // CycloneModel
  if ((TII->isScaledAddr(*MI)))
    return 927; // (WriteIS_WriteLD)_ReadBaseRS
  if ((true))
    return 928; // WriteLD_ReadDefault
}
```

Extra parentheses were also generated around the predicate expressions.

With this patch, we get the following auto-generated checks:

```
if (SchedModel->getProcessorID() == 3) { // CycloneModel
  if (TII->isScaledAddr(*MI))
    return 927; // (WriteIS_WriteLD)_ReadBaseRS
  return 928; // WriteLD_ReadDefault
}
```

The new auto-generated code behaves exactly the same as before. So, technically
this is a non functional change.

Differential revision: https://reviews.llvm.org/D50566

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@339552 91177308-0d34-0410-b5e6-96231b3b80d8

6 years ago[Sparc] Add support for the cycle counter available in GR740
Daniel Cederman [Mon, 13 Aug 2018 10:49:48 +0000 (10:49 +0000)]
[Sparc] Add support for the cycle counter available in GR740

Summary: The GR740 provides an up cycle counter in the
registers ASR22 and ASR23. As these registers can not be
read together atomically we only use the value of ASR23
for llvm.readcyclecounter(). The ASR23 register holds the
32 LSBs of the up-counter.

Reviewers: jyknight, venkatra

Reviewed By: jyknight

Subscribers: fedor.sergeev, jrtc27, llvm-commits

Differential Revision: https://reviews.llvm.org/D48638

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@339551 91177308-0d34-0410-b5e6-96231b3b80d8

6 years agoRemove extra semicolon (fixes -Wpedantic warning). NFCI.
Simon Pilgrim [Mon, 13 Aug 2018 10:05:34 +0000 (10:05 +0000)]
Remove extra semicolon (fixes -Wpedantic warning). NFCI.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@339549 91177308-0d34-0410-b5e6-96231b3b80d8

6 years ago[ARM] Added FP16 VREV Vector Instrinsic CodeGen support
Luke Geeson [Mon, 13 Aug 2018 08:37:41 +0000 (08:37 +0000)]
[ARM] Added FP16 VREV Vector Instrinsic CodeGen support

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@339546 91177308-0d34-0410-b5e6-96231b3b80d8

6 years ago[GuardWidening] Widen very likely non-taken br instructions
Max Kazantsev [Mon, 13 Aug 2018 07:58:19 +0000 (07:58 +0000)]
[GuardWidening] Widen very likely non-taken br instructions

This is a second part of D49974 that handles widening of conditional branches that
have very likely `false` branch.

Differential Revision: https://reviews.llvm.org/D50040
Reviewed By: reames

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@339537 91177308-0d34-0410-b5e6-96231b3b80d8

6 years ago[SelectionDAG] In PromoteFloatOp_BITCAST, insert a bitcast after the fp_to_fp16 in...
Craig Topper [Mon, 13 Aug 2018 06:53:49 +0000 (06:53 +0000)]
[SelectionDAG] In PromoteFloatOp_BITCAST, insert a bitcast after the fp_to_fp16 in case the result type isn't a scalar integer.

This is another variation of PR38533. In this case, the result type of the bitcast is legal and 16-bits wide, but not a scalar integer. So we need to emit the convert to i16 and then bitcast it to the true result type. This new bitcast will be further type legalized if necessary.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@339536 91177308-0d34-0410-b5e6-96231b3b80d8

6 years ago[SelectionDAG] In PromoteIntRes_BITCAST, when the input is TypePromoteFloat, make...
Craig Topper [Mon, 13 Aug 2018 06:53:47 +0000 (06:53 +0000)]
[SelectionDAG] In PromoteIntRes_BITCAST, when the input is TypePromoteFloat, make sure the output type is scalar. For vectors, use a store and load of temporary.

Previously if the result type was a vector, we emitted a FP_TO_FP16 with a vector result type which isn't valid.

This is basically the opposite case of the root cause of PR38533.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@339535 91177308-0d34-0410-b5e6-96231b3b80d8

6 years agoRestore correct x86_64 EH encodings in kernel code model
Lei Liu [Mon, 13 Aug 2018 06:06:53 +0000 (06:06 +0000)]
Restore correct x86_64 EH encodings in kernel code model

Fixes PR37524.

The exception handling encodings for x86_64 in kernel code model
has been changed with r309884.  Restore it to correct ones.  These
encodings include PersonalityEncoding, LSDAEncoding and
TTypeEncoding.

Differential Revision: https://reviews.llvm.org/D50490

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@339534 91177308-0d34-0410-b5e6-96231b3b80d8

6 years ago[SelectionDAG] In PromoteFloatRes_BITCAST, insert a bitcast before the fp16_to_fp...
Craig Topper [Mon, 13 Aug 2018 05:26:49 +0000 (05:26 +0000)]
[SelectionDAG] In PromoteFloatRes_BITCAST, insert a bitcast before the fp16_to_fp in case the input type isn't an i16.

The bitcast can be further legalized as needed.

Fixes PR38533.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@339533 91177308-0d34-0410-b5e6-96231b3b80d8

6 years ago[InstCombine] Fix typo in comment. NFC
Craig Topper [Mon, 13 Aug 2018 00:54:23 +0000 (00:54 +0000)]
[InstCombine] Fix typo in comment. NFC

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@339532 91177308-0d34-0410-b5e6-96231b3b80d8

6 years ago[InstCombine] Replace call to haveNoCommonBitsSet in visitXor with just the special...
Craig Topper [Mon, 13 Aug 2018 00:38:27 +0000 (00:38 +0000)]
[InstCombine] Replace call to haveNoCommonBitsSet in visitXor with just the special case that doesn't use computeKnownBits.

Summary: computeKnownBits is expensive. The cases that would be detected by the computeKnownBits portion of haveNoCommonBitsSet were already handled by the earlier call to SimplifyDemandedInstructionBits.

Reviewers: spatel, lebedev.ri

Reviewed By: lebedev.ri

Subscribers: llvm-commits

Differential Revision: https://reviews.llvm.org/D50604

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@339531 91177308-0d34-0410-b5e6-96231b3b80d8

6 years ago[X86] Add constant folding for AVX512 versions of scalar floating point to integer...
Craig Topper [Sun, 12 Aug 2018 22:09:54 +0000 (22:09 +0000)]
[X86] Add constant folding for AVX512 versions of scalar floating point to integer conversion intrinsics.

Summary:
We've supported constant folding for sse versions for many years. This patch adds support for the avx512 versions including unsigned with the default rounding mode. We could probably do more with other roundings modes and SAE in the future.

The test cases are largely based on the sse.ll test cases. But I did add some test cases to ensure the unsigned versions don't accept negative values. Also checked the bounds of f64->i32 conversions to make sure unsigned has a larger positive range than signed.

Reviewers: RKSimon, spatel, chandlerc

Reviewed By: RKSimon

Subscribers: llvm-commits

Differential Revision: https://reviews.llvm.org/D50553

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@339529 91177308-0d34-0410-b5e6-96231b3b80d8

6 years ago[globalisel] Remove dead code from GlobalISelEmitter
Daniel Sanders [Sun, 12 Aug 2018 21:49:42 +0000 (21:49 +0000)]
[globalisel] Remove dead code from GlobalISelEmitter

Summary: Found by GCC's -Wunused-function.

Patch by Kim Gräsman

Reviewers: ab, dsanders, llvm-commits

Reviewed By: dsanders

Subscribers: rovka, kristof.beyls

Differential Revision: https://reviews.llvm.org/D50611

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@339528 91177308-0d34-0410-b5e6-96231b3b80d8

6 years agoAMDGPU: Cleanup min/max legacy tests
Matt Arsenault [Sun, 12 Aug 2018 19:29:53 +0000 (19:29 +0000)]
AMDGPU: Cleanup min/max legacy tests

Also add some more tests in preparation for
a future patch.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@339526 91177308-0d34-0410-b5e6-96231b3b80d8

6 years agoDAG: Check no-signed-zeros instead of unsafe-fp-math
Matt Arsenault [Sun, 12 Aug 2018 19:09:12 +0000 (19:09 +0000)]
DAG: Check no-signed-zeros instead of unsafe-fp-math

Addresses fixme, although this should still be checking individual
operand flags.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@339525 91177308-0d34-0410-b5e6-96231b3b80d8

6 years ago[NFC] Fixed build, updated tests
David Bolvansky [Sun, 12 Aug 2018 18:32:53 +0000 (18:32 +0000)]
[NFC] Fixed build, updated tests

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@339524 91177308-0d34-0410-b5e6-96231b3b80d8

6 years ago[NFC] Renamed test file
David Bolvansky [Sun, 12 Aug 2018 17:43:27 +0000 (17:43 +0000)]
[NFC] Renamed test file

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@339523 91177308-0d34-0410-b5e6-96231b3b80d8

6 years ago[Support][JSON][NFC] Silence GCC warning about broken strict aliasing rules
David Bolvansky [Sun, 12 Aug 2018 17:31:46 +0000 (17:31 +0000)]
[Support][JSON][NFC] Silence GCC warning about broken strict aliasing rules

Summary:
The as<T>() method would trigger the following warning on GCC <7:

   warning: dereferencing type-punned pointer will break
       strict-aliasing rules [-Wstrict-aliasing]

     return *reinterpret_cast<T *>(Union.buffer);
                                               ^

Union.buffer is guaranteed to be aligned to whatever types it contains,
and json::Value maintains the invariant that it only calls as<T>() for a
T it has previously placement-newed into Union.buffer. This should
follow the rules for strict aliasing.

Using two static_cast via void * instead of reinterpret_cast
silences the warning and presumably makes GCC understand that no
strict-aliasing violation is happening.

No functional change intended.

Patch by: kimgr (Kim Gräsman)

Reviewers: sammccall, xiangzhai, HaoLiu, llvm-commits, xbolva00

Reviewed By: sammccall, xbolva00

Subscribers: xbolva00

Differential Revision: https://reviews.llvm.org/D50608

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@339521 91177308-0d34-0410-b5e6-96231b3b80d8

6 years ago[InstCombine] Fold Select with binary op - non-commutative opcodes
David Bolvansky [Sun, 12 Aug 2018 17:30:07 +0000 (17:30 +0000)]
[InstCombine] Fold Select with binary op - non-commutative opcodes

Summary:
Basic version was merged - https://reviews.llvm.org/D49954

This adds support for FP & non-commutative opcodes

Precommited tests: https://reviews.llvm.org/rL338727

Reviewers: spatel, lebedev.ri

Reviewed By: spatel

Subscribers: jfb

Differential Revision: https://reviews.llvm.org/D50190

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@339520 91177308-0d34-0410-b5e6-96231b3b80d8

6 years ago[InstCombine] fix/enhance fadd/fsub factorization
Sanjay Patel [Sun, 12 Aug 2018 15:48:26 +0000 (15:48 +0000)]
[InstCombine] fix/enhance fadd/fsub factorization
  (X * Z) + (Y * Z) --> (X + Y) * Z
  (X * Z) - (Y * Z) --> (X - Y) * Z
  (X / Z) + (Y / Z) --> (X + Y) / Z
  (X / Z) - (Y / Z) --> (X - Y) / Z

The existing code that implemented these folds failed to
optimize vectors, and it transformed code with multiple
uses when it should not have.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@339519 91177308-0d34-0410-b5e6-96231b3b80d8

6 years ago[InstCombine] move/add tests for fadd/fsub factorization; NFC
Sanjay Patel [Sun, 12 Aug 2018 15:06:15 +0000 (15:06 +0000)]
[InstCombine] move/add tests for fadd/fsub factorization; NFC

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@339518 91177308-0d34-0410-b5e6-96231b3b80d8

6 years ago[InstSimplify] Guard against large shift amounts.
Benjamin Kramer [Sun, 12 Aug 2018 11:43:03 +0000 (11:43 +0000)]
[InstSimplify] Guard against large shift amounts.

These are always UB, but can happen for large integer inputs. Testing it
is very fragile as -simplifycfg will nuke the UB top-down.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@339515 91177308-0d34-0410-b5e6-96231b3b80d8

6 years agoAMDGPU: Check NSZ MI flag when folding omod
Matt Arsenault [Sun, 12 Aug 2018 08:44:25 +0000 (08:44 +0000)]
AMDGPU: Check NSZ MI flag when folding omod

I'm not sure the exact nsz flag combination that
is OK. I think as long as it's on either, this is OK.
For now just check it on the omod multiply.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@339513 91177308-0d34-0410-b5e6-96231b3b80d8

6 years agoAMDGPU: Use splat vectors for undefs when folding canonicalize
Matt Arsenault [Sun, 12 Aug 2018 08:42:54 +0000 (08:42 +0000)]
AMDGPU: Use splat vectors for undefs when folding canonicalize

If one of the elements is undef, use the canonicalized constant
from the other element instead of 0.

Splat vectors are more useful for other optimizations, such
as matching vector clamps. This was breaking on clamps
of half3 from the undef 4th component.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@339512 91177308-0d34-0410-b5e6-96231b3b80d8

6 years agoAMDGPU: Fix packing undef parts of build_vector
Matt Arsenault [Sun, 12 Aug 2018 08:42:46 +0000 (08:42 +0000)]
AMDGPU: Fix packing undef parts of build_vector

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@339511 91177308-0d34-0410-b5e6-96231b3b80d8

6 years ago[TargetLowering] Simplify one of the special cases in SimplifyDemandedBits for XOR...
Craig Topper [Sun, 12 Aug 2018 06:52:03 +0000 (06:52 +0000)]
[TargetLowering] Simplify one of the special cases in SimplifyDemandedBits for XOR. NFCI

We were checking for all bits being Known by checking Known.Zero|Known.One, but if all the bits are known then the value should be a Constant and we can just check for that instead.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@339509 91177308-0d34-0410-b5e6-96231b3b80d8

6 years ago[TargetLowering] Use APInt::isSubsetOf to simplify some code. NFC
Craig Topper [Sun, 12 Aug 2018 05:34:15 +0000 (05:34 +0000)]
[TargetLowering] Use APInt::isSubsetOf to simplify some code. NFC

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@339508 91177308-0d34-0410-b5e6-96231b3b80d8

6 years ago[X86] Remove unnecessary AddedComplexity line. NFC
Craig Topper [Sun, 12 Aug 2018 03:22:18 +0000 (03:22 +0000)]
[X86] Remove unnecessary AddedComplexity line. NFC

The use of the or_is_add predicate already gives enough of a complexity boost to get the patterns ordered properly.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@339507 91177308-0d34-0410-b5e6-96231b3b80d8

6 years ago[Dominators] Remove the DeferredDominance class
Chijun Sima [Sat, 11 Aug 2018 08:12:07 +0000 (08:12 +0000)]
[Dominators] Remove the DeferredDominance class

Summary: After converting all existing passes to use the new DomTreeUpdater interface, there isn't any usage of the original DeferredDominance class. Thus, we can safely remove it from the codebase.

Reviewers: kuhar, brzycki, dmgreen, davide, grosser

Reviewed By: kuhar, brzycki

Subscribers: mgorny, llvm-commits

Differential Revision: https://reviews.llvm.org/D49747

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@339502 91177308-0d34-0410-b5e6-96231b3b80d8

6 years ago[UnJ] Improve explicit loop count checks
David Green [Sat, 11 Aug 2018 07:37:31 +0000 (07:37 +0000)]
[UnJ] Improve explicit loop count checks

Try to improve the computed counts when it has been explicitly set by a pragma
or command line option. This moves the code around, so that first call to
computeUnrollCount to get a sensible count and override that if explicit unroll
and jam counts are specified.

Also added some extra debug messages for when unroll and jamming is disabled.

Differential Revision: https://reviews.llvm.org/D50075

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@339501 91177308-0d34-0410-b5e6-96231b3b80d8

6 years ago[UnJ] Create a hasInvariantIterationCount function. NFC
David Green [Sat, 11 Aug 2018 06:57:28 +0000 (06:57 +0000)]
[UnJ] Create a hasInvariantIterationCount function. NFC

Pulled out a separate function for some code that calculates
if an inner loop iteration count is invariant to it's outer
loop.

Differential Revision: https://reviews.llvm.org/D50063

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@339500 91177308-0d34-0410-b5e6-96231b3b80d8

6 years ago[X86] Remove the AL/AX/EAX/RAX short immediate forms from the macro fusion shouldSche...
Craig Topper [Sat, 11 Aug 2018 06:42:51 +0000 (06:42 +0000)]
[X86] Remove the AL/AX/EAX/RAX short immediate forms from the macro fusion shouldScheduleAdjacent. NFC

These instructions are only created by the backend during MCInst lowering.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@339499 91177308-0d34-0410-b5e6-96231b3b80d8

6 years ago[X86] Add the mem-reg form of CMP to the macro fusion shouldScheduleAdjacent.
Craig Topper [Sat, 11 Aug 2018 06:42:50 +0000 (06:42 +0000)]
[X86] Add the mem-reg form of CMP to the macro fusion shouldScheduleAdjacent.

Unlike the other arithmetic instructions the mem-reg form of compare is just a load and not a RMW operation. According to the Intel optimization manual, this form is also supported by macro fusion.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@339498 91177308-0d34-0410-b5e6-96231b3b80d8

6 years ago[X86] Remove ADD8mi and ADDmr from the macro fusion shouldScheduleAdjacent.
Craig Topper [Sat, 11 Aug 2018 06:42:49 +0000 (06:42 +0000)]
[X86] Remove ADD8mi and ADDmr from the macro fusion shouldScheduleAdjacent.

The are RMW of memory operations. They aren't eligible for macro fusion.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@339497 91177308-0d34-0410-b5e6-96231b3b80d8

6 years ago[X86] Change the MOV32ri64 pseudo instruction to def a GR64 directly instead of wrapp...
Craig Topper [Sat, 11 Aug 2018 05:33:00 +0000 (05:33 +0000)]
[X86] Change the MOV32ri64 pseudo instruction to def a GR64 directly instead of wrapping it in a SUBREG_TO_REG.

Now we switch to the subregister in expandPostRAPseudos where we already switched the opcode.

This simplifies a few isel patterns that used the pseudo directly. And magically seems to have improved our ability to CSE it in the undef-label.ll test.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@339496 91177308-0d34-0410-b5e6-96231b3b80d8

6 years agoFix WebAssembly instruction printer after r339474
Richard Trieu [Sat, 11 Aug 2018 04:18:05 +0000 (04:18 +0000)]
Fix WebAssembly instruction printer after r339474

Treat the stack variants of control instructions the same as regular
instructions.  Otherwise, the vector ControlFlowStack will be the wrong
size and have out-of-bounds access.  This was detected by MemorySanitizer.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@339495 91177308-0d34-0410-b5e6-96231b3b80d8

6 years ago[gold] Fix Tests cases on i686
Tom Stellard [Sat, 11 Aug 2018 01:08:34 +0000 (01:08 +0000)]
[gold] Fix Tests cases on i686

Reviewers: tejohnson

Reviewed By: tejohnson

Subscribers: llvm-commits

Differential Revision: https://reviews.llvm.org/D50583

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@339492 91177308-0d34-0410-b5e6-96231b3b80d8

6 years agoAMDGPU/GlobalISel: Define instruction mapping for G_INSERT
Tom Stellard [Sat, 11 Aug 2018 00:51:54 +0000 (00:51 +0000)]
AMDGPU/GlobalISel: Define instruction mapping for G_INSERT

Reviewers: arsenm

Reviewed By: arsenm

Subscribers: kzhuravl, wdng, nhaehnle, yaxunl, rovka, kristof.beyls, dstuttard, tpr, t-tye, llvm-commits

Differential Revision: https://reviews.llvm.org/D49625

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@339491 91177308-0d34-0410-b5e6-96231b3b80d8

6 years agoRe-commit "[NFC] More ConstantMerge refactoring"
JF Bastien [Fri, 10 Aug 2018 22:41:09 +0000 (22:41 +0000)]
Re-commit "[NFC] More ConstantMerge refactoring"

My previous change moved some code upwards which caused an assert in debug mode
because the global value didn't necessarily have an initializer. Don't do that.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@339485 91177308-0d34-0410-b5e6-96231b3b80d8

6 years ago[LICM] Hoist assumes out of loops
Philip Reames [Fri, 10 Aug 2018 22:21:56 +0000 (22:21 +0000)]
[LICM] Hoist assumes out of loops

If we have an assume which is known to execute and whose operand is invariant, we can lift that into the pre-header. So long as we don't change which paths the assume executes on, this is a legal transformation. It's likely to be a useful canonicalization as other transforms only look for dominating assumes.

Differential Revision: https://reviews.llvm.org/D50364

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@339481 91177308-0d34-0410-b5e6-96231b3b80d8

6 years agoRevert "[NFC] More ConstantMerge refactoring"
JF Bastien [Fri, 10 Aug 2018 22:10:20 +0000 (22:10 +0000)]
Revert "[NFC] More ConstantMerge refactoring"

Sanitizers seem unhappy.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@339480 91177308-0d34-0410-b5e6-96231b3b80d8

6 years agoFix unused lambda capture warning from r339472.
Eli Friedman [Fri, 10 Aug 2018 22:03:25 +0000 (22:03 +0000)]
Fix unused lambda capture warning from r339472.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@339479 91177308-0d34-0410-b5e6-96231b3b80d8

6 years ago[NFC] More ConstantMerge refactoring
JF Bastien [Fri, 10 Aug 2018 21:58:00 +0000 (21:58 +0000)]
[NFC] More ConstantMerge refactoring

This makes my upcoming patch much easier to read.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@339478 91177308-0d34-0410-b5e6-96231b3b80d8

6 years ago[WebAssembly] Added default stack-only instruction mode for MC.
Wouter van Oortmerssen [Fri, 10 Aug 2018 21:32:47 +0000 (21:32 +0000)]
[WebAssembly] Added default stack-only instruction mode for MC.

Summary:
Moved Explicit Locals pass to last.
Made that pass obligatory.
Made it convert from register to stack based instructions, and removed the registers.
Fixes to related code that was expecting register based instructions.
Added the correct testing flag to all tests, depending on what the
format they were expecting so far.
Translated one test to stack format as example: reg-stackify-stack.ll

tested:
llvm-lit -v `find test -name WebAssembly`
unittests/MC/*

Reviewers: dschuff, sunfish

Subscribers: jfb, llvm-commits, aheejin, eraman, jgravelle-google, sbc100

Differential Revision: https://reviews.llvm.org/D50568

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@339474 91177308-0d34-0410-b5e6-96231b3b80d8

6 years ago[ARM] Adjust AND immediates to make them cheaper to select.
Eli Friedman [Fri, 10 Aug 2018 21:21:53 +0000 (21:21 +0000)]
[ARM] Adjust AND immediates to make them cheaper to select.

LLVM normally prefers to minimize the number of bits set in an AND
immediate, but that doesn't always match the available ARM instructions.
In Thumb1 mode, prefer uxtb or uxth where possible; otherwise, prefer
a two-instruction sequence movs+ands or movs+bics.

Some potential improvements outlined in
ARMTargetLowering::targetShrinkDemandedConstant, but seems to work
pretty well already.

The ARMISelDAGToDAG fix ensures we don't generate an invalid UBFX
instruction due to a larger-than-expected mask. (It's orthogonal, in
some sense, but as far as I can tell it's either impossible or nearly
impossible to reproduce the bug without this change.)

According to my testing, this seems to consistently improve codesize by
a small amount by forming bic more often for ISD::AND with an immediate.

Differential Revision: https://reviews.llvm.org/D50030

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@339472 91177308-0d34-0410-b5e6-96231b3b80d8

6 years ago[MS Demangler] Support extern "C" functions.
Zachary Turner [Fri, 10 Aug 2018 21:09:05 +0000 (21:09 +0000)]
[MS Demangler] Support extern "C" functions.

There are two cases we need to support with extern "C"
functions.  The first is the case of a '9' indicating that
the function has no prototype.  This occurs when we mangle
a symbol inside of an extern "C" function, but not the
function itself.

The second case is when we have an overloaded extern "C"
functions.  In this case we emit $$J0 to indicate this.
This patch adds support for both of these cases.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@339471 91177308-0d34-0410-b5e6-96231b3b80d8

6 years ago[InstCombine] add tests for fsub factorization; NFC
Sanjay Patel [Fri, 10 Aug 2018 21:00:27 +0000 (21:00 +0000)]
[InstCombine] add tests for fsub factorization; NFC

The tests show that;
1. The fold doesn't fire for vectors, but it should.
2. The fold fires regardless of uses, but it shouldn't.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@339470 91177308-0d34-0410-b5e6-96231b3b80d8

6 years ago[InstCombine] rearrange code for foldSelectBinOpIdentity; NFCI
Sanjay Patel [Fri, 10 Aug 2018 20:30:35 +0000 (20:30 +0000)]
[InstCombine] rearrange code for foldSelectBinOpIdentity; NFCI

This is a retry of rL339439 with a fix for the problem that
caused the original commit to be reverted at rL339446.

That problem was that the compare can be integer while
the binop is FP or vice-versa, so we need to use the binop
type when we ask for the identity constant.

A test to guard against the problem was added at rL339453.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@339469 91177308-0d34-0410-b5e6-96231b3b80d8

6 years ago[llvm-mca] Make InstrBuilder::getOrCreateInstrDesc private. NFC.
Matt Davis [Fri, 10 Aug 2018 20:24:27 +0000 (20:24 +0000)]
[llvm-mca] Make InstrBuilder::getOrCreateInstrDesc private. NFC.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@339468 91177308-0d34-0410-b5e6-96231b3b80d8

6 years ago[InstCombine] add tests to show disabling of libcall/intrinsic shrinking; NFC
Sanjay Patel [Fri, 10 Aug 2018 20:12:36 +0000 (20:12 +0000)]
[InstCombine] add tests to show disabling of libcall/intrinsic shrinking; NFC

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@339467 91177308-0d34-0410-b5e6-96231b3b80d8

6 years agoResubmit r339450 - [MS Demangler] Add conversion operator tests
Zachary Turner [Fri, 10 Aug 2018 20:08:46 +0000 (20:08 +0000)]
Resubmit r339450 - [MS Demangler] Add conversion operator tests

This was broken because of a malformed check line.  Incidentally,
this exposed a case where we crash when we should just be returning
an error, so we should fix that.  The demangler shouldn't crash due
to user input.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@339466 91177308-0d34-0410-b5e6-96231b3b80d8

6 years ago[MS Demangler] Demangle cv qualifiers on template args.
Zachary Turner [Fri, 10 Aug 2018 19:57:36 +0000 (19:57 +0000)]
[MS Demangler] Demangle cv qualifiers on template args.

Before we wouldn't properly demangle something like
Foo<const int>.  Template args have a special escape sequence
'$$C' that is optional, but if it is present contains
qualifiers.  So we need to check for this and only if it
present, demangle qualifiers before demangling the type.

With this fix, we re-enable some tests that were previously
marked FIXME.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@339465 91177308-0d34-0410-b5e6-96231b3b80d8

6 years agoAMDGPU: More canonicalized operations
Matt Arsenault [Fri, 10 Aug 2018 19:20:17 +0000 (19:20 +0000)]
AMDGPU: More canonicalized operations

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@339464 91177308-0d34-0410-b5e6-96231b3b80d8

6 years agorevert r339450 - [MS Demangler] Add conversion operator tests
Sanjay Patel [Fri, 10 Aug 2018 19:20:16 +0000 (19:20 +0000)]
revert r339450 - [MS Demangler] Add conversion operator tests

Something here causes an assertion failure that killed a bunch of bots.
Example:
http://lab.llvm.org:8011/builders/reverse-iteration/builds/7021/steps/check_all/logs/stdio

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@339463 91177308-0d34-0410-b5e6-96231b3b80d8

6 years agoAMDGPU: Combine and of seto/setuo and fp_class
Matt Arsenault [Fri, 10 Aug 2018 18:58:56 +0000 (18:58 +0000)]
AMDGPU: Combine and of seto/setuo and fp_class

Clear the nan (or non-nan) test bits from the mask.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@339462 91177308-0d34-0410-b5e6-96231b3b80d8

6 years agoAMDGPU: Turn class x, p_zero|n_zero into fcmp oeq x, 0
Matt Arsenault [Fri, 10 Aug 2018 18:58:49 +0000 (18:58 +0000)]
AMDGPU: Turn class x, p_zero|n_zero into fcmp oeq x, 0

The library does use this for some reason.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@339461 91177308-0d34-0410-b5e6-96231b3b80d8

6 years agoAMDGPU: Match isfinite pattern to class instructions
Matt Arsenault [Fri, 10 Aug 2018 18:58:41 +0000 (18:58 +0000)]
AMDGPU: Match isfinite pattern to class instructions

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@339460 91177308-0d34-0410-b5e6-96231b3b80d8

6 years agoAMDGPU: Add LLVM_FALLTHROUGH
Matt Arsenault [Fri, 10 Aug 2018 17:57:12 +0000 (17:57 +0000)]
AMDGPU: Add LLVM_FALLTHROUGH

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@339458 91177308-0d34-0410-b5e6-96231b3b80d8

6 years agoUpdate the coding standards and developer policy documentation surrounding whitespace.
Aaron Ballman [Fri, 10 Aug 2018 17:26:07 +0000 (17:26 +0000)]
Update the coding standards and developer policy documentation surrounding whitespace.

Clarify that you should not introduce trailing whitespace when making a commit and that you should not remove trailing whitespace that's unrelated to code you are changing or are about to change. Then clarified the developer policy around what is considered an obvious whitespace commit.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@339455 91177308-0d34-0410-b5e6-96231b3b80d8

6 years ago[InstCombine] add/update tests for selectBinOpIdentity; NFC
Sanjay Patel [Fri, 10 Aug 2018 17:20:24 +0000 (17:20 +0000)]
[InstCombine] add/update tests for selectBinOpIdentity; NFC

This includes a test that would have exposed the bug in rL339439
which was reverted at rL339446. The compare can be integer while
the binop is FP or vice-versa, so we need to use the binop type
when we ask for the identity constant.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@339453 91177308-0d34-0410-b5e6-96231b3b80d8

6 years ago[MS Demangler] Add conversion operator tests.
Zachary Turner [Fri, 10 Aug 2018 16:55:59 +0000 (16:55 +0000)]
[MS Demangler] Add conversion operator tests.

The mangled names were added in the original commit, but
the demangled equivalents weren't, so nothing was actually
being checked.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@339450 91177308-0d34-0410-b5e6-96231b3b80d8

6 years ago[llvm-objcopy] NFC: consistently use typename ELFT::<X> definitions in headers
Jordan Rupprecht [Fri, 10 Aug 2018 16:25:58 +0000 (16:25 +0000)]
[llvm-objcopy] NFC: consistently use typename ELFT::<X> definitions in headers

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@339448 91177308-0d34-0410-b5e6-96231b3b80d8

6 years ago[hwasan] Add -hwasan-with-ifunc flag.
Evgeniy Stepanov [Fri, 10 Aug 2018 16:21:37 +0000 (16:21 +0000)]
[hwasan] Add -hwasan-with-ifunc flag.

Summary: Similar to asan's flag, it can be used to disable the use of ifunc to access hwasan shadow address.

Reviewers: vitalybuka, kcc

Subscribers: srhines, hiraditya, llvm-commits

Differential Revision: https://reviews.llvm.org/D50544

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@339447 91177308-0d34-0410-b5e6-96231b3b80d8

6 years ago[InstCombine] revert r339439 - rearrange code for foldSelectBinOpIdentity
Sanjay Patel [Fri, 10 Aug 2018 16:12:19 +0000 (16:12 +0000)]
[InstCombine] revert r339439 - rearrange code for foldSelectBinOpIdentity

That was supposed to be NFC, but it exposed a logic hole somewhere that
caused bots to fail.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@339446 91177308-0d34-0410-b5e6-96231b3b80d8

6 years ago[InstCombine][NFC] Added tests for select with binop fold
David Bolvansky [Fri, 10 Aug 2018 15:29:09 +0000 (15:29 +0000)]
[InstCombine][NFC] Added tests for select with binop fold

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@339441 91177308-0d34-0410-b5e6-96231b3b80d8

6 years ago[InstCombine] rearrange code for foldSelectBinOpIdentity; NFCI
Sanjay Patel [Fri, 10 Aug 2018 15:11:26 +0000 (15:11 +0000)]
[InstCombine] rearrange code for foldSelectBinOpIdentity; NFCI

This should make it easier to folow and to add the planned enhancements
such as D50190.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@339439 91177308-0d34-0410-b5e6-96231b3b80d8

6 years ago[MS Demangler] Properly demangle conversion operators.
Zachary Turner [Fri, 10 Aug 2018 15:04:56 +0000 (15:04 +0000)]
[MS Demangler] Properly demangle conversion operators.

These were completely broken before.  We need to handle
the 'B' operator tag.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@339436 91177308-0d34-0410-b5e6-96231b3b80d8

6 years ago[MS Demangler] Disable a couple of tests.
Zachary Turner [Fri, 10 Aug 2018 14:53:33 +0000 (14:53 +0000)]
[MS Demangler] Disable a couple of tests.

The check lines are marked FIXME but not the mangled names.
This is causing an error.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@339435 91177308-0d34-0410-b5e6-96231b3b80d8

6 years ago[MS Demangler] Fix several issues related to templates.
Zachary Turner [Fri, 10 Aug 2018 14:31:04 +0000 (14:31 +0000)]
[MS Demangler] Fix several issues related to templates.

These were uncovered when porting the mangling tests in
ms-templates.cpp from clang/CodeGenCXX over to demangling
tests.  The main issues fixed here are surrounding integer
literal signed and unsignedness, empty array dimensions,
and pointer and reference non-type template parameters.

Differential Revision: https://reviews.llvm.org/D50512

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@339434 91177308-0d34-0410-b5e6-96231b3b80d8

6 years ago[ARM] Disallow zexts in ARMCodeGenPrepare
Sam Parker [Fri, 10 Aug 2018 13:57:13 +0000 (13:57 +0000)]
[ARM] Disallow zexts in ARMCodeGenPrepare

Enabling ARMCodeGenPrepare by default caused a whole load of
failures. This is due to zexts and truncs not being handled properly.
ZExts are messy so it's just easier to disable for now and truncs
are allowed only as 'sinks'. I still need to figure out why allowing
them as 'sources' causes so many failures. The other main changes are
that we are explicit in the types that we converting to, it's now
always 'TypeSize'. Type support is also now performed while checking
for valid opcodes as it unnecessarily complicated having the checks
are different stages.

I've moved the tests around too, so we have the zext and truncs in
their own file as well as the overflowing opcode tests.

Differential Revision: https://reviews.llvm.org/D50518

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@339432 91177308-0d34-0410-b5e6-96231b3b80d8

6 years ago[X86][SSE] Pull out repeated shift getOpcode() calls. NFCI.
Simon Pilgrim [Fri, 10 Aug 2018 11:42:42 +0000 (11:42 +0000)]
[X86][SSE] Pull out repeated shift getOpcode() calls. NFCI.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@339425 91177308-0d34-0410-b5e6-96231b3b80d8

6 years agoFix -Wimplicit-fallthrough warning introduced in rL339397.
Simon Pilgrim [Fri, 10 Aug 2018 11:02:44 +0000 (11:02 +0000)]
Fix -Wimplicit-fallthrough warning introduced in rL339397.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@339422 91177308-0d34-0410-b5e6-96231b3b80d8

6 years ago[Tablegen][SubtargetEmitter] refactor method `emitSchedModelHelpersImpl()`. NFCI
Andrea Di Biagio [Fri, 10 Aug 2018 10:43:43 +0000 (10:43 +0000)]
[Tablegen][SubtargetEmitter] refactor method `emitSchedModelHelpersImpl()`. NFCI

Part of the logic has been moved to helper functions to (hopefully) improve
readability.
Added a few code comments to better describe how the algorithm works.

No functional change intended.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@339421 91177308-0d34-0410-b5e6-96231b3b80d8

6 years agoRename the cfguard module flag to cfguardtable
Hans Wennborg [Fri, 10 Aug 2018 09:48:53 +0000 (09:48 +0000)]
Rename the cfguard module flag to cfguardtable

The previous name sounds like it inserts cfguard implementation, but it
really just emits the table of address-taken functions. Change the name
to better reflect that.

Clang will be updated in the next commit.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@339419 91177308-0d34-0410-b5e6-96231b3b80d8

6 years ago[NFC] Add tests that demonstrate that MustExecute is fundamentally broken
Max Kazantsev [Fri, 10 Aug 2018 09:20:46 +0000 (09:20 +0000)]
[NFC] Add tests that demonstrate that MustExecute is fundamentally broken

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@339417 91177308-0d34-0410-b5e6-96231b3b80d8

6 years ago[MSan] Shrink the register save area for non-SSE builds
Alexander Potapenko [Fri, 10 Aug 2018 08:06:43 +0000 (08:06 +0000)]
[MSan] Shrink the register save area for non-SSE builds

If code is compiled for X86 without SSE support, the register save area
doesn't contain FPU registers, so `AMD64FpEndOffset` should be equal to
`AMD64GpEndOffset`.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@339414 91177308-0d34-0410-b5e6-96231b3b80d8

6 years ago[MemorySSA] "Fix" lifetime intrinsic handling
George Burgess IV [Fri, 10 Aug 2018 05:14:43 +0000 (05:14 +0000)]
[MemorySSA] "Fix" lifetime intrinsic handling

MemorySSA currently creates MemoryAccesses for lifetime intrinsics, and
sometimes treats them as clobbers. This may/may not be the best way
forward, but while we're doing it, we should consider
MayAlias/PartialAlias to be clobbers.

The ideal fix here is probably to remove all of this reasoning about
lifetimes from MemorySSA + put it into the passes that need to care. But
that's a wayyy broader fix that needs some consensus, and we have
miscompiles + a release branch today, and this should solve the
miscompiles just as well.

differential revision is D43269. Landing without an explicit LGTM (and
without using the special please-autoclose-this syntax) so we can still
use that revision as a place to decide what the right fix here is.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@339411 91177308-0d34-0410-b5e6-96231b3b80d8

6 years ago[InstCombine] Transform str(n)cmp to memcmp
David Bolvansky [Fri, 10 Aug 2018 04:32:54 +0000 (04:32 +0000)]
[InstCombine] Transform str(n)cmp to memcmp

Summary:
Motivation examples:
int strcmp_memcmp() {
    char buf[12];
    return strcmp(buf, "key") == 0;
}

int strcmp_memcmp2() {
    char buf[12];
    return strcmp(buf, "key") != 0;
}

int strncmp_memcmp() {
    char buf[12];
    return strncmp(buf, "key", 3) == 0;
}

can be turned to memcmp.

See test file for more cases.

Reviewers: efriedma

Reviewed By: efriedma

Subscribers: spatel, llvm-commits

Differential Revision: https://reviews.llvm.org/D50233

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@339410 91177308-0d34-0410-b5e6-96231b3b80d8

6 years ago[WebAssembly] Gate i64x2 and f64x2 on -wasm-enable-unimplemented
Heejin Ahn [Thu, 9 Aug 2018 23:58:51 +0000 (23:58 +0000)]
[WebAssembly] Gate i64x2 and f64x2 on -wasm-enable-unimplemented

Summary:
i64x2 and f64x2 operations are not implemented in V8, so we normally
do not want to emit them. However, they are in the SIMD spec proposal,
so we still want to be able to test them in the toolchain. This patch
adds a flag to enable their emission.

Reviewers: aheejin, dschuff

Subscribers: sunfish, jgravelle-google, sbc100, llvm-commits

Differential Revision: https://reviews.llvm.org/D50423

Patch by Thomas Lively (tlively)

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@339407 91177308-0d34-0410-b5e6-96231b3b80d8

6 years ago[X86] Qualify one of the heuristics in combineMul to only apply to positive multiply...
Craig Topper [Thu, 9 Aug 2018 23:27:42 +0000 (23:27 +0000)]
[X86] Qualify one of the heuristics in combineMul to only apply to positive multiply amounts.

This seems to slightly help the performance of one of our internal benchmarks. We probably need better heuristics here.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@339406 91177308-0d34-0410-b5e6-96231b3b80d8

6 years ago[llvm-objcopy] NFC: Add some color to error()
Jordan Rupprecht [Thu, 9 Aug 2018 22:52:03 +0000 (22:52 +0000)]
[llvm-objcopy] NFC: Add some color to error()

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@339404 91177308-0d34-0410-b5e6-96231b3b80d8

6 years agoValueTracking: Start enhancing isKnownNeverNaN
Matt Arsenault [Thu, 9 Aug 2018 22:40:08 +0000 (22:40 +0000)]
ValueTracking: Start enhancing isKnownNeverNaN

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@339399 91177308-0d34-0410-b5e6-96231b3b80d8

6 years ago[WebAssembly] Fix wasm backend compilation on gcc 5.4: variable name cannot match...
Heejin Ahn [Thu, 9 Aug 2018 22:35:23 +0000 (22:35 +0000)]
[WebAssembly] Fix wasm backend compilation on gcc 5.4: variable name cannot match class

Summary:
gcc does not like

const Region *Region;

It wants a different name for the variable.

Is there a better convention for what name to use in such a case?

Reviewers: sbc100, aheejin

Subscribers: aheejin, jgravelle-google, dschuff, llvm-commits

Differential Revision: https://reviews.llvm.org/D50472

Patch by Alon Zakai (kripken)

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@339398 91177308-0d34-0410-b5e6-96231b3b80d8

6 years ago[MC] Move EH DWARF encodings from MC to CodeGen, NFC
Reid Kleckner [Thu, 9 Aug 2018 22:24:04 +0000 (22:24 +0000)]
[MC] Move EH DWARF encodings from MC to CodeGen, NFC

Summary:
The TType encoding, LSDA encoding, and personality encoding are all
passed explicitly by CodeGen to the assembler through .cfi_* directives,
so only the AsmPrinter needs to know about them.

The FDE CFI encoding however, controls the encoding of the label
implicitly created by the .cfi_startproc directive. That directive seems
to be special in that it doesn't take an encoding, so the assembler just
has to know how to encode one DSO-local label reference from .eh_frame
to .text.

As a result, it looks like MC will continue to have to know when the
large code model is in use. Perhaps we could invent a '.cfi_startproc
[large]' flag so that this knowledge doesn't need to pollute the
assembler.

Reviewers: davide, lliu0, JDevlieghere

Subscribers: hiraditya, fedor.sergeev, llvm-commits

Differential Revision: https://reviews.llvm.org/D50533

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@339397 91177308-0d34-0410-b5e6-96231b3b80d8

6 years ago[InstSimplify] move minnum/maxnum with Inf folds from instcombine
Sanjay Patel [Thu, 9 Aug 2018 22:20:44 +0000 (22:20 +0000)]
[InstSimplify] move minnum/maxnum with Inf folds from instcombine

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@339396 91177308-0d34-0410-b5e6-96231b3b80d8

6 years agoAdd owner for llvm-objcopy
Jake Ehrlich [Thu, 9 Aug 2018 22:05:19 +0000 (22:05 +0000)]
Add owner for llvm-objcopy

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@339394 91177308-0d34-0410-b5e6-96231b3b80d8