Commit Graph

136601 Commits

Author SHA1 Message Date
David Majnemer
975248e4fb Use the range variant of find instead of unpacking begin/end
If the result of the find is only used to compare against end(), just
use is_contained instead.

No functionality change is intended.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@278433 91177308-0d34-0410-b5e6-96231b3b80d8
2016-08-11 22:21:41 +00:00
Piotr Padlewski
fb2a7f990d Don't import variadic functions
Summary:
This patch adds IsVariadicFunction bit to summary in order
to not import variadic functions. Inliner doesn't inline
variadic functions because it is hard to reason about it.

This one small fix improves Importer by about 16%
(going from 86% to 100% of imported functions that are
inlined anywhere)
on some spec benchmarks like 'int' and others.

Reviewers: eraman, mehdi_amini, tejohnson

Subscribers: mehdi_amini, llvm-commits

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@278432 91177308-0d34-0410-b5e6-96231b3b80d8
2016-08-11 22:13:57 +00:00
Vyacheslav Klochkov
5747888f2f X86-FMA3: Implemented commute transformation for EVEX/AVX512 FMA3 opcodes.
This helped to improved memory-folding and register coalescing optimizations.

Also, this patch fixed the tracker #17229.

Reviewer: Craig Topper.
Differential Revision: https://reviews.llvm.org/D23108


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@278431 91177308-0d34-0410-b5e6-96231b3b80d8
2016-08-11 22:07:33 +00:00
Rui Ueyama
837032f833 Re-commit r278066: Do not ignore SizeOfOptionalHeader in COFF header even if PE header is not present.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@278429 91177308-0d34-0410-b5e6-96231b3b80d8
2016-08-11 22:02:44 +00:00
Tim Northover
d4a60d05aa GlobalISel: support 'null' constant in translation.
It's sharing the integer G_CONSTANT for now since I don't *think* it creates
any ambiguity (even on weird archs). If that turns out wrong we can create a
G_PTRCONSTANT or something.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@278423 91177308-0d34-0410-b5e6-96231b3b80d8
2016-08-11 21:40:55 +00:00
Ehsan Amiri
f11cae6f49 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.

This commit contains changes in a newly added testcase which was not included in the previous commit (which was reverted later on).

https://reviews.llvm.org/D23075



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@278421 91177308-0d34-0410-b5e6-96231b3b80d8
2016-08-11 21:31:40 +00:00
Daniel Berlin
417fcecd6b [MSSA] Use is_contained
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@278418 91177308-0d34-0410-b5e6-96231b3b80d8
2016-08-11 21:26:50 +00:00
David Majnemer
dc9c737666 Use range algorithms instead of unpacking begin/end
No functionality change is intended.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@278417 91177308-0d34-0410-b5e6-96231b3b80d8
2016-08-11 21:15:00 +00:00
Krzysztof Parzyszek
4110644365 [Hexagon] Allow non-returning calls in hardware loops
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@278416 91177308-0d34-0410-b5e6-96231b3b80d8
2016-08-11 21:14:25 +00:00
David Majnemer
4df81566d5 [vim] Add more attributes to llvm.vim
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@278415 91177308-0d34-0410-b5e6-96231b3b80d8
2016-08-11 21:14:05 +00:00
Matt Arsenault
2e8e1e63de AMDGPU: Remove unused tablegen utilities
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@278414 91177308-0d34-0410-b5e6-96231b3b80d8
2016-08-11 21:08:43 +00:00
Geoff Berry
510ec2063e [SCEV] Update interface to handle SCEVExpander insert point motion.
Summary:
This is an extension of the fix in r271424.  That fix dealt with builder
insert points being moved by SCEV expansion, but only for the lifetime
of the expand call.  This change modifies the interface so that LSR can
safely call expand multiple times at the same insert point and do the
right thing if one of the expansions decides to move the original insert
point.

This is a fix for PR28719.

Reviewers: sanjoy

Subscribers: llvm-commits, mcrosier, mzolotukhin

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@278413 91177308-0d34-0410-b5e6-96231b3b80d8
2016-08-11 21:05:17 +00:00
Tim Northover
789ee9fd77 Remove empty file left by partial reversion.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@278411 91177308-0d34-0410-b5e6-96231b3b80d8
2016-08-11 21:01:15 +00:00
Tim Northover
814d8b30da GlobalISel: add translation support for shift operations.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@278410 91177308-0d34-0410-b5e6-96231b3b80d8
2016-08-11 21:01:13 +00:00
Tim Northover
94c692ea05 GlobalISel: support zext & sext during translation phase.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@278409 91177308-0d34-0410-b5e6-96231b3b80d8
2016-08-11 21:01:10 +00:00
Teresa Johnson
fe3eab28ce Fix type truncation warnings
Avoid type truncation warnings from a 32-bit bot due to size_t not
being unsigned long long, by converting the variables and constants to
unsigned. This was introduced by r278338 and caused warnings here:
http://bb.pgr.jp/builders/i686-mingw32-RA-on-linux/builds/15527/steps/build_llvmclang/logs/warnings%20%287%29

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@278406 91177308-0d34-0410-b5e6-96231b3b80d8
2016-08-11 20:38:39 +00:00
Daniel Berlin
c9f97fcd4c Move GVNHoist tests into their own directory since it is a separate pass
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@278404 91177308-0d34-0410-b5e6-96231b3b80d8
2016-08-11 20:35:07 +00:00
Wei Ding
2daf966c6f AMDGPU : Add intrinsic for instruction v_cvt_pk_u8_f32
Differential Revision: http://reviews.llvm.org/D23336

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@278403 91177308-0d34-0410-b5e6-96231b3b80d8
2016-08-11 20:34:48 +00:00
Wei Mi
da956b94ff Revert rL278384 which caused several buildbot failures (like check failures in CodeGen/X86/clz.ll).
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@278402 91177308-0d34-0410-b5e6-96231b3b80d8
2016-08-11 20:33:37 +00:00
Daniel Berlin
828990c2fc Fix PR 28933
Summary:
This fixes PR 28933 by making sure GVNHoist does not try to recreate memory
accesses when it has not actually moved them.

