Commit Graph

77 Commits

Author SHA1 Message Date
James Y Knight c0e6b8ac3a IR: Support parsing numeric block ids, and emit them in textual output.
Just as as llvm IR supports explicitly specifying numeric value ids
for instructions, and emits them by default in textual output, now do
the same for blocks.

This is a slightly incompatible change in the textual IR format.

Previously, llvm would parse numeric labels as string names. E.g.
  define void @f() {
    br label %"55"
  55:
    ret void
  }
defined a label *named* "55", even without needing to be quoted, while
the reference required quoting. Now, if you intend a block label which
looks like a value number to be a name, you must quote it in the
definition too (e.g. `"55":`).

Previously, llvm would print nameless blocks only as a comment, and
would omit it if there was no predecessor. This could cause confusion
for readers of the IR, just as unnamed instructions did prior to the
addition of "%5 = " syntax, back in 2008 (PR2480).

Now, it will always print a label for an unnamed block, with the
exception of the entry block. (IMO it may be better to print it for
the entry-block as well. However, that requires updating many more
tests.)

Thus, the following is supported, and is the canonical printing:
  define i32 @f(i32, i32) {
    %3 = add i32 %0, %1
    br label %4

  4:
    ret i32 %3
  }

New test cases covering this behavior are added, and other tests
updated as required.

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

llvm-svn: 356789
2019-03-22 18:27:13 +00:00
James Y Knight 5d71fc5d7b Adjust documentation for git migration.
This fixes most references to the paths:
 llvm.org/svn/
 llvm.org/git/
 llvm.org/viewvc/
 github.com/llvm-mirror/
 github.com/llvm-project/
 reviews.llvm.org/diffusion/

to instead point to https://github.com/llvm/llvm-project.

This is *not* a trivial substitution, because additionally, all the
checkout instructions had to be migrated to instruct users on how to
use the monorepo layout, setting LLVM_ENABLE_PROJECTS instead of
checking out various projects into various subdirectories.

I've attempted to not change any scripts here, only documentation. The
scripts will have to be addressed separately.

Additionally, I've deleted one document which appeared to be outdated
and unneeded:
  lldb/docs/building-with-debug-llvm.txt

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

llvm-svn: 352514
2019-01-29 16:37:27 +00:00
Chandler Carruth 4a1b95bda0 Fix typos throughout the license files that somehow I and my reviewers
all missed!

Thanks to Alex Bradbury for pointing this out, and the fact that I never
added the intended `legacy` anchor to the developer policy. Add that
anchor too. With hope, this will cause the links to all resolve
successfully.

llvm-svn: 351731
2019-01-21 09:52:34 +00:00
Kristina Brooks e67d23905f [llgo]: fix compilation under current llvm
Patch rL322965 changed how intrinsics for memset and memzero
were defined. This causes a regression in LLGO making it no
longer buidable. In addition to that one pass was renamed,
so this also addresses the pass naming disparity.

I removed all split stack related bits from this patch as
as asked.

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

llvm-svn: 351722
2019-01-21 04:36:43 +00:00
Chandler Carruth 57b08b0944 Update more file headers across all of the LLVM projects in the monorepo
to reflect the new license. These used slightly different spellings that
defeated my regular expressions.

We understand that people may be surprised that we're moving the header
entirely to discuss the new license. We checked this carefully with the
Foundation's lawyer and we believe this is the correct approach.

Essentially, all code in the project is now made available by the LLVM
project under our new license, so you will see that the license headers
include that license only. Some of our contributors have contributed
code under our old license, and accordingly, we have retained a copy of
our old license notice in the top-level files in each project and
repository.

llvm-svn: 351648
2019-01-19 10:56:40 +00:00
Chandler Carruth 2946cd7010 Update the file headers across all of the LLVM projects in the monorepo
to reflect the new license.

We understand that people may be surprised that we're moving the header
entirely to discuss the new license. We checked this carefully with the
Foundation's lawyer and we believe this is the correct approach.

