2009-01-02 15:01:27 +08:00
|
|
|
//===- LLToken.h - Token Codes for LLVM Assembly Files ----------*- C++ -*-===//
|
|
|
|
//
|
|
|
|
// The LLVM Compiler Infrastructure
|
|
|
|
//
|
|
|
|
// This file is distributed under the University of Illinois Open Source
|
|
|
|
// License. See LICENSE.TXT for details.
|
|
|
|
//
|
|
|
|
//===----------------------------------------------------------------------===//
|
|
|
|
//
|
|
|
|
// 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, // |
|
|
|
|
|
|
|
|
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,
|
|
|
|
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,
|
|
|
|
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,
|
|
|
|
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,
|
|
|
|
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,
|
|
|
|
|
|
|
|
// Attributes:
|
|
|
|
kw_attributes,
|
|
|
|
kw_allocsize,
|
|
|
|
kw_alwaysinline,
|
|
|
|
kw_argmemonly,
|
|
|
|
kw_sanitize_address,
|
2017-12-09 08:21:41 +08:00
|
|
|
kw_sanitize_hwaddress,
|
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,
|
|
|
|
kw_nobuiltin,
|
|
|
|
kw_nocapture,
|
|
|
|
kw_noduplicate,
|
|
|
|
kw_noimplicitfloat,
|
|
|
|
kw_noinline,
|
|
|
|
kw_norecurse,
|
|
|
|
kw_nonlazybind,
|
|
|
|
kw_nonnull,
|
|
|
|
kw_noredzone,
|
|
|
|
kw_noreturn,
|
2018-03-17 21:29:46 +08:00
|
|
|
kw_nocf_check,
|
2016-05-11 20:07:32 +08:00
|
|
|
kw_nounwind,
|
[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,
|
|
|
|
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,
|
2017-08-15 05:15:13 +08:00
|
|
|
kw_strictfp,
|
2016-05-11 20:07:32 +08:00
|
|
|
kw_swifterror,
|
|
|
|
kw_swiftself,
|
|
|
|
kw_uwtable,
|
2016-07-04 16:01:29 +08:00
|
|
|
kw_writeonly,
|
2016-05-11 20:07:32 +08:00
|
|
|
kw_zeroext,
|
|
|
|
|
|
|
|
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).
|
|
|
|
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,
|
|
|
|
|
|
|
|
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,
|
|
|
|
|
|
|
|
// Metadata types.
|
|
|
|
kw_distinct,
|
|
|
|
|
|
|
|
// Use-list order directives.
|
|
|
|
kw_uselistorder,
|
|
|
|
kw_uselistorder_bb,
|
|
|
|
|
|
|
|
// Unsigned Valued tokens (UIntVal).
|
|
|
|
GlobalID, // @42
|
|
|
|
LocalVarID, // %42
|
|
|
|
AttrGrpID, // #42
|
|
|
|
|
|
|
|
// 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
|
|
|
|
DwarfOp, // DW_OP_foo
|
|
|
|
DIFlag, // DIFlagFoo
|
|
|
|
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
|