Commit Graph

136569 Commits

Author SHA1 Message Date
Michael Kuperstein
f1860b7beb Make TwoAddressInstructionPass::rescheduleMIBelowKill subreg-aware
This fixes PR28824.

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



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@278370 91177308-0d34-0410-b5e6-96231b3b80d8
2016-08-11 17:38:33 +00:00
Matt Arsenault
d751c97ce5 AMDGPU: Fix crashes on memory functions
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@278369 91177308-0d34-0410-b5e6-96231b3b80d8
2016-08-11 17:31:42 +00:00
Matt Arsenault
9ffb824366 AArch64: Assert on analyzeBranch failing
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@278366 91177308-0d34-0410-b5e6-96231b3b80d8
2016-08-11 17:22:59 +00:00
Michael Kuperstein
e99815b052 [AliasSetTracker] Delete dead code
Deletes unused remove() and containsPointer() interfaces. NFC.

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


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@278365 91177308-0d34-0410-b5e6-96231b3b80d8
2016-08-11 17:20:20 +00:00
Eugene Zelenko
c986ab210b Fix some Clang-tidy modernize and Include What You Use warnings.
Differential revision: https://reviews.llvm.org/D23291


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@278364 91177308-0d34-0410-b5e6-96231b3b80d8
2016-08-11 17:20:18 +00:00
Teresa Johnson
7a1d8e430e Add move ops to satisfy MSVC.
Try to appease MSVC bot:
http://lab.llvm.org:8011/builders/sanitizer-windows/builds/27164/steps/run%20tests/logs/stdio

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@278363 91177308-0d34-0410-b5e6-96231b3b80d8
2016-08-11 17:19:53 +00:00
Matt Arsenault
f29c37acb0 AMDGPU: Remove custom getSubReg
This was kind of confusing, the subregister
class shouldn't really be necessary.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@278362 91177308-0d34-0410-b5e6-96231b3b80d8
2016-08-11 17:15:32 +00:00
Matt Arsenault
ece2d8b253 AMDGPU: Remove unused tracking of flat instructions
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@278361 91177308-0d34-0410-b5e6-96231b3b80d8
2016-08-11 17:15:28 +00:00
Wei Ding
523717c1fe AMDGPU : Fix SAD related instruction LIT tests function atttibute issues.
Differential Revision: http://reviews.llvm.org/D23133

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@278360 91177308-0d34-0410-b5e6-96231b3b80d8
2016-08-11 17:14:17 +00:00
Duncan P. N. Exon Smith
aba9f58b23 Hexagon: Avoid dereferencing end() in HexagonCopyToCombine::findPairable
Check for end() before skipping through debug values.  This avoids
dereferencing end() when the instruction is the final one in the basic
block.  (It still assumes that a debug value will not be the final
instruction in the basic block.  No tests seemed to violate that.)

Many Hexagon tests trigger this, but they happen to magically pass right
now.  I found this because WIP patches for PR26753 convert them into
crashes.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@278355 91177308-0d34-0410-b5e6-96231b3b80d8
2016-08-11 16:40:03 +00:00
Wei Ding
9bcebab62b AMDGPU : Add LLVM intrinsics for SAD related instructions.
Differential Revision: http://reviews.llvm.org/D23133

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@278354 91177308-0d34-0410-b5e6-96231b3b80d8
2016-08-11 16:33:53 +00:00
Teresa Johnson
a6a3520f08 Add (hopefully last) remaining missing dependences to llvm-lto2
There are still a few missing symbols reported by:
http://bb.pgr.jp/builders/i686-mingw32-RA-on-linux/builds/15535/steps/build_llvmclang/logs/stdio
http://bb.pgr.jp/builders/i686-mingw32-RA-on-linux/builds/15535/steps/build_llvmclang/logs/stdio