Essentially, all code in the project is now made available by the LLVM
project under our new license, so you will see that the license headers
include that license only. Some of our contributors have contributed
code under our old license, and accordingly, we have retained a copy of
our old license notice in the top-level files in each project and
repository.

llvm-svn: 351636
2019-01-19 08:50:56 +00:00
Chandler Carruth 469bdefd44 Install new LLVM license structure and new developer policy.
This installs the new developer policy and moves all of the license
files across all LLVM projects in the monorepo to the new license
structure. The remaining projects will be moved independently.

Note that I've left odd formatting and other idiosyncracies of the
legacy license structure text alone to make the diff easier to read.
Critically, note that we do not in any case *remove* the old license
notice or terms, as that remains necessary until we finish the
relicensing process.

I've updated a few license files that refer to the LLVM license to
instead simply refer generically to whatever license the LLVM project is
under, basically trying to minimize confusion.

This is really the culmination of so many people. Chris led the
community discussions, drafted the policy update and organized the
multi-year string of meeting between lawyers across the community to
figure out the strategy. Numerous lawyers at companies in the community
spent their time figuring out initial answers, and then the Foundation's
lawyer Heather Meeker has done *so* much to help refine and get us ready
here. I could keep going on, but I just want to make sure everyone
realizes what a huge community effort this has been from the begining.

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

llvm-svn: 351631
2019-01-19 06:14:24 +00:00
Hans Wennborg eb60fbfdb4 Update year in license files
In last year's update (D48219) it was suggested that the release manager
might want to do this, so here we go.

llvm-svn: 351194
2019-01-15 15:10:32 +00:00
Paul Robinson 7555c589af Update copyright year to 2018.
llvm-svn: 334936
2018-06-18 12:22:17 +00:00
Peter Collingbourne 08b4728f51 irgen: Create functions instead of global variables for builtin hash and equal algorithms.
These are in fact functions, and have function type, so it is invalid
to represent them using global variables.

llvm-svn: 304689
2017-06-04 22:11:28 +00:00
Peter Collingbourne eb2d1a782c benchcomp: Add a mode for analyzing file sizes.
llvm-svn: 299376
2017-04-03 19:13:12 +00:00
Meador Inge e6c29d6d85 [llgo] Remove support for LLVM attributes
llgo supports the application of LLVM attributes to global objects
and functions.  This "feature" is undocumented and untested.  As
discusses in D27442, it should be removed.

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

llvm-svn: 288843
2016-12-06 19:22:04 +00:00
Andrew Wilkins 78ac1f1d42 [llgo] set debuglocs for calls in synthetic functions
Synthesized functions do not have valid locations,
and so we were not setting a debug location. Recent
changes to DI require that function call instructions
within a function having DI must have a location set.
We just set the debug location to line=0, col=0.

Reviewers: pcc

Subscribers: llvm-commits

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

llvm-svn: 288772
2016-12-06 05:39:14 +00:00
Meador Inge 21e53508b6 [llgo] Update to use the latest IR attribute bindings
A recent commit (r286087) to the LLVM Go bindings that
changed things over to use the new attribute API broke
llgo.  This commit updates llgo accordingly.

llvm-svn: 288769
2016-12-06 04:01:11 +00:00
Meador Inge 7695d8996f [llgo] Fix `debug` to use latest `DIBuilder` bindings
Two recent commits to the LLVM Go bindings caused breaking changes
to llgo:

  1. r284707 - Moving the `AlignInBits` field from `DIBasicType` to
               `DIAutoVariable`.

  2. r284482 - The `AlignInBits` fields going from `uint64` to `uint32`.

This commit updates llgo accordingly.

llvm-svn: 288768
2016-12-06 04:00:12 +00:00
Andrew Wilkins 5fdb3b89da [llgo] add llgo source path to LLVM_GO_PACKAGES
Summary:
To support the use of LLVM_EXTERNAL_LLGO_SOURCE_DIR,
with llgo situated in a location other than tools/llgo,
we add the llgo source directory to LLVM_GO_PACKAGES.

Reviewers: pcc