Reviewers: sebpop

Subscribers: llvm-commits, george.burgess.iv

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@278401 91177308-0d34-0410-b5e6-96231b3b80d8
2016-08-11 20:32:43 +00:00
Tim Shen
4c26d96c61 [ADT] Add relation operators for Optional
Summary: Make Optional's behavior the same as the coming std::optional.

Reviewers: dblaikie

Subscribers: llvm-commits

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@278397 91177308-0d34-0410-b5e6-96231b3b80d8
2016-08-11 20:10:15 +00:00
Duncan P. N. Exon Smith
eeb1d4fe2e CodeGen: Avoid dereferencing end() in MachineScheduler
Check MachineInstr::isDebugValue for the same instruction as we're
calling isSchedBoundary, avoiding the possibility of dereferencing
end().

This is a functionality change even when I!=end().  Matthias had a look
and agrees this is the right resolution (as opposed to checking for
end()).

This is triggered by a huge number of tests, 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@278394 91177308-0d34-0410-b5e6-96231b3b80d8
2016-08-11 20:03:09 +00:00
Matt Arsenault
44cd439f9a AMDGPU: Prune includes
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@278391 91177308-0d34-0410-b5e6-96231b3b80d8
2016-08-11 19:18:50 +00:00
Krzysztof Parzyszek
50f0fc5733 [Hexagon] Standardize "select" pseudo-instructions
- PS_pselect: general register pairs
- PS_vselect: vector registers (+ 128B version)
- PS_wselect: vector register pairs (+ 128B version)


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@278390 91177308-0d34-0410-b5e6-96231b3b80d8
2016-08-11 19:12:18 +00:00
Ivan Krasin
dcedd3b6ff WholeProgramDevirt: generate more detailed and accurate remarks.
Summary:
Keep track of all methods for which we have devirtualized at least
one call and then print them sorted alphabetically. That allows to
avoid duplicates and also makes the order deterministic.

Add optimization names into the remarks, so that it's easier to
understand how has each method been devirtualized.

Fix a bug when wrong methods could have been reported for
tryVirtualConstProp.

Reviewers: kcc, mehdi_amini

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@278389 91177308-0d34-0410-b5e6-96231b3b80d8
2016-08-11 19:09:02 +00:00
Wei Mi
158f898c51 Remove the restriction that MachineSinking is now stopped by "insert_subreg,
subreg_to_reg, and reg_sequence" instructions.

This is to solve PR28852. The restriction was added at 2010 to make better register
coalescing. We assumed that it was not necessary any more. Testing results on x86
supported the assumption.

We will look closely to any performance impact it will bring and will be prepared
to help analyzing performance problem found on other architectures.

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


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@278384 91177308-0d34-0410-b5e6-96231b3b80d8
2016-08-11 18:42:56 +00:00
Krzysztof Parzyszek
3c99845d54 If-conversion incorrectly calculates liveness of redefined registers
Differential Revision: https://reviews.llvm.org/D23207


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@278383 91177308-0d34-0410-b5e6-96231b3b80d8
2016-08-11 18:42:06 +00:00
Barnabas Bittner
847ddff694 Test commit
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@278380 91177308-0d34-0410-b5e6-96231b3b80d8
2016-08-11 18:34:29 +00:00
Andrew Kaylor
2f5689ff2f Target independent codesize heuristics for Loop Idiom Recognition
Patch by Sunita Marathe

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



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@278378 91177308-0d34-0410-b5e6-96231b3b80d8
2016-08-11 18:28:33 +00:00
Easwaran Raman
2d003b3f5e Add a new method to create SimpleInliner instance and make pre-inliner use this.
This adds a createFunctionInliningPass pass that takes an InlineParams object and use this to create the pre-inliner pass. This prevents the regular inliner's threshold flag from influencing the preinliner.

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


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@278377 91177308-0d34-0410-b5e6-96231b3b80d8
2016-08-11 18:24:08 +00:00
Krzysztof Parzyszek
cf9748d82d [Hexagon] Skip byval arguments when checking parameter attributes
From the point of view of register assignment, byval parameters are
ignored: a byval parameter is not going to be assigned to a register,
and it will not affect the assignments of subsequent parameters.
When matching registers with parameters in the bit tracker, make sure
to skip byval parameters before advancing the registers.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@278375 91177308-0d34-0410-b5e6-96231b3b80d8
2016-08-11 18:15:16 +00:00
Dominic Chen
fbdf373856 Improve virtual register handling when computing debug information
Summary: Some backends, like WebAssembly, use virtual registers instead of physical registers. This crashes the DbgValueHistoryCalculator pass, which assumes that all registers are physical. Instead, skip virtual registers when iterating aliases, and assume that they are clobbered.

Reviewers: dexonsmith, dschuff, aprantl

Subscribers: yurydelendik, llvm-commits, jfb, sunfish

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@278371 91177308-0d34-0410-b5e6-96231b3b80d8
2016-08-11 17:52:40 +00:00
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