This should hopefully take care of them.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@278353 91177308-0d34-0410-b5e6-96231b3b80d8
2016-08-11 16:29:47 +00:00
Tim Northover
f1ef4a3eef GlobalISel: clear vreg mapping after translating each function
Otherwise we only materialize (shared) constants in the first function they
appear in. This doesn't go well.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@278351 91177308-0d34-0410-b5e6-96231b3b80d8
2016-08-11 16:21:29 +00:00
Reid Kleckner
a4d7181fe4 Remove FIXME about asserting on the end iterator
After machine block placement, MBBs may not have terminators, and it is
appropriate to check for the end iterator here. We can fold the check
into the next if, as well. This look is really just looking for BBs that
end in CATCHRET.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@278350 91177308-0d34-0410-b5e6-96231b3b80d8
2016-08-11 16:00:43 +00:00
Teresa Johnson
c4513c68e0 More missing llvm-lto2 dependencies
Follow-on to r278341: Update CMakeLists.txt to match LLVMBuild.txt

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@278349 91177308-0d34-0410-b5e6-96231b3b80d8
2016-08-11 15:58:49 +00:00
Lang Hames
3f8d4e3f67 [MCJIT] Improve documentation and error handling for MCJIT::runFunction.
ExecutionEngine::runFunction is supposed to allow execution of arbitrary
function types, but MCJIT can only reasonably support a limited subset of
main-linke function types. This patch documents this limitation, and fixes
MCJIT::runFunction to abort with a meaningful error at runtime if called with
an unsupported function type.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@278348 91177308-0d34-0410-b5e6-96231b3b80d8
2016-08-11 15:56:23 +00:00
Duncan P. N. Exon Smith
8949cc2a95 X86: Use operator lookup for operator==, NFC
Avoid relying on the MachineInstrBundleIterator operator== being
implemented as a member function.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@278347 91177308-0d34-0410-b5e6-96231b3b80d8
2016-08-11 15:51:29 +00:00
Duncan P. N. Exon Smith
9040acb5e3 IR: Don't cast the end iterator to Instruction*
End iterators are usually sentinels, not actually Instruction* at all.
Stop casting to it just to get an iterator back.

There is likely no observable functionality change here right now
(although this is relying on UB, I doubt it was triggering anything),
but I'll be removing the cast soon.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@278346 91177308-0d34-0410-b5e6-96231b3b80d8
2016-08-11 15:45:04 +00:00
Duncan P. N. Exon Smith
91c138b3e0 CodeGen: Check for a terminator in llvm::getFuncletMembership
Check for an end iterator from MachineBasicBlock::getFirstTerminator in
llvm::getFuncletMembership.  If this is turned into an assertion, it
fires in 48 X86 testcases (for example,
CodeGen/X86/regalloc-spill-at-ehpad.ll).

Since this is likely a latent bug (shouldn't all basic blocks end with a
terminator?) I've filed PR28938.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@278344 91177308-0d34-0410-b5e6-96231b3b80d8
2016-08-11 15:29:02 +00:00
Matthew Simpson
67914cbf05 [SLP] Make RecursionMaxDepth a command line option (NFC)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@278343 91177308-0d34-0410-b5e6-96231b3b80d8
2016-08-11 15:28:45 +00:00
Sanjay Patel
16fc409d35 fix comment; NFC
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@278342 91177308-0d34-0410-b5e6-96231b3b80d8
2016-08-11 15:23:56 +00:00
Teresa Johnson
31aaf81889 Fix bot failure from r278338 due to missing dependences
Add some missing dependences to the llvm-lto2 tool to attempt to appease
missing symbols in link from bot:
http://bb.pgr.jp/builders/i686-mingw32-RA-on-linux/builds/15527

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@278341 91177308-0d34-0410-b5e6-96231b3b80d8
2016-08-11 15:23:05 +00:00
Sanjay Patel
583b94db9f use auto* with dyn_cast ; NFC
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@278340 91177308-0d34-0410-b5e6-96231b3b80d8
2016-08-11 15:21:21 +00:00
Sanjay Patel
4636b0c422 getParent()->getParent() == getFunction() ; NFC
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@278339 91177308-0d34-0410-b5e6-96231b3b80d8
2016-08-11 15:16:06 +00:00
Teresa Johnson
2d320e58a9 Restore "Resolution-based LTO API."
This restores commit r278330, with fixes for a few bot failures:
- Fix a late change I had made to the save temps output file that I
  missed due to existing files sitting on my disk
- Fix a bunch of Windows bot failures with "ambiguous call to overloaded
  function" due to confusion between llvm::make_unique vs
  std::make_unique (preface the new make_unique calls with "llvm::")
- Attempt to fix a modules bot failure by adding a missing include
  to LTO/Config.h.

Original change:

Resolution-based LTO API.

Summary:
This introduces a resolution-based LTO API. The main advantage of this API over
existing APIs is that it allows the linker to supply a resolution for each
symbol in each object, rather than the combined object as a whole. This will
become increasingly important for use cases such as ThinLTO which require us
to process symbol resolutions in a more complicated way than just adjusting
linkage.

Patch by Peter Collingbourne.

Reviewers: rafael, tejohnson, mehdi_amini

Subscribers: lhames, tejohnson, mehdi_amini, llvm-commits

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@278338 91177308-0d34-0410-b5e6-96231b3b80d8
2016-08-11 14:58:12 +00:00
Ehsan Amiri
d418a914db revert 278334
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@278337 91177308-0d34-0410-b5e6-96231b3b80d8
2016-08-11 14:51:14 +00:00
Valery Pykhtin
d27913ee68 Revert "[AMDGPU] fix failure on printing of non-existing instruction operands."
This reverts revision 278333, newly added test failed.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@278336 91177308-0d34-0410-b5e6-96231b3b80d8
2016-08-11 14:22:05 +00:00
Ehsan Amiri
543fef7ea9 Extend trip count instead of truncating IV in LFTR, when legal
When legal, extending trip count in the loop control logic generates better code compared to truncating IV. This is because