Subscribers: llvm-commits

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

llvm-svn: 276828
2016-07-27 03:01:00 +00:00
Benjamin Kramer 56a46bc680 Upgrade all the .arcconfigs to https.
llvm-svn: 275409
2016-07-14 13:15:37 +00:00
Andrew Wilkins bfb1679603 [llgo] llgoi: separate evaluation from printing
Summary:
Separate the evaluation of expressions from printing
of results. This is in preparation for splitting the
core of the interpreter out for use in alternative
interpreter frontends.

At the same time, the output is made less noisy in
response to comments on the golang-nuts announcement.
We would ideally print out values using Go syntax,
but this is impractical until we have libgo based on
Go 1.5. When that happens, fmt's %#v will handle
reflect.Value better, and so we can fix/filter type
names to remove automatically generated package names.

Reviewers: pcc

Subscribers: llvm-commits, axw

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

llvm-svn: 267374
2016-04-25 01:18:20 +00:00
Peter Collingbourne b24f4fb617 benchcomp: Add a mode for analyzing rule execution time in ninja log files.
llvm-svn: 265860
2016-04-08 22:42:22 +00:00
Peter Collingbourne 86e8cc8a9b benchcomp: Look at all sections whose names begin with .text, not just the .text section.
llvm-svn: 265859
2016-04-08 22:42:14 +00:00
Andrew Wilkins b94480376a [llgo] add USES_TERMINAL option to check-libgo
Summary:
The check-libgo target runs "make check" in the
libgo package, which can take a long time on
slower machines. To prevent buildbot failures
due to timeout, we can use Ninja's console pool
for this target.

Reviewers: pcc

Subscribers: llvm-commits

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

llvm-svn: 264815
2016-03-30 00:29:33 +00:00
Andrew Wilkins 0f432aa05a [llgo] Increment "Debug Info Version"
Patch by Michal Cierniak!

This patch increments the "Debug Info Version" from 2 to 3.
This is a nop if you just want to generate binaries. I verified
that with and without this patch, when I run llgo -g on a Go
source file, I get exactly the same binary. The purpose of the
patch is to make it possible to run the llvm-dis tool. Without
the patch, it is impossible to disassemble files generated with
llgo:

  $ llgo -c -g -emit-llvm src/hello.go
  $ llvm-dis hello.o
  llvm-dis: warning: ignoring debug info with an invalid version (2) in hello.o

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

llvm-svn: 264212
2016-03-23 23:09:00 +00:00
Andrew Wilkins 4ff0382453 [cmake] fix libgo-llgo paths in install target
llvm-svn: 264153
2016-03-23 12:39:21 +00:00
Andrew Wilkins 6436a4abd7 [llgo] Roll gofrontend forward
Switch gofrontend to using go.googlesource.com, and
update to 81eb6a3f425b2158c67ee32c0cc973a72ce9d6be.

There are various changes required to update to the
go 1.5 runtime:

typemap.go is changed to accommodate the change in representation for equal/hash algorithms, and the removal of the zero value/type.
CMakeLists.txt is updated to add the build tree to the package search path, so internal packages, which are not installed, are found.
various files changes due to removal of __go_new_nopointers; the same change as in D11863, but with NoUnwindAttribute added to the added runtime functions which are called with "callOnly".
minor cleanups in ssa.go while investigating issues with unwinding/panic handling.

Differential Revisision: http://reviews.llvm.org/D15188

llvm-svn: 263536
2016-03-15 05:36:43 +00:00
Andrew Wilkins b7394b22fd [llgo] Force exporting __morestack from llgoi
Summary:
Force exporting __morestack from llgoi, so that
the symbol is available to the execution engine
when linking with libLLVM.so. The engine does
not reference __morestack explicitly, so must
be provided by the host program.

Reviewers: pcc

Subscribers: axw, llvm-commits

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

