platform/upstream/llvm.git
8 years agoDon't import variadic functions
Piotr Padlewski [Thu, 11 Aug 2016 22:13:57 +0000 (22:13 +0000)]
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

llvm-svn: 278432

8 years agoX86-FMA3: Implemented commute transformation for EVEX/AVX512 FMA3 opcodes.
Vyacheslav Klochkov [Thu, 11 Aug 2016 22:07:33 +0000 (22:07 +0000)]
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

llvm-svn: 278431

8 years agoMake class hierarchy more shallow.
Rui Ueyama [Thu, 11 Aug 2016 22:06:55 +0000 (22:06 +0000)]
Make class hierarchy more shallow.

LayoutInputSection is a dummy class and does not need any features
that the actual implementation (InputSection class) provides.

llvm-svn: 278430

8 years agoRe-commit r278066: Do not ignore SizeOfOptionalHeader in COFF header even if PE heade...
Rui Ueyama [Thu, 11 Aug 2016 22:02:44 +0000 (22:02 +0000)]
Re-commit r278066: Do not ignore SizeOfOptionalHeader in COFF header even if PE header is not present.

llvm-svn: 278429

8 years agoGlobalISel: support 'null' constant in translation.
Tim Northover [Thu, 11 Aug 2016 21:40:55 +0000 (21:40 +0000)]
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.

llvm-svn: 278423

8 years agoExtend trip count instead of truncating IV in LFTR, when legal
Ehsan Amiri [Thu, 11 Aug 2016 21:31:40 +0000 (21:31 +0000)]
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

llvm-svn: 278421

8 years agoRemove trailing whitespace.
Rui Ueyama [Thu, 11 Aug 2016 21:30:42 +0000 (21:30 +0000)]
Remove trailing whitespace.

llvm-svn: 278420

8 years agoDead strip DESC bits should only be set on object files.
Pete Cooper [Thu, 11 Aug 2016 21:27:18 +0000 (21:27 +0000)]
Dead strip DESC bits should only be set on object files.

It only makes sense to set on N_NO_DEAD_STRIP on a relocatable object file.  Otherwise the bits aren't useful for anything.  Matches the ld64 behaviour.

llvm-svn: 278419

8 years ago[MSSA] Use is_contained
Daniel Berlin [Thu, 11 Aug 2016 21:26:50 +0000 (21:26 +0000)]
[MSSA] Use is_contained

llvm-svn: 278418

8 years agoUse range algorithms instead of unpacking begin/end
David Majnemer [Thu, 11 Aug 2016 21:15:00 +0000 (21:15 +0000)]
Use range algorithms instead of unpacking begin/end

No functionality change is intended.

llvm-svn: 278417

8 years ago[Hexagon] Allow non-returning calls in hardware loops
Krzysztof Parzyszek [Thu, 11 Aug 2016 21:14:25 +0000 (21:14 +0000)]
[Hexagon] Allow non-returning calls in hardware loops

llvm-svn: 278416

8 years ago[vim] Add more attributes to llvm.vim
David Majnemer [Thu, 11 Aug 2016 21:14:05 +0000 (21:14 +0000)]
[vim] Add more attributes to llvm.vim

llvm-svn: 278415

8 years agoAMDGPU: Remove unused tablegen utilities
Matt Arsenault [Thu, 11 Aug 2016 21:08:43 +0000 (21:08 +0000)]
AMDGPU: Remove unused tablegen utilities

llvm-svn: 278414