(1) extending trip count is a loop invariant operation (see genLoopLimit where we prove trip count is loop invariant).
(2) Scalar Evolution seems to have problems understanding trunc when computing loop trip count. So removing them allows better analysis performed in Scalar Evolution. (In particular this fixes PR 28363 which is the motivation for this change).

I am not going to perform any performance test. Any degradation caused by this should be an indication of a bug elsewhere.

To prove legality, we rely on SCEV to prove zext(trunc(IV)) == IV (or similarly for sext). If this holds, we can prove equivalence of trunc(IV)==ExitCnt (1) and IV == zext(ExitCnt). Simply take zext of boths sides of (1) and apply the proven equivalence.

https://reviews.llvm.org/D23075



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@278334 91177308-0d34-0410-b5e6-96231b3b80d8
2016-08-11 13:51:20 +00:00
Valery Pykhtin
3876e2e984 [AMDGPU] fix failure on printing of non-existing instruction operands.
Differential revision: https://reviews.llvm.org/D23323

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@278333 91177308-0d34-0410-b5e6-96231b3b80d8
2016-08-11 13:49:46 +00:00
Teresa Johnson
6f0ab85031 Revert "Resolution-based LTO API."
This reverts commit r278330.

I made a change to the save temps output that is causing issues with the
bots. Didn't realize this because I had older output files sitting on
disk in my test output directory.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@278331 91177308-0d34-0410-b5e6-96231b3b80d8
2016-08-11 13:03:56 +00:00
Teresa Johnson
9fd977036c Resolution-based LTO API.
Summary:
This introduces a resolution-based LTO API. The main advantage of this API over
existing APIs is that it allows the linker to supply a resolution for each
symbol in each object, rather than the combined object as a whole. This will
become increasingly important for use cases such as ThinLTO which require us
to process symbol resolutions in a more complicated way than just adjusting
linkage.

Patch by Peter Collingbourne.

Reviewers: rafael, tejohnson, mehdi_amini

Subscribers: lhames, tejohnson, mehdi_amini, llvm-commits

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

Address review comments

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@278330 91177308-0d34-0410-b5e6-96231b3b80d8
2016-08-11 12:56:40 +00:00
Simon Pilgrim
452ae8eb69 Fixed VS2015 (Update 3) warning - differing const/volatile qualifiers for overridden function
Dropped the const qualifier to match llvm::CallLowering::lowerCall

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@278329 91177308-0d34-0410-b5e6-96231b3b80d8
2016-08-11 12:19:43 +00:00
Igor Breger
33ca8b83f6 [AVX512] Fix extractelement i1 lowering.
The previous implementation (not custom) doesn't enforce zeroing off upper bits. The assumption is that i1 PRODUCER (truncate and extractelement) must zero all upper bits, so i1 CONSUMER instructions ( test, zext, save, etc) can be done without additional zeroing.
Make extractelement i1 lowering custom for all vector i1.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@278328 91177308-0d34-0410-b5e6-96231b3b80d8
2016-08-11 12:13:46 +00:00
Marina Yatsina
ac9ca3bbe7 Avoid false dependencies of undef machine operands
This patch helps avoid false dependencies on undef registers by updating the machine instructions' undef operand to use a register that the instruction is truly dependent on, or use a register with clearance higher than Pref.

Pseudo example:

loop:
xmm0 = ...
xmm1 = vcvtsi2sdl eax, xmm0<undef>
... = inst xmm0
jmp loop

In this example, selecting xmm0 as the undef register creates false dependency between loop iterations.
This false dependency cannot be solved by inserting an xor before vcvtsi2sdl because xmm0 is alive at the point of the vcvtsi2sdl instruction.
Selecting a different register instead of xmm0, especially a register that is not used in the loop, will eliminate this problem.

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



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@278321 91177308-0d34-0410-b5e6-96231b3b80d8
2016-08-11 07:32:08 +00:00
Amjad Aboud
9c5342337a [Debug Info] Added a LIT test that covers the fix committed in rL277290.
Differential Revision: http://reviews.llvm.org/D23056


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@278320 91177308-0d34-0410-b5e6-96231b3b80d8
2016-08-11 07:22:53 +00:00
Craig Topper
d91ccf52e2 [AVX-512] Promote 512-bit integer loads to v8i64 similar to what is done for 128/256-bit vectors for overall consistency.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@278318 91177308-0d34-0410-b5e6-96231b3b80d8
2016-08-11 06:04:07 +00:00
Craig Topper
e0ce251bcc [AVX-512] Add patterns to allow EVEX encoded stores of v16i16/v8i16/v16i8/v32i8 even when BWI is not supported.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@278317 91177308-0d34-0410-b5e6-96231b3b80d8
2016-08-11 06:04:04 +00:00
Craig Topper
bc13ca6202 [AVX-512] Fix the 128-bit and 256-bit nontemporal load patterns with elements type other than i64. These loads have all been promoted to v2i64/v4i64 loads so we need bitcasts or we end up selecting VMOVDQA32/VMOVDQU32 instead.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@278316 91177308-0d34-0410-b5e6-96231b3b80d8
2016-08-11 06:04:00 +00:00
Xinliang David Li
b894886c6e [Profile] improve warning control option
Change --no-pgo-warn-missing to -pgo-warn-missing-function
and negate the default. /NFC