llvm-svn: 254188
2015-11-27 04:46:46 +00:00
Peter Collingbourne 8324851a4e debug: Update for debug info API change.
llvm-svn: 252221
2015-11-05 22:04:20 +00:00
Andrew Wilkins f69d45efc3 [llgo] irgen: always use TargetMachine's data layout
Summary:
Another attempt at resolving the runtime assertion
in llgoi due to data layout mismatch between module
and execution engine.

The X86 data layout constant appears to be unnecessary,
and does not match what the execution engine picks.
Using the registered Target, we pick the same data
layout as the execution engine.

While I was in the vicinity, I deleted the last
remnants of PNaCl support.

Reviewers: pcc

Subscribers: jfb, llvm-commits, dschuff

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

llvm-svn: 248565
2015-09-25 06:28:14 +00:00
Andrew Wilkins 3b138079c9 [llgo] drop debug/DIBuilder.Declare
Summary:
Companion to D11864, which updates the
DIBuilder bindings to match a recent
change in the underlying API.

We drop the debug/DIBuilder.Declare method
for now, which is unused, as otherwise it will
be broken with the new DIBuilder API in the
Go bindings.

Reviewers: pcc

Subscribers: llvm-commits

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

llvm-svn: 246545
2015-09-01 11:52:37 +00:00
Tanya Lattner 449fa2f3cb Update to new lists.llvm.org
llvm-svn: 244007
2015-08-05 04:03:05 +00:00
Andrew Wilkins 4a628bb9e1 [llgo] build llgoi by default
Summary:
As llgoi is installed, it must be built or the install
target will fail; there is no implicit dependency.
Adding llgoi to "ALL" makes building llgo as part of an
entire LLVM distribution a bit friendlier: you can then
just do the typical "make && make install".

Reviewers: pcc

Subscribers: llvm-commits

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

llvm-svn: 242750
2015-07-21 00:47:18 +00:00
Andrew Wilkins 7a94f98bea [llgo] cmd/gllgo: handle/ignore more flags
Summary:
This diff is to support Debian packaging,
which sets various hardening-rleated flags
in CFLAGS. They don't make sense for Go,
so we just ignore them.

Reviewers: pcc

Subscribers: llvm-commits, axw

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

llvm-svn: 242513
2015-07-17 08:15:01 +00:00
Andrew Wilkins e5a7b93e1b [llgo] update libgo-llgo.so version to match libtool_VERSION
Summary:
libtool_VERSION was changed in gofrontend a while ago,
but CMakeLists.txt in llgo wasn't updated, and so the
install target fails. Not sure how this went unnoticed
for so long.

Reviewers: pcc

Subscribers: llvm-commits

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

llvm-svn: 242291
2015-07-15 13:17:04 +00:00
Andrew Wilkins fec95af706 [llgo] set function personality with SetPersonality
Summary:
If a function requires a landing pad, set the personality function.

Requires D11116.

Reviewers: pcc

Subscribers: llvm-commits

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

llvm-svn: 242290
2015-07-15 13:05:35 +00:00
Andrew Wilkins 4ffbbd7da7 [llgo] cmd/llgoi: use line editor
Summary:
This diff adds line-editing to llgoi, by
vendoring and using github.com/peterh/liner.
I have only implemented the basics here;
follow-ups will come later to add persisted
history, and completion,

Reviewers: pcc

Reviewed By: pcc

Subscribers: axw, llvm-commits

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

llvm-svn: 238100
2015-05-23 15:16:09 +00:00
Peter Collingbourne dd90dc8aa9 benchcomp: Add macho_symsizes mode for comparing Mach-O object symbol sizes.
llvm-svn: 237199
2015-05-12 22:14:26 +00:00
Andrew Wilkins 11e66bb7df [llgo] add buildbot-slave config
Summary:
This patch adds the configuration used to deploy
the llgo-builder buildbot slave. The builder is
deployed to Google Compute Engine using Juju.

Reviewers: pcc

Reviewed By: pcc

Subscribers: llvm-commits

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

llvm-svn: 234383
2015-04-08 01:41:46 +00:00
Peter Collingbourne 76beae321a Add documentation for llgoi, update README
llvm-svn: 234137
2015-04-05 23:32:13 +00:00
Peter Collingbourne d35a6aff92 Roll gofrontend to 15a24202fa42.
Takes us to Go 1.4.2 plus a number of bug fixes.

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

