Commit Graph

239163 Commits

Author SHA1 Message Date
Tim Northover da6f5f2d0a Remove empty file left by partial reversion.
llvm-svn: 278411
2016-08-11 21:01:15 +00:00
Tim Northover 30e67ce793 GlobalISel: add translation support for shift operations.
llvm-svn: 278410
2016-08-11 21:01:13 +00:00
Tim Northover f1f7bf1279 GlobalISel: support zext & sext during translation phase.
llvm-svn: 278409
2016-08-11 21:01:10 +00:00
Rui Ueyama dd81fe3156 Add comments.
llvm-svn: 278408
2016-08-11 21:00:02 +00:00
Pete Cooper 1ed8f1f6e5 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
2016-08-11 20:59:27 +00:00
Teresa Johnson faa7506f18 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
2016-08-11 20:38:39 +00:00
Pete Cooper 21f475e1c4 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
2016-08-11 20:37:02 +00:00
Daniel Berlin 2698cbb4f1 Move GVNHoist tests into their own directory since it is a separate pass
llvm-svn: 278404
2016-08-11 20:35:07 +00:00
Wei Ding 70cda07526 AMDGPU : Add intrinsic for instruction v_cvt_pk_u8_f32
Differential Revision: http://reviews.llvm.org/D23336

llvm-svn: 278403
2016-08-11 20:34:48 +00:00
Wei Mi 3ab5816000 Revert rL278384 which caused several buildbot failures (like check failures in CodeGen/X86/clz.ll).
llvm-svn: 278402
2016-08-11 20:33:37 +00:00
Daniel Berlin f75fd1b58b 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
2016-08-11 20:32:43 +00:00
Pete Cooper 91db988dfb 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
2016-08-11 20:31:50 +00:00
Pete Cooper 1e885c529d Add missing RUN line from r278398. This test works with this line but i forgot to push it
llvm-svn: 278399
2016-08-11 20:23:15 +00:00
Pete Cooper 732f1ef9de 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
2016-08-11 20:18:05 +00:00
Tim Shen 0fdb2daa8d [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
2016-08-11 20:10:15 +00:00
Pete Cooper 46cd113c87 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
2016-08-11 20:10:14 +00:00
Ed Schouten 610adaeec4 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
2016-08-11 20:03:22 +00:00
Duncan P. N. Exon Smith 38eea4a76f 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
2016-08-11 20:03:09 +00:00
Ed Schouten 9e4da07125 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
2016-08-11 19:23:30 +00:00
Rui Ueyama eefffedc51 Split getArchName. NFC.
llvm-svn: 278392
2016-08-11 19:22:34 +00:00
Matt Arsenault 2ffe8fd2ce AMDGPU: Prune includes
llvm-svn: 278391
2016-08-11 19:18:50 +00:00
Krzysztof Parzyszek 258af19d99 [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
2016-08-11 19:12:18 +00:00
Ivan Krasin f3403fd2c8 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
2016-08-11 19:09:02 +00:00
Marshall Clow 82b16766e6 Remove test for the sign of a NaN - doesn't work on MIPS, not strictly legal. Fixes bug 28936
llvm-svn: 278387
2016-08-11 18:46:24 +00:00
Pete Cooper d9e0f71195 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
2016-08-11 18:46:21 +00:00
Pete Cooper 363e7f6914 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
2016-08-11 18:43:42 +00:00
Wei Mi ec19b35179 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
2016-08-11 18:42:56 +00:00
Krzysztof Parzyszek a003b76391 If-conversion incorrectly calculates liveness of redefined registers
Differential Revision: https://reviews.llvm.org/D23207

llvm-svn: 278383
2016-08-11 18:42:06 +00:00
Devin Coughlin 81cc38cf9a [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
2016-08-11 18:41:29 +00:00
Pete Cooper 932bce6ade 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
2016-08-11 18:41:14 +00:00
Barnabas Bittner 35fef211a0 Test commit
llvm-svn: 278380
2016-08-11 18:34:29 +00:00
Bruno Cardoso Lopes c73e4c3f89 [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
2016-08-11 18:33:15 +00:00
Andrew Kaylor 7cdf01ef58 Target independent codesize heuristics for Loop Idiom Recognition
Patch by Sunita Marathe

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

llvm-svn: 278378
2016-08-11 18:28:33 +00:00
Easwaran Raman 61edc107bb 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
2016-08-11 18:24:08 +00:00
Krzysztof Parzyszek 60f0b51485 [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
2016-08-11 18:15:16 +00:00
Zachary Turner fd34ba53e3 Modify coding conventions to mention include ordering.
llvm-svn: 278373
2016-08-11 18:10:40 +00:00
Pete Cooper c4a12a08e2 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
2016-08-11 18:08:59 +00:00
Dominic Chen 6ba19659cb 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
2016-08-11 17:52:40 +00:00
Michael Kuperstein e36d7716c3 Make TwoAddressInstructionPass::rescheduleMIBelowKill subreg-aware
This fixes PR28824.

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

llvm-svn: 278370
2016-08-11 17:38:33 +00:00
Matt Arsenault 56684d4538 AMDGPU: Fix crashes on memory functions
llvm-svn: 278369
2016-08-11 17:31:42 +00:00
Vedant Kumar 1c23c14808 [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
2016-08-11 17:28:37 +00:00
Vedant Kumar a4fa2e299a [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
2016-08-11 17:28:33 +00:00
Matt Arsenault 76837df6ff AArch64: Assert on analyzeBranch failing
llvm-svn: 278366
2016-08-11 17:22:59 +00:00
Michael Kuperstein ee900b62ef [AliasSetTracker] Delete dead code
Deletes unused remove() and containsPointer() interfaces. NFC.

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

llvm-svn: 278365
2016-08-11 17:20:20 +00:00
Eugene Zelenko cdc7161281 Fix some Clang-tidy modernize and Include What You Use warnings.
Differential revision: https://reviews.llvm.org/D23291

llvm-svn: 278364
2016-08-11 17:20:18 +00:00
Teresa Johnson fe24bff8c6 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
2016-08-11 17:19:53 +00:00
Matt Arsenault 4b5fc093d0 AMDGPU: Remove custom getSubReg
This was kind of confusing, the subregister
class shouldn't really be necessary.

llvm-svn: 278362
2016-08-11 17:15:32 +00:00
Matt Arsenault 69fd2c1179 AMDGPU: Remove unused tracking of flat instructions
llvm-svn: 278361
2016-08-11 17:15:28 +00:00
Wei Ding d3344378c6 AMDGPU : Fix SAD related instruction LIT tests function atttibute issues.
Differential Revision: http://reviews.llvm.org/D23133

llvm-svn: 278360
2016-08-11 17:14:17 +00:00
Simon Atanasyan 2e88174f83 [ELF][MIPS] Add more tests for ELF flags calculation. NFC
llvm-svn: 278359
2016-08-11 17:07:46 +00:00