Add more test to make sure the warning is off by default




git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@278314 91177308-0d34-0410-b5e6-96231b3b80d8
2016-08-11 05:09:30 +00:00
Dominic Chen
a01f239d02 [WebAssembly] Cleanup trailing whitespace
Summary: Test for commit access.

Subscribers: jfb, dschuff

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@278313 91177308-0d34-0410-b5e6-96231b3b80d8
2016-08-11 04:10:56 +00:00
Easwaran Raman
a31d08bbe2 Make more fields of InlineParams Optional.
Differential revision: https://reviews.llvm.org/D23386


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@278312 91177308-0d34-0410-b5e6-96231b3b80d8
2016-08-11 03:58:05 +00:00
Sanjoy Das
497124346e [Statepoints] Minor cosmetic change; NFC
The verification failure message was missing a space.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@278309 91177308-0d34-0410-b5e6-96231b3b80d8
2016-08-11 00:56:46 +00:00
Chris Bieneman
50b70a6871 [MachOYAML] Don't output empty ExportTrie
The YAML representation was always outputting the root node of an export trie even if the trie was empty. While this doesn't really have any functional impact, it does add visual clutter to the yaml file.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@278307 91177308-0d34-0410-b5e6-96231b3b80d8
2016-08-11 00:20:03 +00:00
Tim Northover
497466801a GlobalISel: support same ConstantExprs as Instructions.
It's more than just inttoptr, but the others can't be tested until we have
support for non-trivial constants (they currently get unavoidably folded to a
ConstantInt).

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@278303 91177308-0d34-0410-b5e6-96231b3b80d8
2016-08-10 23:02:41 +00:00
Tim Shen
006d0e79fb [ADT] Move LLVM_ATTRIBUTE_UNUSED_RESULT to the function, otherwise gcc 4.8 complains about it.
It's a fix for the original patch r278251.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@278298 91177308-0d34-0410-b5e6-96231b3b80d8
2016-08-10 22:35:38 +00:00
Tim Northover
9aa5ced240 GlobalISel: add tests forgotten in r278293.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@278296 91177308-0d34-0410-b5e6-96231b3b80d8
2016-08-10 22:13:48 +00:00
Sanjoy Das
be91a8ec03 [LangRef] Fix formatting (no semantic change)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@278294 91177308-0d34-0410-b5e6-96231b3b80d8
2016-08-10 21:48:24 +00:00
Tim Northover
3b3a95a083 GlobalISel: implement simple function calls on AArch64.
We're still limited in the arguments we support, but this at least handles the
basic cases.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@278293 91177308-0d34-0410-b5e6-96231b3b80d8
2016-08-10 21:44:01 +00:00
Changpeng Fang
4a0373d17a AMDGPU/SI: Implement amdgcn image intrinsics with sampler
Summary:
  This patch define and implement amdgcn image intrinsics with sampler.

    1. define vdata type to be llvm_anyfloat_ty, address type to be llvm_anyfloat_ty,
       and rsrc type to be llvm_anyint_ty. As a result, we expect the intrinsics name
       to have three suffixes to overload each of these three types;

    2. D128 as well as two other flags are implied in the three types, for example,
       if you use v8i32 as resource type, then r128 is 0!

    3. don't expose TFE flag, and other flags are exposed in the instruction order:
       unrm, glc, slc, lwe and da.

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

Reviewed by:
  arsenm and tstellarAMD

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@278291 91177308-0d34-0410-b5e6-96231b3b80d8
2016-08-10 21:15:30 +00:00
Piotr Padlewski
e70f4f796e Changed sign of LastCallToStaticBouns
Summary:
I think it is much better this way.
When I firstly saw line:
  Cost += InlineConstants::LastCallToStaticBonus;
I though that this is a bug, because everywhere where the cost is being reduced
it is usuing -=.

Reviewers: eraman, tejohnson, mehdi_amini

Subscribers: llvm-commits, mehdi_amini

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@278290 91177308-0d34-0410-b5e6-96231b3b80d8
2016-08-10 21:15:22 +00:00