llvm-svn: 234136
2015-04-05 23:32:10 +00:00
Peter Collingbourne cac325993a Roll gofrontend to 07baa07598ea; roll libffi to r219477.
Incorporates https://codereview.appspot.com/198770044, which causes us to start
using the static chain register for closures instead of __go_{get,set}_closure.

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

llvm-svn: 234135
2015-04-05 23:31:49 +00:00
Peter Collingbourne 93c73ebcbd Roll gofrontend to a6e10414311a
This takes us to Go 1.4. Also includes a couple of changes to the test
suite, both in the runtime package:

- Disable TestSetPanicOnFault. We cannot support this scenario at all,
  due to LLVM's lack of non-call exceptions.

- Tweak TestFinalizerType. This test only passes with two GC runs.

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

llvm-svn: 234134
2015-04-05 23:30:42 +00:00
Peter Collingbourne 7d39641c80 Roll gotools to d4e70101.
Most importantly, this gives us https://go-review.googlesource.com/7533 which
fixes a bug in go/ssa that caused test failures in the Go 1.4 standard library.

Also remove the go1.4 tag workaround. We no longer need it now that we
ship llgo-go.

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

llvm-svn: 234133
2015-04-05 23:28:18 +00:00
Peter Collingbourne 38a7dde1c5 llgoi: Fix type identity for imported binary packages.
go/loader creates a fresh package map for each source package it imports. In
llgoi this caused binary imported packages to be imported anew for every input
line, resulting in spurious type errors and panics in go/ssa when encountering
previously imported types. Fix this by setting types.Config.Packages to our
internal package map.

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

llvm-svn: 232617
2015-03-18 08:34:40 +00:00
Peter Collingbourne 4b1ba6f09f Add llgo-go to installation.
llvm-svn: 232614
2015-03-18 07:35:17 +00:00
Peter Collingbourne 6092d2c065 llgoi: Fix importing source packages together with dependent binary packages.
Note that this means that llgoi does not support the case
where a package's pkgpath is different from its import path,
but I don't think this should actually happen with llgoi.

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

llvm-svn: 232612
2015-03-18 06:04:22 +00:00
Peter Collingbourne 3a6ee8f25c Add cgo dependency to llgo-stage2 and llgoi.
llvm-svn: 232564
2015-03-17 23:17:38 +00:00
Andrew Wilkins 984bc5298b [llgo] update year in LICENSE.txt
llvm-svn: 232133
2015-03-13 01:36:02 +00:00
Andrew Wilkins d07b2b4228 [llgo] Disable known failing packages in check-libgo
Summary:
There are two packages in libgo which have
known failures when running the "make check" rule.
This change disables those packages in the tests so
that we can run libgo tests without them until the
root causes are identified and resolved.

Test Plan: ran check-libgo rule

Reviewers: pcc

Reviewed By: pcc

Subscribers: llvm-commits

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

llvm-svn: 231448
2015-03-06 02:49:07 +00:00
Peter Collingbourne 68a640c080 Fix test to use explicit load type.
llvm-svn: 231417
2015-03-05 22:55:42 +00:00
Andrew Wilkins ac15169034 [llgo] debug: create replaceable type through DIBuilder
Summary:
llgo was asserting in DebugInfo, which was interpreting
the temporary MDNodes we were creating as DIScopes instead
of DITypes (in DIScope::getRef).

This proposal changes llgo to use DIBuilder's
createReplaceableCompositeType method to create a DIType
that can be RAUW'd.

Reviewers: pcc

Reviewed By: pcc

Subscribers: llvm-commits

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

llvm-svn: 230953
2015-03-02 12:42:45 +00:00
Peter Collingbourne 7ddf832e0e Build cgo and llgo-go
Differential Revision: http://reviews.llvm.org/D7629

llvm-svn: 229211
2015-02-14 01:46:01 +00:00