8 years ago[SCEV] Update interface to handle SCEVExpander insert point motion.
Geoff Berry [Thu, 11 Aug 2016 21:05:17 +0000 (21:05 +0000)]
[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

llvm-svn: 278413

8 years agoAdd obj2yaml to the list of tool_patterns in lit. NFC
Pete Cooper [Thu, 11 Aug 2016 21:03:56 +0000 (21:03 +0000)]
Add obj2yaml to the list of tool_patterns in lit.  NFC

llvm-svn: 278412

8 years agoRemove empty file left by partial reversion.
Tim Northover [Thu, 11 Aug 2016 21:01:15 +0000 (21:01 +0000)]
Remove empty file left by partial reversion.

llvm-svn: 278411

8 years agoGlobalISel: add translation support for shift operations.
Tim Northover [Thu, 11 Aug 2016 21:01:13 +0000 (21:01 +0000)]
GlobalISel: add translation support for shift operations.

llvm-svn: 278410

8 years agoGlobalISel: support zext & sext during translation phase.
Tim Northover [Thu, 11 Aug 2016 21:01:10 +0000 (21:01 +0000)]
GlobalISel: support zext & sext during translation phase.

llvm-svn: 278409

8 years agoAdd comments.
Rui Ueyama [Thu, 11 Aug 2016 21:00:02 +0000 (21:00 +0000)]
Add comments.

llvm-svn: 278408

8 years agoBetter compress lazy binding info to match ld64.
Pete Cooper [Thu, 11 Aug 2016 20:59:27 +0000 (20:59 +0000)]
Better compress lazy binding info to match ld64.

We should be using one of BIND_OPCODE_SET_DYLIB_SPECIAL_IMM, BIND_OPCODE_SET_DYLIB_ORDINAL_IMM,
and BIND_OPCODE_SET_DYLIB_ORDINAL_ULEB depending on whether ordinals are <= 0, <= 15, > 15.

This matches the behaviour of ld64.

llvm-svn: 278407

8 years agoFix type truncation warnings
Teresa Johnson [Thu, 11 Aug 2016 20:38:39 +0000 (20:38 +0000)]
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

llvm-svn: 278406

8 years agoGenerate slightly more compressed binding opcodes when entries are the same as last...
Pete Cooper [Thu, 11 Aug 2016 20:37:02 +0000 (20:37 +0000)]
Generate slightly more compressed binding opcodes when entries are the same as last time.

We already had logic for binding opcodes had the same addend as last time.  This adds
the cases where the ordinal, symbol name, type, and segment offsets are the same as
the last emitted ordinal.

This gets us one step closer to emitting rebase opcodes as compressed as ld64 can manage.

llvm-svn: 278405

8 years agoMove GVNHoist tests into their own directory since it is a separate pass
Daniel Berlin [Thu, 11 Aug 2016 20:35:07 +0000 (20:35 +0000)]
Move GVNHoist tests into their own directory since it is a separate pass

llvm-svn: 278404

8 years agoAMDGPU : Add intrinsic for instruction v_cvt_pk_u8_f32
Wei Ding [Thu, 11 Aug 2016 20:34:48 +0000 (20:34 +0000)]
AMDGPU : Add intrinsic for instruction v_cvt_pk_u8_f32

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

llvm-svn: 278403

8 years agoRevert rL278384 which caused several buildbot failures (like check failures in CodeGe...
Wei Mi [Thu, 11 Aug 2016 20:33:37 +0000 (20:33 +0000)]
Revert rL278384 which caused several buildbot failures (like check failures in CodeGen/X86/clz.ll).

llvm-svn: 278402

8 years agoFix PR 28933
Daniel Berlin [Thu, 11 Aug 2016 20:32:43 +0000 (20:32 +0000)]
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

llvm-svn: 278401

8 years agoAdd test for rebase opcodes. We didn't have one. NFC.
Pete Cooper [Thu, 11 Aug 2016 20:31:50 +0000 (20:31 +0000)]
Add test for rebase opcodes.  We didn't have one.  NFC.

This will be used to test upcoming changes to improve binding opcode
emission to match the more compressed form ld64 can generate.

llvm-svn: 278400

8 years agoAdd missing RUN line from r278398. This test works with this line but i forgot to...
Pete Cooper [Thu, 11 Aug 2016 20:23:15 +0000 (20:23 +0000)]
Add missing RUN line from r278398.  This test works with this line but i forgot to push it

llvm-svn: 278399

8 years agoArm64 stubs alignment is 2, not 4.
Pete Cooper [Thu, 11 Aug 2016 20:18:05 +0000 (20:18 +0000)]
Arm64 stubs alignment is 2, not 4.

This matches the behaviour of ld64 when looking at the alignment of the stubs section in the final image.

llvm-svn: 278398

8 years ago[ADT] Add relation operators for Optional
Tim Shen [Thu, 11 Aug 2016 20:10:15 +0000 (20:10 +0000)]
[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

llvm-svn: 278397

8 years agoChange when we choose to add an LC_LOAD_DYLIB to the final image.
Pete Cooper [Thu, 11 Aug 2016 20:10:14 +0000 (20:10 +0000)]
Change when we choose to add an LC_LOAD_DYLIB to the final image.

Currently we do this when an atom is used, but we need to do it when a
dylib is referenced on the cmdline as this matches ld64.

This fixes much confusion over which maps are indexed with installName
vs path.  There is likely other confusion so i'll be seeing if i can remove
path() completely in a future commit as path() shouldn't really be needed by anyone.

llvm-svn: 278396

8 years agoDon't enable PIE on i686-unknown-cloudabi.
Ed Schouten [Thu, 11 Aug 2016 20:03:22 +0000 (20:03 +0000)]
Don't enable PIE on i686-unknown-cloudabi.

We're only going to provide support for using PIE on architectures that
provide PC-relative addressing. i686 is not one of those, so add the
necessary bits for only passing in -pie -zrelro conditionally.

llvm-svn: 278395

8 years agoCodeGen: Avoid dereferencing end() in MachineScheduler
Duncan P. N. Exon Smith [Thu, 11 Aug 2016 20:03:09 +0000 (20:03 +0000)]
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.

llvm-svn: 278394

8 years agoPass in frame pointer omitting compiler flags for CloudABI as well.
Ed Schouten [Thu, 11 Aug 2016 19:23:30 +0000 (19:23 +0000)]
Pass in frame pointer omitting compiler flags for CloudABI as well.

On Linux we pass in -fomit-frame-pointer flags (and similar)
automatically if optimization is enabled. Let's do the same thing on
CloudABI. Without this, Clang seems to run out of registers quite
quickly while trying to build code with inline assembly.

llvm-svn: 278393

8 years agoSplit getArchName. NFC.
Rui Ueyama [Thu, 11 Aug 2016 19:22:34 +0000 (19:22 +0000)]
Split getArchName. NFC.

llvm-svn: 278392

8 years agoAMDGPU: Prune includes
Matt Arsenault [Thu, 11 Aug 2016 19:18:50 +0000 (19:18 +0000)]
AMDGPU: Prune includes

llvm-svn: 278391

8 years ago[Hexagon] Standardize "select" pseudo-instructions
Krzysztof Parzyszek [Thu, 11 Aug 2016 19:12:18 +0000 (19:12 +0000)]
[Hexagon] Standardize "select" pseudo-instructions

- PS_pselect: general register pairs
- PS_vselect: vector registers (+ 128B version)
- PS_wselect: vector register pairs (+ 128B version)

llvm-svn: 278390

8 years agoWholeProgramDevirt: generate more detailed and accurate remarks.
Ivan Krasin [Thu, 11 Aug 2016 19:09:02 +0000 (19:09 +0000)]
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

llvm-svn: 278389

8 years agoRemove test for the sign of a NaN - doesn't work on MIPS, not strictly legal. Fixes...
Marshall Clow [Thu, 11 Aug 2016 18:46:24 +0000 (18:46 +0000)]
Remove test for the sign of a NaN - doesn't work on MIPS, not strictly legal. Fixes bug 28936

llvm-svn: 278387

8 years agoChange all the libSystem test files to be dylibs instead of normalized files. Curren...
Pete Cooper [Thu, 11 Aug 2016 18:46:21 +0000 (18:46 +0000)]
Change all the libSystem test files to be dylibs instead of normalized files.  Currently NFC.

A future commit will change when we choose to add an LC_LOAD_DYLIB to the final image.  Currently
we do this when an atom is used, but we need to do it when a dylib is referenced on the cmdline as
this matches ld64.

To allow this change, libsystem (and other future yaml files representing dylibs) need to be dylibs
so that the loader can see to add them to the referenced dylib list.

llvm-svn: 278386

8 years agoFix one more test missed by r278372. The next commit will update libsystem in a...
Pete Cooper [Thu, 11 Aug 2016 18:43:42 +0000 (18:43 +0000)]
Fix one more test missed by r278372.  The next commit will update libsystem in a way which broke without this fix as it referenced the wrong file

llvm-svn: 278385

8 years agoRemove the restriction that MachineSinking is now stopped by "insert_subreg,
Wei Mi [Thu, 11 Aug 2016 18:42:56 +0000 (18:42 +0000)]
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

llvm-svn: 278384

8 years agoIf-conversion incorrectly calculates liveness of redefined registers
Krzysztof Parzyszek [Thu, 11 Aug 2016 18:42:06 +0000 (18:42 +0000)]
If-conversion incorrectly calculates liveness of redefined registers

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

llvm-svn: 278383

8 years ago[analyzer] Teach RetainCountChecker about CVFooRetain
Devin Coughlin [Thu, 11 Aug 2016 18:41:29 +0000 (18:41 +0000)]
[analyzer] Teach RetainCountChecker about CVFooRetain

Change the retain count checker to treat CoreFoundation-style "CV"-prefixed
reference types from CoreVideo similarly to CoreGraphics types. With this
change, we treat CVFooRetain() on a CVFooRef type as a retain. CVFooRelease()
APIs are annotated as consuming their parameter, so this change prevents false
positives about incorrect decrements of reference counts.

<rdar://problem/27116090>

llvm-svn: 278382

8 years agoFix off-by-one error in default currentVersion.
Pete Cooper [Thu, 11 Aug 2016 18:41:14 +0000 (18:41 +0000)]
Fix off-by-one error in default currentVersion.

A version of 0x1000 is 0.16.0, not 1.0.0 as the comment said.  Fix the
value to match the comment, and also the one test case which had this
wrong.

llvm-svn: 278381

8 years agoTest commit
Barnabas Bittner [Thu, 11 Aug 2016 18:34:29 +0000 (18:34 +0000)]
Test commit

llvm-svn: 278380

8 years ago[Sema] Add more strict check for sizeof diagnostics for bzero
Bruno Cardoso Lopes [Thu, 11 Aug 2016 18:33:15 +0000 (18:33 +0000)]
[Sema] Add more strict check for sizeof diagnostics for bzero

Follow-up from r278264 after Joerg's feedback.

Since bzero is not standard, be more strict: also check if the first
argument is a pointer, which harden the check for when it does not come
originally from a builtin.

llvm-svn: 278379

8 years agoTarget independent codesize heuristics for Loop Idiom Recognition
Andrew Kaylor [Thu, 11 Aug 2016 18:28:33 +0000 (18:28 +0000)]
Target independent codesize heuristics for Loop Idiom Recognition

Patch by Sunita Marathe

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

llvm-svn: 278378

8 years agoAdd a new method to create SimpleInliner instance and make pre-inliner use this.
Easwaran Raman [Thu, 11 Aug 2016 18:24:08 +0000 (18:24 +0000)]
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

llvm-svn: 278377

8 years ago[Hexagon] Skip byval arguments when checking parameter attributes
Krzysztof Parzyszek [Thu, 11 Aug 2016 18:15:16 +0000 (18:15 +0000)]
[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.

llvm-svn: 278375

8 years agoModify coding conventions to mention include ordering.
Zachary Turner [Thu, 11 Aug 2016 18:10:40 +0000 (18:10 +0000)]
Modify coding conventions to mention include ordering.

llvm-svn: 278373

8 years agoHave one version of libSystem for each arch. NFC.
Pete Cooper [Thu, 11 Aug 2016 18:08:59 +0000 (18:08 +0000)]
Have one version of libSystem for each arch.  NFC.

An upcoming commit will change how we choose to reference a dylib.  Currently
dylibs are only given an LC_LOAD_DYLIB in the final image if an atom is used.
This is different from ld64 which adds the load command when the dylib is referenced
on the cmdline.

In order to change this behaviour, we need libSystem.yaml to actually contain a mach header
so that it is parsed as a dylib, instead of currently being parsed as a normalised file.

To get a mach header, we also require an arch, so now we have one libsystem per arch and
all the tests have been updated to choose the correct one.

llvm-svn: 278372

8 years agoImprove virtual register handling when computing debug information
Dominic Chen [Thu, 11 Aug 2016 17:52:40 +0000 (17:52 +0000)]
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

llvm-svn: 278371

8 years agoMake TwoAddressInstructionPass::rescheduleMIBelowKill subreg-aware
Michael Kuperstein [Thu, 11 Aug 2016 17:38:33 +0000 (17:38 +0000)]
Make TwoAddressInstructionPass::rescheduleMIBelowKill subreg-aware

This fixes PR28824.

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

llvm-svn: 278370

8 years agoAMDGPU: Fix crashes on memory functions
Matt Arsenault [Thu, 11 Aug 2016 17:31:42 +0000 (17:31 +0000)]
AMDGPU: Fix crashes on memory functions

llvm-svn: 278369

8 years ago[InstrumentationRuntime] Refactor the API (Part 2/N) (NFCI)
Vedant Kumar [Thu, 11 Aug 2016 17:28:37 +0000 (17:28 +0000)]
[InstrumentationRuntime] Refactor the API (Part 2/N) (NFCI)

Factor out some common logic used to find the runtime library in a list
of modules.

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

llvm-svn: 278368

8 years ago[InstrumentationRuntime] Refactor the API (Part 1/N) (NFCI)
Vedant Kumar [Thu, 11 Aug 2016 17:28:33 +0000 (17:28 +0000)]
[InstrumentationRuntime] Refactor the API (Part 1/N) (NFCI)

Adapters for instrumentation runtimes have to do two basic things:

  1) Load a runtime library.
  2) Install breakpoints in that library.

This logic is duplicated in the adapters for asan and tsan. Factor it
out and document bits of it to make it easier to add new adapters.

I tested this with check-lldb, and double-checked
testcases/functionalities/{a,t}san.

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

llvm-svn: 278367

8 years agoAArch64: Assert on analyzeBranch failing
Matt Arsenault [Thu, 11 Aug 2016 17:22:59 +0000 (17:22 +0000)]
AArch64: Assert on analyzeBranch failing

llvm-svn: 278366

8 years ago[AliasSetTracker] Delete dead code
Michael Kuperstein [Thu, 11 Aug 2016 17:20:20 +0000 (17:20 +0000)]
[AliasSetTracker] Delete dead code

Deletes unused remove() and containsPointer() interfaces. NFC.

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

llvm-svn: 278365

8 years agoFix some Clang-tidy modernize and Include What You Use warnings.
Eugene Zelenko [Thu, 11 Aug 2016 17:20:18 +0000 (17:20 +0000)]
Fix some Clang-tidy modernize and Include What You Use warnings.

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

llvm-svn: 278364

8 years agoAdd move ops to satisfy MSVC.
Teresa Johnson [Thu, 11 Aug 2016 17:19:53 +0000 (17:19 +0000)]
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

llvm-svn: 278363

8 years agoAMDGPU: Remove custom getSubReg
Matt Arsenault [Thu, 11 Aug 2016 17:15:32 +0000 (17:15 +0000)]
AMDGPU: Remove custom getSubReg

This was kind of confusing, the subregister
class shouldn't really be necessary.

llvm-svn: 278362

8 years agoAMDGPU: Remove unused tracking of flat instructions
Matt Arsenault [Thu, 11 Aug 2016 17:15:28 +0000 (17:15 +0000)]
AMDGPU: Remove unused tracking of flat instructions

llvm-svn: 278361

8 years agoAMDGPU : Fix SAD related instruction LIT tests function atttibute issues.
Wei Ding [Thu, 11 Aug 2016 17:14:17 +0000 (17:14 +0000)]
AMDGPU : Fix SAD related instruction LIT tests function atttibute issues.

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

llvm-svn: 278360

8 years ago[ELF][MIPS] Add more tests for ELF flags calculation. NFC
Simon Atanasyan [Thu, 11 Aug 2016 17:07:46 +0000 (17:07 +0000)]
[ELF][MIPS] Add more tests for ELF flags calculation. NFC

llvm-svn: 278359

8 years ago[ELF][MIPS] Separate different tests by empty lines. NFC
Simon Atanasyan [Thu, 11 Aug 2016 17:07:43 +0000 (17:07 +0000)]
[ELF][MIPS] Separate different tests by empty lines. NFC

llvm-svn: 278358

8 years agotest: relax the FS test a slight bit to be more reliable
Saleem Abdulrasool [Thu, 11 Aug 2016 16:58:12 +0000 (16:58 +0000)]
test: relax the FS test a slight bit to be more reliable

Some filesystems track atime always.  This relaxes the test to accept either a
filesystem which does not accurately track atime or does track the atime
accurately.  This allows the test to pass on filesystems mounted with
`strictatime` on Linux or on macOS.

llvm-svn: 278357

8 years agoAdd 'inline' attribute to __init to inline the basic_string's constructor
Sebastian Pop [Thu, 11 Aug 2016 16:51:48 +0000 (16:51 +0000)]
Add 'inline' attribute to __init to inline the basic_string's constructor

basic_string's constructor calls init which was not getting inlined.  This
prevented optimization of const string as init would appear as a call in between
a string's def and use.

Patch by Laxman Sole and Aditya Kumar.

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

llvm-svn: 278356

8 years agoHexagon: Avoid dereferencing end() in HexagonCopyToCombine::findPairable
Duncan P. N. Exon Smith [Thu, 11 Aug 2016 16:40:03 +0000 (16:40 +0000)]
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.

llvm-svn: 278355

8 years agoAMDGPU : Add LLVM intrinsics for SAD related instructions.
Wei Ding [Thu, 11 Aug 2016 16:33:53 +0000 (16:33 +0000)]
AMDGPU : Add LLVM intrinsics for SAD related instructions.

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

llvm-svn: 278354

8 years agoAdd (hopefully last) remaining missing dependences to llvm-lto2
Teresa Johnson [Thu, 11 Aug 2016 16:29:47 +0000 (16:29 +0000)]
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.

llvm-svn: 278353

8 years ago[ELF][MIPS] Recognize and print machine name in case of input incompatibility
Simon Atanasyan [Thu, 11 Aug 2016 16:25:17 +0000 (16:25 +0000)]
[ELF][MIPS] Recognize and print machine name in case of input incompatibility

llvm-svn: 278352

8 years agoGlobalISel: clear vreg mapping after translating each function
Tim Northover [Thu, 11 Aug 2016 16:21:29 +0000 (16:21 +0000)]
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.

llvm-svn: 278351

8 years agoRemove FIXME about asserting on the end iterator
Reid Kleckner [Thu, 11 Aug 2016 16:00:43 +0000 (16:00 +0000)]
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.

llvm-svn: 278350

8 years agoMore missing llvm-lto2 dependencies
Teresa Johnson [Thu, 11 Aug 2016 15:58:49 +0000 (15:58 +0000)]
More missing llvm-lto2 dependencies

Follow-on to r278341: Update CMakeLists.txt to match LLVMBuild.txt

llvm-svn: 278349

8 years ago[MCJIT] Improve documentation and error handling for MCJIT::runFunction.
Lang Hames [Thu, 11 Aug 2016 15:56:23 +0000 (15:56 +0000)]
[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.

llvm-svn: 278348

8 years agoX86: Use operator lookup for operator==, NFC
Duncan P. N. Exon Smith [Thu, 11 Aug 2016 15:51:29 +0000 (15:51 +0000)]
X86: Use operator lookup for operator==, NFC

Avoid relying on the MachineInstrBundleIterator operator== being
implemented as a member function.

llvm-svn: 278347

8 years agoIR: Don't cast the end iterator to Instruction*
Duncan P. N. Exon Smith [Thu, 11 Aug 2016 15:45:04 +0000 (15:45 +0000)]
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.

llvm-svn: 278346

8 years agoFix unit tests on windows
Pavel Labath [Thu, 11 Aug 2016 15:31:30 +0000 (15:31 +0000)]
Fix unit tests on windows

Python headers need to be included before PosixApi.h

llvm-svn: 278345

8 years agoCodeGen: Check for a terminator in llvm::getFuncletMembership
Duncan P. N. Exon Smith [Thu, 11 Aug 2016 15:29:02 +0000 (15:29 +0000)]
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.

llvm-svn: 278344

8 years ago[SLP] Make RecursionMaxDepth a command line option (NFC)
Matthew Simpson [Thu, 11 Aug 2016 15:28:45 +0000 (15:28 +0000)]
[SLP] Make RecursionMaxDepth a command line option (NFC)

llvm-svn: 278343

8 years agofix comment; NFC
Sanjay Patel [Thu, 11 Aug 2016 15:23:56 +0000 (15:23 +0000)]
fix comment; NFC

llvm-svn: 278342

8 years agoFix bot failure from r278338 due to missing dependences
Teresa Johnson [Thu, 11 Aug 2016 15:23:05 +0000 (15:23 +0000)]
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

llvm-svn: 278341

8 years agouse auto* with dyn_cast ; NFC
Sanjay Patel [Thu, 11 Aug 2016 15:21:21 +0000 (15:21 +0000)]
use auto* with dyn_cast ; NFC

llvm-svn: 278340

8 years agogetParent()->getParent() == getFunction() ; NFC
Sanjay Patel [Thu, 11 Aug 2016 15:16:06 +0000 (15:16 +0000)]
getParent()->getParent() == getFunction() ; NFC

llvm-svn: 278339

8 years agoRestore "Resolution-based LTO API."
Teresa Johnson [Thu, 11 Aug 2016 14:58:12 +0000 (14:58 +0000)]
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

llvm-svn: 278338

8 years agorevert 278334
Ehsan Amiri [Thu, 11 Aug 2016 14:51:14 +0000 (14:51 +0000)]
revert 278334

llvm-svn: 278337

8 years agoRevert "[AMDGPU] fix failure on printing of non-existing instruction operands."
Valery Pykhtin [Thu, 11 Aug 2016 14:22:05 +0000 (14:22 +0000)]
Revert "[AMDGPU] fix failure on printing of non-existing instruction operands."

This reverts revision 278333, newly added test failed.

llvm-svn: 278336

8 years agoMake sure files include what they use (part 2/2)
Pavel Labath [Thu, 11 Aug 2016 14:12:10 +0000 (14:12 +0000)]
Make sure files include what they use (part 2/2)

This makes lldb still compile on linux after a project-wide clang-format

llvm-svn: 278335

8 years agoExtend trip count instead of truncating IV in LFTR, when legal
Ehsan Amiri [Thu, 11 Aug 2016 13:51:20 +0000 (13:51 +0000)]
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

llvm-svn: 278334

8 years ago[AMDGPU] fix failure on printing of non-existing instruction operands.
Valery Pykhtin [Thu, 11 Aug 2016 13:49:46 +0000 (13:49 +0000)]
[AMDGPU] fix failure on printing of non-existing instruction operands.

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

llvm-svn: 278333

8 years agoFixes for hierarchical barrier (possible hang if team size changed).
Andrey Churbanov [Thu, 11 Aug 2016 13:04:00 +0000 (13:04 +0000)]
Fixes for hierarchical barrier (possible hang if team size changed).

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

llvm-svn: 278332

8 years agoRevert "Resolution-based LTO API."
Teresa Johnson [Thu, 11 Aug 2016 13:03:56 +0000 (13:03 +0000)]
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.

llvm-svn: 278331

8 years agoResolution-based LTO API.
Teresa Johnson [Thu, 11 Aug 2016 12:56:40 +0000 (12:56 +0000)]
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

llvm-svn: 278330

8 years agoFixed VS2015 (Update 3) warning - differing const/volatile qualifiers for overridden...
Simon Pilgrim [Thu, 11 Aug 2016 12:19:43 +0000 (12:19 +0000)]
Fixed VS2015 (Update 3) warning - differing const/volatile qualifiers for overridden function

Dropped the const qualifier to match llvm::CallLowering::lowerCall

llvm-svn: 278329

8 years ago[AVX512] Fix extractelement i1 lowering.
Igor Breger [Thu, 11 Aug 2016 12:13:46 +0000 (12:13 +0000)]
[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

llvm-svn: 278328

8 years ago[Core] Retire addReplacement() member function.
Davide Italiano [Thu, 11 Aug 2016 10:50:01 +0000 (10:50 +0000)]
[Core] Retire addReplacement() member function.

llvm-svn: 278327

8 years agoMake sure LldbGdbServerTestCase is built in arm mode to avoid failures due thumb...
Omair Javaid [Thu, 11 Aug 2016 10:35:05 +0000 (10:35 +0000)]
Make sure LldbGdbServerTestCase is built in arm mode to avoid failures due thumb instructions

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

llvm-svn: 278326

8 years agoRemove a double send of eRunPacketSent event
Pavel Labath [Thu, 11 Aug 2016 09:22:22 +0000 (09:22 +0000)]
Remove a double send of eRunPacketSent event

I accidentaly added the send both to the base class and the derived class in my refactor. Fix
that.

llvm-svn: 278325

8 years ago[clang-tidy] fix readability-else-after-return test
Kirill Bobyrev [Thu, 11 Aug 2016 08:18:39 +0000 (08:18 +0000)]
[clang-tidy] fix readability-else-after-return test

As pointed by Yung Douglas, exceptions in
test/clang-tidy/readability-else-after-return.cpp are causing PS4 bots to be
red, because exceptions aren't enabled by default on PS4 target. This patch is a
fix.

llvm-svn: 278324