2009-01-02 15:01:27 +08:00
|
|
|
//===- LLToken.h - Token Codes for LLVM Assembly Files ----------*- C++ -*-===//
|
|
|
|
//
|
2019-01-19 16:50:56 +08:00
|
|
|
// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
|
|
|
|
// See https://llvm.org/LICENSE.txt for license information.
|
|
|
|
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
|
2009-01-02 15:01:27 +08:00
|
|
|
//
|
|
|
|
//===----------------------------------------------------------------------===//
|
|
|
|
//
|
|
|
|
// This file defines the enums for the .ll lexer.
|
|
|
|
//
|
|
|
|
//===----------------------------------------------------------------------===//
|
|
|
|
|
2014-08-14 00:26:38 +08:00
|
|
|
#ifndef LLVM_LIB_ASMPARSER_LLTOKEN_H
|
|
|
|
#define LLVM_LIB_ASMPARSER_LLTOKEN_H
|
2009-01-02 15:01:27 +08:00
|
|
|
|
|
|
|
namespace llvm {
|
|
|
|
namespace lltok {
|
2016-05-11 20:07:32 +08:00
|
|
|
enum Kind {
|
|
|
|
// Markers
|
|
|
|
Eof,
|
|
|
|
Error,
|
|
|
|
|
|
|
|
// Tokens with no info.
|
|
|
|
dotdotdot, // ...
|
|
|
|
equal,
|
|
|
|
comma, // = ,
|
|
|
|
star, // *
|
|
|
|
lsquare,
|
|
|
|
rsquare, // [ ]
|
|
|
|
lbrace,
|
|
|
|
rbrace, // { }
|
|
|
|
less,
|
|
|
|
greater, // < >
|
|
|
|
lparen,
|
|
|
|
rparen, // ( )
|
|
|
|
exclaim, // !
|
|
|
|
bar, // |
|
2018-06-26 21:56:49 +08:00
|
|
|
colon, // :
|
2016-05-11 20:07:32 +08:00
|
|
|
|
2019-07-05 20:48:16 +08:00
|
|
|
kw_vscale,
|
2016-05-11 20:07:32 +08:00
|
|
|
kw_x,
|
|
|
|
kw_true,
|
|
|
|
kw_false,
|
|
|
|
kw_declare,
|
|
|
|
kw_define,
|
|
|
|
kw_global,
|
|
|
|
kw_constant,
|
|
|
|
|
2017-10-26 23:00:26 +08:00
|
|
|
kw_dso_local,
|
|
|
|
kw_dso_preemptable,
|
|
|
|
|
2016-05-11 20:07:32 +08:00
|
|
|
kw_private,
|
|
|
|
kw_internal,
|
|
|
|
kw_linkonce,
|
|
|
|
kw_linkonce_odr,
|
|
|
|
kw_weak, // Used as a linkage, and a modifier for "cmpxchg".
|
|
|
|
kw_weak_odr,
|
|
|
|
kw_appending,
|
|
|
|
kw_dllimport,
|
|
|
|
kw_dllexport,
|
|
|
|
kw_common,
|
|
|
|
kw_available_externally,
|
|
|
|
kw_default,
|
|
|
|
kw_hidden,
|
|
|
|
kw_protected,
|
|
|
|
kw_unnamed_addr,
|
2016-06-15 05:01:22 +08:00
|
|
|
kw_local_unnamed_addr,
|
2016-05-11 20:07:32 +08:00
|
|
|
kw_externally_initialized,
|
|
|
|
kw_extern_weak,
|
|
|
|
kw_external,
|
|
|
|
kw_thread_local,
|
|
|
|
kw_localdynamic,
|
|
|
|
kw_initialexec,
|
|
|
|
kw_localexec,
|
|
|
|
kw_zeroinitializer,
|
|
|
|
kw_undef,
|
2020-11-25 05:55:24 +08:00
|
|
|
kw_poison,
|
2016-05-11 20:07:32 +08:00
|
|
|
kw_null,
|
|
|
|
kw_none,
|
|
|
|
kw_to,
|
|
|
|
kw_caller,
|
|
|
|
kw_within,
|
|
|
|
kw_from,
|
|
|
|
kw_tail,
|
|
|
|
kw_musttail,
|
|
|
|
kw_notail,
|
|
|
|
kw_target,
|
|
|
|
kw_triple,
|
|
|
|
kw_source_filename,
|
|
|
|
kw_unwind,
|
|
|
|
kw_deplibs, // FIXME: Remove in 4.0
|
|
|
|
kw_datalayout,
|
|
|
|
kw_volatile,
|
|
|
|
kw_atomic,
|
|
|
|
kw_unordered,
|
|
|
|
kw_monotonic,
|
|
|
|
kw_acquire,
|
|
|
|
kw_release,
|
|
|
|
kw_acq_rel,
|
|
|
|
kw_seq_cst,
|
2017-07-12 06:23:00 +08:00
|
|
|
kw_syncscope,
|
2016-05-11 20:07:32 +08:00
|
|
|
kw_nnan,
|
|
|
|
kw_ninf,
|
|
|
|
kw_nsz,
|
|
|
|
kw_arcp,
|
2017-03-29 04:11:52 +08:00
|
|
|
kw_contract,
|
[IR] redefine 'UnsafeAlgebra' / 'reassoc' fast-math-flags and add 'trans' fast-math-flag
As discussed on llvm-dev:
http://lists.llvm.org/pipermail/llvm-dev/2016-November/107104.html
and again more recently:
http://lists.llvm.org/pipermail/llvm-dev/2017-October/118118.html
...this is a step in cleaning up our fast-math-flags implementation in IR to better match
the capabilities of both clang's user-visible flags and the backend's flags for SDNode.
As proposed in the above threads, we're replacing the 'UnsafeAlgebra' bit (which had the
'umbrella' meaning that all flags are set) with a new bit that only applies to algebraic
reassociation - 'AllowReassoc'.
We're also adding a bit to allow approximations for library functions called 'ApproxFunc'
(this was initially proposed as 'libm' or similar).
...and we're out of bits. 7 bits ought to be enough for anyone, right? :) FWIW, I did
look at getting this out of SubclassOptionalData via SubclassData (spacious 16-bits),
but that's apparently already used for other purposes. Also, I don't think we can just
add a field to FPMathOperator because Operator is not intended to be instantiated.
We'll defer movement of FMF to another day.
We keep the 'fast' keyword. I thought about removing that, but seeing IR like this:
%f.fast = fadd reassoc nnan ninf nsz arcp contract afn float %op1, %op2
...made me think we want to keep the shortcut synonym.
Finally, this change is binary incompatible with existing IR as seen in the
compatibility tests. This statement:
"Newer releases can ignore features from older releases, but they cannot miscompile
them. For example, if nsw is ever replaced with something else, dropping it would be
a valid way to upgrade the IR."
( http://llvm.org/docs/DeveloperPolicy.html#ir-backwards-compatibility )
...provides the flexibility we want to make this change without requiring a new IR
version. Ie, we're not loosening the FP strictness of existing IR. At worst, we will
fail to optimize some previously 'fast' code because it's no longer recognized as
'fast'. This should get fixed as we audit/squash all of the uses of 'isFast()'.
Note: an inter-dependent clang commit to use the new API name should closely follow
commit.
Differential Revision: https://reviews.llvm.org/D39304
llvm-svn: 317488
2017-11-07 00:27:15 +08:00
|
|
|
kw_reassoc,
|
|
|
|
kw_afn,
|
2016-05-11 20:07:32 +08:00
|
|
|
kw_fast,
|
|
|
|
kw_nuw,
|
|
|
|
kw_nsw,
|
|
|
|
kw_exact,
|
|
|
|
kw_inbounds,
|
2016-11-11 06:34:55 +08:00
|
|
|
kw_inrange,
|
2016-05-11 20:07:32 +08:00
|
|
|
kw_align,
|
|
|
|
kw_addrspace,
|
|
|
|
kw_section,
|
2019-05-29 11:29:01 +08:00
|
|
|
kw_partition,
|
2016-05-11 20:07:32 +08:00
|
|
|
kw_alias,
|
|
|
|
kw_ifunc,
|
|
|
|
kw_module,
|
|
|
|
kw_asm,
|
|
|
|
kw_sideeffect,
|
|
|
|
kw_alignstack,
|
|
|
|
kw_inteldialect,
|
|
|
|
kw_gc,
|
|
|
|
kw_prefix,
|
|
|
|
kw_prologue,
|
|
|
|
kw_c,
|
|
|
|
|
|
|
|
kw_cc,
|
|
|
|
kw_ccc,
|
|
|
|
kw_fastcc,
|
|
|
|
kw_coldcc,
|
|
|
|
kw_intel_ocl_bicc,
|
Add Windows Control Flow Guard checks (/guard:cf).
Summary:
A new function pass (Transforms/CFGuard/CFGuard.cpp) inserts CFGuard checks on
indirect function calls, using either the check mechanism (X86, ARM, AArch64) or
or the dispatch mechanism (X86-64). The check mechanism requires a new calling
convention for the supported targets. The dispatch mechanism adds the target as
an operand bundle, which is processed by SelectionDAG. Another pass
(CodeGen/CFGuardLongjmp.cpp) identifies and emits valid longjmp targets, as
required by /guard:cf. This feature is enabled using the `cfguard` CC1 option.
Reviewers: thakis, rnk, theraven, pcc
Subscribers: ychen, hans, metalcanine, dmajor, tomrittervg, alex, mehdi_amini, mgorny, javed.absar, kristof.beyls, hiraditya, steven_wu, dexonsmith, cfe-commits, llvm-commits
Tags: #clang, #llvm
Differential Revision: https://reviews.llvm.org/D65761
2019-10-28 21:22:19 +08:00
|
|
|
kw_cfguard_checkcc,
|
2016-05-11 20:07:32 +08:00
|
|
|
kw_x86_stdcallcc,
|
|
|
|
kw_x86_fastcallcc,
|
|
|
|
kw_x86_thiscallcc,
|
|
|
|
kw_x86_vectorcallcc,
|
2016-10-13 15:53:43 +08:00
|
|
|
kw_x86_regcallcc,
|
2016-05-11 20:07:32 +08:00
|
|
|
kw_arm_apcscc,
|
|
|
|
kw_arm_aapcscc,
|
|
|
|
kw_arm_aapcs_vfpcc,
|
2018-09-12 16:54:06 +08:00
|
|
|
kw_aarch64_vector_pcs,
|
2019-11-06 00:54:54 +08:00
|
|
|
kw_aarch64_sve_vector_pcs,
|
2016-05-11 20:07:32 +08:00
|
|
|
kw_msp430_intrcc,
|
|
|
|
kw_avr_intrcc,
|
|
|
|
kw_avr_signalcc,
|
|
|
|
kw_ptx_kernel,
|
|
|
|
kw_ptx_device,
|
|
|
|
kw_spir_kernel,
|
|
|
|
kw_spir_func,
|
|
|
|
kw_x86_64_sysvcc,
|
2017-07-18 04:05:19 +08:00
|
|
|
kw_win64cc,
|
2016-05-11 20:07:32 +08:00
|
|
|
kw_webkit_jscc,
|
|
|
|
kw_anyregcc,
|
|
|
|
kw_swiftcc,
|
|
|
|
kw_preserve_mostcc,
|
|
|
|
kw_preserve_allcc,
|
|
|
|
kw_ghccc,
|
|
|
|
kw_x86_intrcc,
|
|
|
|
kw_hhvmcc,
|
|
|
|
kw_hhvm_ccc,
|
|
|
|
kw_cxx_fast_tlscc,
|
|
|
|
kw_amdgpu_vs,
|
2017-09-29 17:51:22 +08:00
|
|
|
kw_amdgpu_ls,
|
2017-05-02 23:41:10 +08:00
|
|
|
kw_amdgpu_hs,
|
2017-09-29 17:51:22 +08:00
|
|
|
kw_amdgpu_es,
|
2016-05-11 20:07:32 +08:00
|
|
|
kw_amdgpu_gs,
|
|
|
|
kw_amdgpu_ps,
|
|
|
|
kw_amdgpu_cs,
|
|
|
|
kw_amdgpu_kernel,
|
2020-09-16 20:38:54 +08:00
|
|
|
kw_amdgpu_gfx,
|
2019-10-08 06:28:58 +08:00
|
|
|
kw_tailcc,
|
2016-05-11 20:07:32 +08:00
|
|
|
|
|
|
|
// Attributes:
|
|
|
|
kw_attributes,
|
|
|
|
kw_allocsize,
|
|
|
|
kw_alwaysinline,
|
|
|
|
kw_argmemonly,
|
|
|
|
kw_sanitize_address,
|
2017-12-09 08:21:41 +08:00
|
|
|
kw_sanitize_hwaddress,
|
ARM MTE stack sanitizer.
Add "memtag" sanitizer that detects and mitigates stack memory issues
using armv8.5 Memory Tagging Extension.
It is similar in principle to HWASan, which is a software implementation
of the same idea, but there are enough differencies to warrant a new
sanitizer type IMHO. It is also expected to have very different
performance properties.
The new sanitizer does not have a runtime library (it may grow one
later, along with a "debugging" mode). Similar to SafeStack and
StackProtector, the instrumentation pass (in a follow up change) will be
inserted in all cases, but will only affect functions marked with the
new sanitize_memtag attribute.
Reviewers: pcc, hctim, vitalybuka, ostannard
Subscribers: srhines, mehdi_amini, javed.absar, kristof.beyls, hiraditya, cryptoad, steven_wu, dexonsmith, cfe-commits, llvm-commits
Tags: #clang, #llvm
Differential Revision: https://reviews.llvm.org/D64169
llvm-svn: 366123
2019-07-16 04:02:23 +08:00
|
|
|
kw_sanitize_memtag,
|
2016-05-11 20:07:32 +08:00
|
|
|
kw_builtin,
|
|
|
|
kw_byval,
|
|
|
|
kw_inalloca,
|
|
|
|
kw_cold,
|
|
|
|
kw_convergent,
|
|
|
|
kw_dereferenceable,
|
|
|
|
kw_dereferenceable_or_null,
|
|
|
|
kw_inaccessiblememonly,
|
|
|
|
kw_inaccessiblemem_or_argmemonly,
|
|
|
|
kw_inlinehint,
|
|
|
|
kw_inreg,
|
|
|
|
kw_jumptable,
|
|
|
|
kw_minsize,
|
|
|
|
kw_naked,
|
|
|
|
kw_nest,
|
|
|
|
kw_noalias,
|
2020-07-09 01:22:48 +08:00
|
|
|
kw_noundef,
|
2016-05-11 20:07:32 +08:00
|
|
|
kw_nobuiltin,
|
2020-12-15 05:56:11 +08:00
|
|
|
kw_nocallback,
|
2016-05-11 20:07:32 +08:00
|
|
|
kw_nocapture,
|
|
|
|
kw_noduplicate,
|
2019-07-08 23:57:56 +08:00
|
|
|
kw_nofree,
|
2016-05-11 20:07:32 +08:00
|
|
|
kw_noimplicitfloat,
|
|
|
|
kw_noinline,
|
|
|
|
kw_norecurse,
|
|
|
|
kw_nonlazybind,
|
2020-05-13 05:07:50 +08:00
|
|
|
kw_nomerge,
|
2016-05-11 20:07:32 +08:00
|
|
|
kw_nonnull,
|
2021-01-15 17:14:37 +08:00
|
|
|
kw_noprofile,
|
2016-05-11 20:07:32 +08:00
|
|
|
kw_noredzone,
|
|
|
|
kw_noreturn,
|
[Attributor] Deduce "nosync" function attribute.
Introduce and deduce "nosync" function attribute to indicate that a function
does not synchronize with another thread in a way that other thread might free memory.
Reviewers: jdoerfert, jfb, nhaehnle, arsenm
Subscribers: wdng, hfinkel, nhaenhle, mehdi_amini, steven_wu,
dexonsmith, arsenm, uenoku, hiraditya, jfb, llvm-commits
Differential Revision: https://reviews.llvm.org/D62766
llvm-svn: 365830
2019-07-12 05:37:40 +08:00
|
|
|
kw_nosync,
|
2018-03-17 21:29:46 +08:00
|
|
|
kw_nocf_check,
|
2016-05-11 20:07:32 +08:00
|
|
|
kw_nounwind,
|
2020-04-25 18:57:07 +08:00
|
|
|
kw_null_pointer_is_valid,
|
[SimplifyCFG] Create attribute for fuzzing-specific optimizations.
Summary:
When building with libFuzzer, converting control flow to selects or
obscuring the original operands of CMPs reduces the effectiveness of
libFuzzer's heuristics.
This patch provides an attribute to disable or modify certain optimizations
for optimal fuzzing signal.
Provides a less aggressive alternative to https://reviews.llvm.org/D44057.
Reviewers: vitalybuka, davide, arsenm, hfinkel
Reviewed By: vitalybuka
Subscribers: junbuml, mehdi_amini, wdng, javed.absar, hiraditya, llvm-commits, kcc
Differential Revision: https://reviews.llvm.org/D44232
llvm-svn: 328214
2018-03-23 01:07:51 +08:00
|
|
|
kw_optforfuzzing,
|
2016-05-11 20:07:32 +08:00
|
|
|
kw_optnone,
|
|
|
|
kw_optsize,
|
2020-02-15 06:16:53 +08:00
|
|
|
kw_preallocated,
|
2016-05-11 20:07:32 +08:00
|
|
|
kw_readnone,
|
|
|
|
kw_readonly,
|
|
|
|
kw_returned,
|
|
|
|
kw_returns_twice,
|
|
|
|
kw_signext,
|
2017-04-29 04:25:27 +08:00
|
|
|
kw_speculatable,
|
2016-05-11 20:07:32 +08:00
|
|
|
kw_ssp,
|
|
|
|
kw_sspreq,
|
|
|
|
kw_sspstrong,
|
|
|
|
kw_safestack,
|
2018-04-04 04:10:40 +08:00
|
|
|
kw_shadowcallstack,
|
2016-05-11 20:07:32 +08:00
|
|
|
kw_sret,
|
|
|
|
kw_sanitize_thread,
|
|
|
|
kw_sanitize_memory,
|
2018-09-04 20:38:00 +08:00
|
|
|
kw_speculative_load_hardening,
|
2017-08-15 05:15:13 +08:00
|
|
|
kw_strictfp,
|
2016-05-11 20:07:32 +08:00
|
|
|
kw_swifterror,
|
|
|
|
kw_swiftself,
|
|
|
|
kw_uwtable,
|
2021-03-03 21:53:30 +08:00
|
|
|
kw_vscale_range,
|
2019-06-27 23:51:40 +08:00
|
|
|
kw_willreturn,
|
2016-07-04 16:01:29 +08:00
|
|
|
kw_writeonly,
|
2016-05-11 20:07:32 +08:00
|
|
|
kw_zeroext,
|
2019-03-13 05:02:54 +08:00
|
|
|
kw_immarg,
|
IR: Define byref parameter attribute
This allows tracking the in-memory type of a pointer argument to a
function for ABI purposes. This is essentially a stripped down version
of byval to remove some of the stack-copy implications in its
definition.
This includes the base IR changes, and some tests for places where it
should be treated similarly to byval. Codegen support will be in a
future patch.
My original attempt at solving some of these problems was to repurpose
byval with a different address space from the stack. However, it is
technically permitted for the callee to introduce a write to the
argument, although nothing does this in reality. There is also talk of
removing and replacing the byval attribute, so a new attribute would
need to take its place anyway.
This is intended avoid some optimization issues with the current
handling of aggregate arguments, as well as fixes inflexibilty in how
frontends can specify the kernel ABI. The most honest representation
of the amdgpu_kernel convention is to expose all kernel arguments as
loads from constant memory. Today, these are raw, SSA Argument values
and codegen is responsible for turning these into loads.
Background:
There currently isn't a satisfactory way to represent how arguments
for the amdgpu_kernel calling convention are passed. In reality,
arguments are passed in a single, flat, constant memory buffer
implicitly passed to the function. It is also illegal to call this
function in the IR, and this is only ever invoked by a driver of some
kind.
It does not make sense to have a stack passed parameter in this
context as is implied by byval. It is never valid to write to the
kernel arguments, as this would corrupt the inputs seen by other
dispatches of the kernel. These argumets are also not in the same
address space as the stack, so a copy is needed to an alloca. From a
source C-like language, the kernel parameters are invisible.
Semantically, a copy is always required from the constant argument
memory to a mutable variable.
The current clang calling convention lowering emits raw values,
including aggregates into the function argument list, since using
byval would not make sense. This has some unfortunate consequences for
the optimizer. In the aggregate case, we end up with an aggregate
store to alloca, which both SROA and instcombine turn into a store of
each aggregate field. The optimizer never pieces this back together to
see that this is really just a copy from constant memory, so we end up
stuck with expensive stack usage.
This also means the backend dictates the alignment of arguments, and
arbitrarily picks the LLVM IR ABI type alignment. By allowing an
explicit alignment, frontends can make better decisions. For example,
there's real no advantage to an aligment higher than 4, so a frontend
could choose to compact the argument layout. Similarly, there is a
high penalty to using an alignment lower than 4, so a frontend could
opt into more padding for small arguments.
Another design consideration is when it is appropriate to expose the
fact that these arguments are all really passed in adjacent
memory. Currently we have a late IR optimization pass in codegen to
rewrite the kernel argument values into explicit loads to enable
vectorization. In most programs, unrelated argument loads can be
merged together. However, exposing this property directly from the
frontend has some disadvantages. We still need a way to track the
original argument sizes and alignments to report to the driver. I find
using some side-channel, metadata mechanism to track this
unappealing. If the kernel arguments were exposed as a single buffer
to begin with, alias analysis would be unaware that the padding bits
betewen arguments are meaningless. Another family of problems is there
are still some gaps in replacing all of the available parameter
attributes with metadata equivalents once lowered to loads.
The immediate plan is to start using this new attribute to handle all
aggregate argumets for kernels. Long term, it makes sense to migrate
all kernel arguments, including scalars, to be passed indirectly in
the same manner.
Additional context is in D79744.
2020-06-06 04:58:47 +08:00
|
|
|
kw_byref,
|
2020-10-20 14:48:18 +08:00
|
|
|
kw_mustprogress,
|
2016-05-11 20:07:32 +08:00
|
|
|
|
|
|
|
kw_type,
|
|
|
|
kw_opaque,
|
|
|
|
|
|
|
|
kw_comdat,
|
|
|
|
|
|
|
|
// Comdat types
|
|
|
|
kw_any,
|
|
|
|
kw_exactmatch,
|
|
|
|
kw_largest,
|
|
|
|
kw_noduplicates,
|
|
|
|
kw_samesize,
|
|
|
|
|
|
|
|
kw_eq,
|
|
|
|
kw_ne,
|
|
|
|
kw_slt,
|
|
|
|
kw_sgt,
|
|
|
|
kw_sle,
|
|
|
|
kw_sge,
|
|
|
|
kw_ult,
|
|
|
|
kw_ugt,
|
|
|
|
kw_ule,
|
|
|
|
kw_uge,
|
|
|
|
kw_oeq,
|
|
|
|
kw_one,
|
|
|
|
kw_olt,
|
|
|
|
kw_ogt,
|
|
|
|
kw_ole,
|
|
|
|
kw_oge,
|
|
|
|
kw_ord,
|
|
|
|
kw_uno,
|
|
|
|
kw_ueq,
|
|
|
|
kw_une,
|
|
|
|
|
|
|
|
// atomicrmw operations that aren't also instruction keywords.
|
|
|
|
kw_xchg,
|
|
|
|
kw_nand,
|
|
|
|
kw_max,
|
|
|
|
kw_min,
|
|
|
|
kw_umax,
|
|
|
|
kw_umin,
|
|
|
|
|
|
|
|
// Instruction Opcodes (Opcode in UIntVal).
|
2018-11-14 02:15:47 +08:00
|
|
|
kw_fneg,
|
2016-05-11 20:07:32 +08:00
|
|
|
kw_add,
|
|
|
|
kw_fadd,
|
|
|
|
kw_sub,
|
|
|
|
kw_fsub,
|
|
|
|
kw_mul,
|
|
|
|
kw_fmul,
|
|
|
|
kw_udiv,
|
|
|
|
kw_sdiv,
|
|
|
|
kw_fdiv,
|
|
|
|
kw_urem,
|
|
|
|
kw_srem,
|
|
|
|
kw_frem,
|
|
|
|
kw_shl,
|
|
|
|
kw_lshr,
|
|
|
|
kw_ashr,
|
|
|
|
kw_and,
|
|
|
|
kw_or,
|
|
|
|
kw_xor,
|
|
|
|
kw_icmp,
|
|
|
|
kw_fcmp,
|
|
|
|
|
|
|
|
kw_phi,
|
|
|
|
kw_call,
|
|
|
|
kw_trunc,
|
|
|
|
kw_zext,
|
|
|
|
kw_sext,
|
|
|
|
kw_fptrunc,
|
|
|
|
kw_fpext,
|
|
|
|
kw_uitofp,
|
|
|
|
kw_sitofp,
|
|
|
|
kw_fptoui,
|
|
|
|
kw_fptosi,
|
|
|
|
kw_inttoptr,
|
|
|
|
kw_ptrtoint,
|
|
|
|
kw_bitcast,
|
|
|
|
kw_addrspacecast,
|
|
|
|
kw_select,
|
|
|
|
kw_va_arg,
|
|
|
|
|
|
|
|
kw_landingpad,
|
|
|
|
kw_personality,
|
|
|
|
kw_cleanup,
|
|
|
|
kw_catch,
|
|
|
|
kw_filter,
|
|
|
|
|
|
|
|
kw_ret,
|
|
|
|
kw_br,
|
|
|
|
kw_switch,
|
|
|
|
kw_indirectbr,
|
|
|
|
kw_invoke,
|
|
|
|
kw_resume,
|
|
|
|
kw_unreachable,
|
|
|
|
kw_cleanupret,
|
|
|
|
kw_catchswitch,
|
|
|
|
kw_catchret,
|
|
|
|
kw_catchpad,
|
|
|
|
kw_cleanuppad,
|
2019-02-09 04:48:56 +08:00
|
|
|
kw_callbr,
|
2016-05-11 20:07:32 +08:00
|
|
|
|
|
|
|
kw_alloca,
|
|
|
|
kw_load,
|
|
|
|
kw_store,
|
|
|
|
kw_fence,
|
|
|
|
kw_cmpxchg,
|
|
|
|
kw_atomicrmw,
|
|
|
|
kw_getelementptr,
|
|
|
|
|
|
|
|
kw_extractelement,
|
|
|
|
kw_insertelement,
|
|
|
|
kw_shufflevector,
|
|
|
|
kw_extractvalue,
|
|
|
|
kw_insertvalue,
|
|
|
|
kw_blockaddress,
|
2020-04-02 06:25:04 +08:00
|
|
|
kw_dso_local_equivalent,
|
2016-05-11 20:07:32 +08:00
|
|
|
|
[IR] Redefine Freeze instruction
Summary:
This patch redefines freeze instruction from being UnaryOperator to a subclass of UnaryInstruction.
ConstantExpr freeze is removed, as discussed in the previous review.
FreezeOperator is not added because there's no ConstantExpr freeze.
`freeze i8* null` test is added to `test/Bindings/llvm-c/freeze.ll` as well, because the null pointer-related bug in `tools/llvm-c/echo.cpp` is now fixed.
InstVisitor has visitFreeze now because freeze is not unaryop anymore.
Reviewers: whitequark, deadalnix, craig.topper, jdoerfert, lebedev.ri
Reviewed By: craig.topper, lebedev.ri
Subscribers: regehr, nlopes, mehdi_amini, hiraditya, steven_wu, dexonsmith, jfb, llvm-commits
Tags: #llvm
Differential Revision: https://reviews.llvm.org/D69932
2019-11-07 00:17:49 +08:00
|
|
|
kw_freeze,
|
|
|
|
|
2016-05-11 20:07:32 +08:00
|
|
|
// Metadata types.
|
|
|
|
kw_distinct,
|
|
|
|
|
|
|
|
// Use-list order directives.
|
|
|
|
kw_uselistorder,
|
|
|
|
kw_uselistorder_bb,
|
|
|
|
|
2018-06-26 21:56:49 +08:00
|
|
|
// Summary index keywords
|
|
|
|
kw_path,
|
|
|
|
kw_hash,
|
|
|
|
kw_gv,
|
|
|
|
kw_guid,
|
|
|
|
kw_name,
|
|
|
|
kw_summaries,
|
|
|
|
kw_flags,
|
2020-05-22 04:28:24 +08:00
|
|
|
kw_blockcount,
|
2018-06-26 21:56:49 +08:00
|
|
|
kw_linkage,
|
2021-01-28 02:43:51 +08:00
|
|
|
kw_visibility,
|
2018-06-26 21:56:49 +08:00
|
|
|
kw_notEligibleToImport,
|
|
|
|
kw_live,
|
|
|
|
kw_dsoLocal,
|
[ThinLTO] Auto-hide prevailing linkonce_odr only when all copies eligible
Summary:
We hit undefined references building with ThinLTO when one source file
contained explicit instantiations of a template method (weak_odr) but
there were also implicit instantiations in another file (linkonce_odr),
and the latter was the prevailing copy. In this case the symbol was
marked hidden when the prevailing linkonce_odr copy was promoted to
weak_odr. It led to unsats when the resulting shared library was linked
with other code that contained a reference (expecting to be resolved due
to the explicit instantiation).
Add a CanAutoHide flag to the GV summary to allow the thin link to
identify when all copies are eligible for auto-hiding (because they were
all originally linkonce_odr global unnamed addr), and only do the
auto-hide in that case.
Most of the changes here are due to plumbing the new flag through the
bitcode and llvm assembly, and resulting test changes. I augmented the
existing auto-hide test to check for this situation.
Reviewers: pcc
Subscribers: mehdi_amini, inglorion, eraman, dexonsmith, arphaman, dang, llvm-commits, steven_wu, wmi
Tags: #llvm
Differential Revision: https://reviews.llvm.org/D59709
llvm-svn: 360466
2019-05-11 04:08:24 +08:00
|
|
|
kw_canAutoHide,
|
2018-06-26 21:56:49 +08:00
|
|
|
kw_function,
|
|
|
|
kw_insts,
|
|
|
|
kw_funcFlags,
|
|
|
|
kw_readNone,
|
|
|
|
kw_readOnly,
|
|
|
|
kw_noRecurse,
|
|
|
|
kw_returnDoesNotAlias,
|
2018-11-07 03:41:35 +08:00
|
|
|
kw_noInline,
|
2019-11-09 07:50:55 +08:00
|
|
|
kw_alwaysInline,
|
2018-06-26 21:56:49 +08:00
|
|
|
kw_calls,
|
|
|
|
kw_callee,
|
2020-06-01 14:49:57 +08:00
|
|
|
kw_params,
|
|
|
|
kw_param,
|
2018-06-26 21:56:49 +08:00
|
|
|
kw_hotness,
|
|
|
|
kw_unknown,
|
|
|
|
kw_hot,
|
|
|
|
kw_critical,
|
|
|
|
kw_relbf,
|
|
|
|
kw_variable,
|
[ThinLTO] Add summary entries for index-based WPD
Summary:
If LTOUnit splitting is disabled, the module summary analysis computes
the summary information necessary to perform single implementation
devirtualization during the thin link with the index and no IR. The
information collected from the regular LTO IR in the current hybrid WPD
algorithm is summarized, including:
1) For vtable definitions, record the function pointers and their offset
within the vtable initializer (subsumes the information collected from
IR by tryFindVirtualCallTargets).
2) A record for each type metadata summarizing the vtable definitions
decorated with that metadata (subsumes the TypeIdentiferMap collected
from IR).
Also added are the necessary bitcode records, and the corresponding
assembly support.
The follow-on index-based WPD patch is D55153.
Depends on D53890.
Reviewers: pcc
Subscribers: mehdi_amini, Prazek, inglorion, eraman, steven_wu, dexonsmith, arphaman, llvm-commits
Differential Revision: https://reviews.llvm.org/D54815
llvm-svn: 364960
2019-07-03 03:38:02 +08:00
|
|
|
kw_vTableFuncs,
|
|
|
|
kw_virtFunc,
|
2018-06-26 21:56:49 +08:00
|
|
|
kw_aliasee,
|
|
|
|
kw_refs,
|
|
|
|
kw_typeIdInfo,
|
|
|
|
kw_typeTests,
|
|
|
|
kw_typeTestAssumeVCalls,
|
|
|
|
kw_typeCheckedLoadVCalls,
|
|
|
|
kw_typeTestAssumeConstVCalls,
|
|
|
|
kw_typeCheckedLoadConstVCalls,
|
|
|
|
kw_vFuncId,
|
|
|
|
kw_offset,
|
|
|
|
kw_args,
|
|
|
|
kw_typeid,
|
[ThinLTO] Add summary entries for index-based WPD
Summary:
If LTOUnit splitting is disabled, the module summary analysis computes
the summary information necessary to perform single implementation
devirtualization during the thin link with the index and no IR. The
information collected from the regular LTO IR in the current hybrid WPD
algorithm is summarized, including:
1) For vtable definitions, record the function pointers and their offset
within the vtable initializer (subsumes the information collected from
IR by tryFindVirtualCallTargets).
2) A record for each type metadata summarizing the vtable definitions
decorated with that metadata (subsumes the TypeIdentiferMap collected
from IR).
Also added are the necessary bitcode records, and the corresponding
assembly support.
The follow-on index-based WPD patch is D55153.
Depends on D53890.
Reviewers: pcc
Subscribers: mehdi_amini, Prazek, inglorion, eraman, steven_wu, dexonsmith, arphaman, llvm-commits
Differential Revision: https://reviews.llvm.org/D54815
llvm-svn: 364960
2019-07-03 03:38:02 +08:00
|
|
|
kw_typeidCompatibleVTable,
|
2018-06-26 21:56:49 +08:00
|
|
|
kw_summary,
|
|
|
|
kw_typeTestRes,
|
|
|
|
kw_kind,
|
|
|
|
kw_unsat,
|
|
|
|
kw_byteArray,
|
|
|
|
kw_inline,
|
|
|
|
kw_single,
|
|
|
|
kw_allOnes,
|
|
|
|
kw_sizeM1BitWidth,
|
|
|
|
kw_alignLog2,
|
|
|
|
kw_sizeM1,
|
|
|
|
kw_bitMask,
|
|
|
|
kw_inlineBits,
|
[ThinLTO] Summarize vcall_visibility metadata
Summary:
Second patch in series to support Safe Whole Program Devirtualization
Enablement, see RFC here:
http://lists.llvm.org/pipermail/llvm-dev/2019-December/137543.html
Summarize vcall_visibility metadata in ThinLTO global variable summary.
Depends on D71907.
Reviewers: pcc, evgeny777, steven_wu
Subscribers: mehdi_amini, Prazek, inglorion, hiraditya, dexonsmith, arphaman, ostannard, llvm-commits, cfe-commits, davidxl
Tags: #clang, #llvm
Differential Revision: https://reviews.llvm.org/D71911
2019-12-27 01:31:43 +08:00
|
|
|
kw_vcall_visibility,
|
2018-06-26 21:56:49 +08:00
|
|
|
kw_wpdResolutions,
|
|
|
|
kw_wpdRes,
|
|
|
|
kw_indir,
|
|
|
|
kw_singleImpl,
|
|
|
|
kw_branchFunnel,
|
|
|
|
kw_singleImplName,
|
|
|
|
kw_resByArg,
|
|
|
|
kw_byArg,
|
|
|
|
kw_uniformRetVal,
|
|
|
|
kw_uniqueRetVal,
|
|
|
|
kw_virtualConstProp,
|
|
|
|
kw_info,
|
|
|
|
kw_byte,
|
|
|
|
kw_bit,
|
2018-11-23 18:54:51 +08:00
|
|
|
kw_varFlags,
|
2018-06-26 21:56:49 +08:00
|
|
|
|
2016-05-11 20:07:32 +08:00
|
|
|
// Unsigned Valued tokens (UIntVal).
|
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-23 02:27:13 +08:00
|
|
|
LabelID, // 42:
|
2016-05-11 20:07:32 +08:00
|
|
|
GlobalID, // @42
|
|
|
|
LocalVarID, // %42
|
|
|
|
AttrGrpID, // #42
|
2018-05-26 10:34:13 +08:00
|
|
|
SummaryID, // ^42
|
2016-05-11 20:07:32 +08:00
|
|
|
|
|
|
|
// String valued tokens (StrVal).
|
|
|
|
LabelStr, // foo:
|
|
|
|
GlobalVar, // @foo @"foo"
|
|
|
|
ComdatVar, // $foo
|
|
|
|
LocalVar, // %foo %"foo"
|
|
|
|
MetadataVar, // !foo
|
|
|
|
StringConstant, // "foo"
|
|
|
|
DwarfTag, // DW_TAG_foo
|
|
|
|
DwarfAttEncoding, // DW_ATE_foo
|
|
|
|
DwarfVirtuality, // DW_VIRTUALITY_foo
|
|
|
|
DwarfLang, // DW_LANG_foo
|
2016-06-09 04:34:29 +08:00
|
|
|
DwarfCC, // DW_CC_foo
|
2016-05-11 20:07:32 +08:00
|
|
|
EmissionKind, // lineTablesOnly
|
2018-08-17 05:29:55 +08:00
|
|
|
NameTableKind, // GNU
|
2016-05-11 20:07:32 +08:00
|
|
|
DwarfOp, // DW_OP_foo
|
|
|
|
DIFlag, // DIFlagFoo
|
2018-11-29 05:14:32 +08:00
|
|
|
DISPFlag, // DISPFlagFoo
|
2016-05-11 20:07:32 +08:00
|
|
|
DwarfMacinfo, // DW_MACINFO_foo
|
2016-12-25 18:12:09 +08:00
|
|
|
ChecksumKind, // CSK_foo
|
2016-05-11 20:07:32 +08:00
|
|
|
|
|
|
|
// Type valued tokens (TyVal).
|
|
|
|
Type,
|
|
|
|
|
|
|
|
APFloat, // APFloatVal
|
|
|
|
APSInt // APSInt
|
|
|
|
};
|
2009-01-02 15:01:27 +08:00
|
|
|
} // end namespace lltok
|
|
|
|
} // end namespace llvm
|
|
|
|
|
|
|
|
#endif
|