Intel® Implicit SPMD Program Compiler (Intel® ISPC)  1.13.0
ispc.h
Go to the documentation of this file.
1 /*
2  Copyright (c) 2010-2020, Intel Corporation
3  All rights reserved.
4 
5  Redistribution and use in source and binary forms, with or without
6  modification, are permitted provided that the following conditions are
7  met:
8 
9  * Redistributions of source code must retain the above copyright
10  notice, this list of conditions and the following disclaimer.
11 
12  * Redistributions in binary form must reproduce the above copyright
13  notice, this list of conditions and the following disclaimer in the
14  documentation and/or other materials provided with the distribution.
15 
16  * Neither the name of Intel Corporation nor the names of its
17  contributors may be used to endorse or promote products derived from
18  this software without specific prior written permission.
19 
20 
21  THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS
22  IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
23  TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
24  PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER
25  OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
26  EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
27  PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
28  PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
29  LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
30  NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
31  SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
32 */
33 
34 /** @file ispc.h
35  @brief Main ispc.header file. Defines Target, Globals and Opt classes.
36 */
37 
38 #pragma once
39 
40 #include "ispc_version.h"
41 #include "target_enums.h"
42 #include "target_registry.h"
43 
44 #if ISPC_LLVM_VERSION < OLDEST_SUPPORTED_LLVM || ISPC_LLVM_VERSION > LATEST_SUPPORTED_LLVM
45 #error "Only LLVM 6.0 - 10.0 and 11.0 development branch are supported"
46 #endif
47 
48 #if defined(_WIN32) || defined(_WIN64)
49 #define ISPC_HOST_IS_WINDOWS
50 #elif defined(__linux__)
51 #define ISPC_HOST_IS_LINUX
52 #elif defined(__FreeBSD__)
53 #define ISPC_HOST_IS_FREEBSD
54 #elif defined(__APPLE__)
55 #define ISPC_HOST_IS_APPLE
56 #endif
57 
58 #include <map>
59 #include <set>
60 #include <stdint.h>
61 #include <stdio.h>
62 #include <stdlib.h>
63 #include <string>
64 #include <vector>
65 
66 /** @def ISPC_MAX_NVEC maximum vector size of any of the compliation
67  targets.
68  */
69 #define ISPC_MAX_NVEC 64
70 
71 // Number of final optimization phase
72 #define LAST_OPT_NUMBER 1000
73 
74 // Forward declarations of a number of widely-used LLVM types
75 namespace llvm {
76 
77 class AttrBuilder;
78 class BasicBlock;
79 class Constant;
80 class ConstantValue;
81 class DataLayout;
82 class DIBuilder;
83 class Function;
84 class FunctionType;
85 class LLVMContext;
86 class Module;
87 class Target;
88 class TargetMachine;
89 class Type;
90 class Value;
91 class DIFile;
92 class DIType;
93 
94 class DIScope;
95 } // namespace llvm
96 
97 class ArrayType;
98 class AST;
99 class ASTNode;
100 class AtomicType;
101 class FunctionEmitContext;
102 class Expr;
103 class ExprList;
104 class Function;
105 class FunctionType;
106 class Module;
107 class PointerType;
108 class Stmt;
109 class Symbol;
110 class SymbolTable;
111 class Type;
112 struct VariableDeclaration;
113 
115 
116 /** @brief Representation of a range of positions in a source file.
117 
118  This class represents a range of characters in a source file
119  (e.g. those that span a token's definition), from starting line and
120  column to ending line and column. (These values are tracked by the
121  lexing code). Both lines and columns are counted starting from one.
122  */
123 struct SourcePos {
124  SourcePos(const char *n = NULL, int fl = 0, int fc = 0, int ll = 0, int lc = 0);
125 
126  const char *name;
131 
132  /** Prints the filename and line/column range to standard output. */
133  void Print() const;
134 
135  /** Returns a LLVM DIFile object that represents the SourcePos's file */
136  llvm::DIFile *GetDIFile() const;
137 
138  bool operator==(const SourcePos &p2) const;
139 };
140 
141 /** Returns a SourcePos that encompasses the extent of both of the given
142  extents. */
143 SourcePos Union(const SourcePos &p1, const SourcePos &p2);
144 
145 /** @brief Structure that defines a compilation target
146 
147  This structure defines a compilation target for the ispc compiler.
148 */
149 class Target {
150  public:
151  /** Enumerator giving the instruction sets that the compiler can
152  target. These should be ordered from "worse" to "better" in that
153  if a processor supports multiple target ISAs, then the most
154  flexible/performant of them will apear last in the enumerant. Note
155  also that __best_available_isa() needs to be updated if ISAs are
156  added or the enumerant values are reordered. */
157  enum ISA {
158  SSE2 = 0,
159  SSE4 = 1,
160  AVX = 2,
161  // Not supported anymore. Use either AVX or AVX2.
162  // AVX11 = 3,
163  AVX2 = 3,
164  KNL_AVX512 = 4,
165  SKX_AVX512 = 5,
166  GENERIC = 6,
167 #ifdef ISPC_ARM_ENABLED
168  NEON,
169 #endif
170 #ifdef ISPC_WASM_ENABLED
171  WASM,
172 #endif
173  NUM_ISAS
174  };
175 
176  /** Initializes the given Target pointer for a target of the given
177  name, if the name is a known target. Returns true if the
178  target was initialized and false if the name is unknown. */
179  Target(Arch arch, const char *cpu, ISPCTarget isa, bool pic, bool printTarget);
180 
181  /** Returns a comma-delimited string giving the names of the currently
182  supported CPUs. */
183  static std::string SupportedCPUs();
184 
185  /** Returns a triple string specifying the target architecture, vendor,
186  and environment. */
187  std::string GetTripleString() const;
188 
189  /** Returns the LLVM TargetMachine object corresponding to this
190  target. */
191  llvm::TargetMachine *GetTargetMachine() const { return m_targetMachine; }
192 
193  /** Convert ISA enum to string */
194  static const char *ISAToString(Target::ISA isa);
195 
196  /** Returns a string like "avx" encoding the target. Good for mangling. */
197  const char *GetISAString() const;
198 
199  /** Convert ISA enum to string */
200  static const char *ISAToTargetString(Target::ISA isa);
201 
202  /** Returns a string like "avx2-i32x8" encoding the target.
203  This may be used for Target initialization. */
204  const char *GetISATargetString() const;
205 
206  /** Returns the size of the given type */
207  llvm::Value *SizeOf(llvm::Type *type, llvm::BasicBlock *insertAtEnd);
208 
209  /** Given a structure type and an element number in the structure,
210  returns a value corresponding to the number of bytes from the start
211  of the structure where the element is located. */
212  llvm::Value *StructOffset(llvm::Type *type, int element, llvm::BasicBlock *insertAtEnd);
213 
214  /** Mark LLVM function with target specific attribute, if required. */
215  void markFuncWithTargetAttr(llvm::Function *func);
216 
217  /* Check if target is GENERIC and internally calls lGenericTypeLayoutIndeterminate */
218  bool IsGenericTypeLayoutIndeterminate(llvm::Type *type);
219 
220  const llvm::Target *getTarget() const { return m_target; }
221 
222  // Note the same name of method for 3.1 and 3.2+, this allows
223  // to reduce number ifdefs on client side.
224  const llvm::DataLayout *getDataLayout() const { return m_dataLayout; }
225 
226  /** Reports if Target object has valid state. */
227  bool isValid() const { return m_valid; }
228 
229  ISPCTarget getISPCTarget() const { return m_ispc_target; }
230 
231  ISA getISA() const { return m_isa; }
232 
233  Arch getArch() const { return m_arch; }
234 
235  bool is32Bit() const { return m_is32Bit; }
236 
237  std::string getCPU() const { return m_cpu; }
238 
239  int getNativeVectorWidth() const { return m_nativeVectorWidth; }
240 
241  int getNativeVectorAlignment() const { return m_nativeVectorAlignment; }
242 
243  int getDataTypeWidth() const { return m_dataTypeWidth; }
244 
245  int getVectorWidth() const { return m_vectorWidth; }
246 
247  bool getGeneratePIC() const { return m_generatePIC; }
248 
249  bool getMaskingIsFree() const { return m_maskingIsFree; }
250 
251  int getMaskBitCount() const { return m_maskBitCount; }
252 
253  bool hasHalf() const { return m_hasHalf; }
254 
255  bool hasRand() const { return m_hasRand; }
256 
257  bool hasGather() const { return m_hasGather; }
258 
259  bool hasScatter() const { return m_hasScatter; }
260 
261  bool hasTranscendentals() const { return m_hasTranscendentals; }
262 
263  bool hasTrigonometry() const { return m_hasTrigonometry; }
264 
265  bool hasRsqrtd() const { return m_hasRsqrtd; }
266 
267  bool hasRcpd() const { return m_hasRcpd; }
268 
269  bool hasVecPrefetch() const { return m_hasVecPrefetch; }
270 
271  private:
272  /** llvm Target object representing this target. */
273  const llvm::Target *m_target;
274 
275  /** llvm TargetMachine.
276  Note that it's not destroyed during Target destruction, as
277  Module::CompileAndOutput() uses TargetMachines after Target is destroyed.
278  This needs to be changed.
279  It's also worth noticing, that DataLayout of TargetMachine cannot be
280  modified and for generic targets it's not what we really need, so it
281  must not be used.
282  */
283  llvm::TargetMachine *m_targetMachine;
284  llvm::DataLayout *m_dataLayout;
285 
286  /** flag to report invalid state after construction
287  (due to bad parameters passed to constructor). */
288  bool m_valid;
289 
290  /** ISPC target being used */
292 
293  /** Instruction set being compiled to. */
295 
296  /** Target system architecture. (e.g. "x86-64", "x86"). */
298 
299  /** Is the target architecture 32 or 64 bit */
300  bool m_is32Bit;
301 
302  /** Target CPU. (e.g. "corei7", "corei7-avx", ..) */
303  std::string m_cpu;
304 
305  /** Target-specific attribute string to pass along to the LLVM backend */
306  std::string m_attributes;
307 
308  /** Target-specific function attributes */
309  std::vector<std::pair<std::string, std::string>> m_funcAttributes;
310 
311  /** Target-specific LLVM attribute, which has to be attached to every
312  function to ensure that it is generated for correct target architecture.
313  This is requirement was introduced in LLVM 3.3 */
314  llvm::AttrBuilder *m_tf_attributes;
315 
316  /** Native vector width of the vector instruction set. Note that this
317  value is directly derived from the ISA being used (e.g. it's 4 for
318  SSE, 8 for AVX, etc.) */
320 
321  /** Native vector alignment in bytes. Theoretically this may be derived
322  from the vector size, but it's better to manage directly the alignement.
323  It allows easier experimenting and better fine tuning for particular
324  platform. This information is primatily used when
325  --opt=force-aligned-memory is used. */
327 
328  /** Data type width in bits. Typically it's 32, but could be 8, 16 or 64.
329  For generic it's -1, which means undefined. */
331 
332  /** Actual vector width currently being compiled to. This may be an
333  integer multiple of the native vector width, for example if we're
334  "doubling up" and compiling 8-wide on a 4-wide SSE system. */
336 
337  /** Indicates whether position independent code should be generated. */
339 
340  /** Is there overhead associated with masking on the target
341  architecture; e.g. there is on SSE, due to extra blends and the
342  like, but there isn't with an ISA that supports masking
343  natively. */
345 
346  /** How many bits are used to store each element of the mask: e.g. this
347  is 32 on SSE/AVX, since that matches the HW better, but it's 1 for
348  the generic target. */
350 
351  /** Indicates whether the target has native support for float/half
352  conversions. */
353  bool m_hasHalf;
354 
355  /** Indicates whether there is an ISA random number instruction. */
356  bool m_hasRand;
357 
358  /** Indicates whether the target has a native gather instruction */
360 
361  /** Indicates whether the target has a native scatter instruction */
363 
364  /** Indicates whether the target has support for transcendentals (beyond
365  sqrt, which we assume that all of them handle). */
367 
368  /** Indicates whether the target has ISA support for trigonometry */
370 
371  /** Indicates whether there is an ISA double precision rsqrt. */
373 
374  /** Indicates whether there is an ISA double precision rcp. */
375  bool m_hasRcpd;
376 
377  /** Indicates whether the target has hardware instruction for vector prefetch. */
379 };
380 
381 /** @brief Structure that collects optimization options
382 
383  This structure collects all of the options related to optimization of
384  generated code.
385 */
386 struct Opt {
387  Opt();
388 
389  /** Optimization level. Currently, the only valid values are 0,
390  indicating essentially no optimization, and 1, indicating as much
391  optimization as possible. */
392  int level;
393 
394  /** Indicates whether "fast and loose" numerically unsafe optimizations
395  should be performed. This is false by default. */
396  bool fastMath;
397 
398  /** Indicates whether an vector load should be issued for masked loads
399  on platforms that don't have a native masked vector load. (This may
400  lead to accessing memory up to programCount-1 elements past the end of
401  arrays, so is unsafe in general.) */
403 
404  /** Indicates when loops should be unrolled (when doing so seems like
405  it will make sense. */
407 
408  /** Indicates if addressing math will be done with 32-bit math, even on
409  64-bit systems. (This is generally noticably more efficient,
410  though at the cost of addressing >2GB).
411  */
413 
414  /** Indicates whether Assert() statements should be ignored (for
415  performance in the generated code). */
417 
418  /** Indicates whether FMA instructions should be disabled (on targets
419  that support them). */
421 
422  /** Always generate aligned vector load/store instructions; this
423  implies a guarantee that all dynamic access through pointers that
424  becomes a vector load/store will be a cache-aligned sequence of
425  locations. */
427 
428  /** If enabled, disables the various optimizations that kick in when
429  the execution mask can be determined to be "all on" at compile
430  time. */
432 
433  /** If enabled, the various __pseudo* memory ops (gather/scatter,
434  masked load/store) are left in their __pseudo* form, for better
435  understanding of the structure of generated code when reading
436  it. */
438 
439  /** On targets that don't have a masked store instruction but do have a
440  blending instruction, by default, we simulate masked stores by
441  loading the old value, blending, and storing the result. This can
442  potentially be unsafe in multi-threaded code, in that it writes to
443  locations that aren't supposed to be written to. Setting this
444  value to true disables this work-around, and instead implements
445  masked stores by 'scalarizing' them, so that we iterate over the
446  ISIMD lanes and do a scalar write for the ones that are running. */
448 
449  /** Disables the 'coherent control flow' constructs in the
450  language. (e.g. this causes "cif" statements to be demoted to "if"
451  statements.) This is likely only useful for measuring the impact
452  of coherent control flow. */
454 
455  /** Disables uniform control flow optimizations (e.g. this changes an
456  "if" statement with a uniform condition to have a varying
457  condition). This is likely only useful for measuring the impact of
458  uniform control flow. */
460 
461  /** Disables the backend optimizations related to gather/scatter
462  (e.g. transforming gather from sequential locations to an unaligned
463  load, etc.) This is likely only useful for measuring the impact of
464  these optimizations. */
466 
467  /** Disables the optimization that demotes masked stores to regular
468  stores when the store is happening at the same control flow level
469  where the variable was declared. This is likely only useful for
470  measuring the impact of this optimization. */
472 
473  /** Disables the optimization that detects when the execution mask is
474  all on and emits code for gathers and scatters that doesn't loop
475  over the SIMD lanes but just does the scalar loads and stores
476  directly. */
478 
479  /** Disables the optimizations that detect when arrays are being
480  indexed with 'uniform' values and issue scalar loads/stores rather
481  than gathers/scatters. This is likely only useful for measuring
482  the impact of this optimization. */
484 
485  /** Disables optimizations that coalesce incoherent scalar memory
486  access from gathers into wider vector operations, when possible. */
488 
489  /** Disable using zmm registers for avx512 target in favour of ymm.
490  Affects only >= 512 bit wide targets and only if avx512vl is available */
492 };
493 
494 /** @brief This structure collects together a number of global variables.
495 
496  This structure collects a number of global variables that mostly
497  represent parameter settings for this compilation run. In particular,
498  none of these values should change after compilation befins; their
499  values are all set during command-line argument processing or very
500  early during the compiler's execution, before any files are parsed.
501  */
502 struct Globals {
503  Globals();
504 
505  /** TargetRegistry holding all stdlib bitcode. */
507 
508  /** Optimization option settings */
510 
511  /** Compilation target information */
513 
514  /** Target OS */
516 
517  /** There are a number of math libraries that can be used for
518  transcendentals and the like during program compilation. */
519  enum MathLib { Math_ISPC, Math_ISPCFast, Math_SVML, Math_System };
521 
522  /** Optimization level to be specified while creating TargetMachine. */
523  enum CodegenOptLevel { None, Aggressive };
525 
526  /** Records whether the ispc standard library should be made available
527  to the program during compilations. (Default is true.) */
529 
530  /** Indicates whether the C pre-processor should be run over the
531  program source before compiling it. (Default is true.) */
532  bool runCPP;
533 
534  /** When \c true, voluminous debugging output will be printed during
535  ispc's execution. */
537 
538  /** When \c true, target ISA will be printed during ispc's execution. */
540 
541  /** When \c true, LLVM won't omit frame pointer. */
543 
544  /** Indicates which stages of optimization we want to dump. */
545  std::set<int> debug_stages;
546 
547  /** Whether to dump IR to file. */
548  bool dumpFile;
549 
550  /** Indicates after which optimization we want to generate
551  DebugIR information. */
552  int debugIR;
553 
554  /** Indicates which phases of optimization we want to switch off. */
555  std::set<int> off_stages;
556 
557  /** Indicates whether all warning messages should be surpressed. */
559 
560  /** Indicates whether warnings should be issued as errors. */
562 
563  /** Indicates whether line wrapping of error messages to the terminal
564  width should be disabled. */
566 
567  /** Indicates whether additional warnings should be issued about
568  possible performance pitfalls. */
570 
571  /** Indicates whether all printed output should be surpressed. */
572  bool quiet;
573 
574  /** Always use ANSI escape sequences to colorize warning and error
575  messages, even if piping output to a file, etc. */
577 
578  /** Indicates whether calls should be emitted in the program to an
579  externally-defined program instrumentation function. (See the
580  "Instrumenting your ispc programs" section in the user's
581  manual.) */
583 
585 
586  /** Indicates whether ispc should generate debugging symbols for the
587  program in its output. */
589 
590  /** Require generation of DWARF of certain version (2, 3, 4). For
591  default version, this field is set to 0. */
592  // Hint: to verify dwarf version in the object file, run on Linux:
593  // readelf --debug-dump=info object.o | grep -A 2 'Compilation Unit @'
594  // on Mac:
595  // xcrun dwarfdump -r0 object.o
597 
598  /** If true, function names are mangled by appending the target ISA and
599  vector width to them. */
601 
602  /** If enabled, the lexer will randomly replace some tokens returned
603  with other tokens, in order to test error condition handling in the
604  compiler. */
606 
607  /** Seed for random number generator used for fuzz testing. */
609 
610  /** Global LLVMContext object */
611  llvm::LLVMContext *ctx;
612 
613  /** Current working directory when the ispc compiler starts
614  execution. */
615  char currentDirectory[1024];
616 
617  /** Arguments to pass along to the C pre-processor, if it is run on the
618  program before compilation. */
619  std::vector<std::string> cppArgs;
620 
621  /** Additional user-provided directories to search when processing
622  #include directives in the preprocessor. */
623  std::vector<std::string> includePath;
624 
625  /** Indicates that alignment in memory allocation routines should be
626  forced to have given value. -1 value means natural alignment for the platforms. */
628 
629  /** When true, flag non-static functions with dllexport attribute on Windows. */
630  bool dllExport;
631 
632  /** Lines for which warnings are turned off. */
633  std::map<std::pair<int, std::string>, bool> turnOffWarnings;
634 
635  /* If true, we are compiling for more than one target. */
637 
638  /* Number of errors to show in ISPC. */
640 };
641 
642 enum {
653  COST_NEW = 32,
658  COST_SYNC = 32,
669 
672 };
673 
674 extern Globals *g;
675 extern Module *m;
bool disableFMA
Definition: ispc.h:420
bool m_hasTranscendentals
Definition: ispc.h:366
TargetOS target_os
Definition: ispc.h:515
bool isMultiTargetCompilation
Definition: ispc.h:636
ISPCTarget
Definition: target_enums.h:55
Definition: ast.h:138
Definition: func.h:43
Define enums describing target platform.
Opt opt
Definition: ispc.h:509
Definition: ispc.h:75
int last_column
Definition: ispc.h:130
bool disableWarnings
Definition: ispc.h:558
const llvm::Target * m_target
Definition: ispc.h:273
CodegenOptLevel
Definition: ispc.h:523
TargetOS
Definition: target_enums.h:43
TargetLibRegistry * target_registry
Definition: ispc.h:506
MathLib
Definition: ispc.h:519
bool hasVecPrefetch() const
Definition: ispc.h:269
This structure collects together a number of global variables.
Definition: ispc.h:502
bool getGeneratePIC() const
Definition: ispc.h:247
int m_nativeVectorAlignment
Definition: ispc.h:326
std::vector< std::pair< std::string, std::string > > m_funcAttributes
Definition: ispc.h:309
bool disableBlendedMaskedStores
Definition: ispc.h:447
ISPCTarget m_ispc_target
Definition: ispc.h:291
std::map< std::pair< int, std::string >, bool > turnOffWarnings
Definition: ispc.h:633
Module * m
Definition: ispc.cpp:73
Interface class for statements in the ispc language.
Definition: stmt.h:48
int first_line
Definition: ispc.h:127
bool forceColoredOutput
Definition: ispc.h:576
Structure that defines a compilation target.
Definition: ispc.h:149
Target * target
Definition: ispc.h:512
Registry to handle bitcode libraries.
std::string m_cpu
Definition: ispc.h:303
int getNativeVectorAlignment() const
Definition: ispc.h:241
std::vector< std::string > includePath
Definition: ispc.h:623
defines the ISPC version
bool emitPerfWarnings
Definition: ispc.h:569
bool warningsAsErrors
Definition: ispc.h:561
bool getMaskingIsFree() const
Definition: ispc.h:249
bool NoOmitFramePointer
Definition: ispc.h:542
Symbol table that holds all known symbols during parsing and compilation.
Definition: sym.h:116
int getMaskBitCount() const
Definition: ispc.h:251
bool forceAlignedMemory
Definition: ispc.h:426
int getDataTypeWidth() const
Definition: ispc.h:243
bool hasHalf() const
Definition: ispc.h:253
int m_nativeVectorWidth
Definition: ispc.h:319
bool m_generatePIC
Definition: ispc.h:338
A list of expressions.
Definition: expr.h:249
int fuzzTestSeed
Definition: ispc.h:608
Type implementation for pointers to other types.
Definition: type.h:419
bool disableLineWrap
Definition: ispc.h:565
int getNativeVectorWidth() const
Definition: ispc.h:239
bool m_maskingIsFree
Definition: ispc.h:344
bool disableCoalescing
Definition: ispc.h:487
bool includeStdlib
Definition: ispc.h:528
std::set< int > debug_stages
Definition: ispc.h:545
bool disableMaskAllOnOptimizations
Definition: ispc.h:431
int level
Definition: ispc.h:392
std::string m_attributes
Definition: ispc.h:306
Globals * g
Definition: ispc.cpp:72
bool disableGatherScatterOptimizations
Definition: ispc.h:465
bool debugPrint
Definition: ispc.h:536
bool disableZMM
Definition: ispc.h:491
bool disableCoherentControlFlow
Definition: ispc.h:453
Abstract base class for nodes in the abstract syntax tree (AST).
Definition: ast.h:49
bool enableFuzzTest
Definition: ispc.h:605
int errorLimit
Definition: ispc.h:639
bool printTarget
Definition: ispc.h:539
Definition: module.h:51
bool runCPP
Definition: ispc.h:532
SourcePos Union(const SourcePos &p1, const SourcePos &p2)
Definition: ispc.cpp:1523
bool mangleFunctionsWithTarget
Definition: ispc.h:600
Arch m_arch
Definition: ispc.h:297
bool m_is32Bit
Definition: ispc.h:300
CodegenOptLevel codegenOptLevel
Definition: ispc.h:524
bool hasScatter() const
Definition: ispc.h:259
bool m_hasRand
Definition: ispc.h:356
bool m_hasRcpd
Definition: ispc.h:375
bool emitInstrumentation
Definition: ispc.h:582
int m_maskBitCount
Definition: ispc.h:349
bool unrollLoops
Definition: ispc.h:406
AtomicType represents basic types like floats, ints, etc.
Definition: type.h:270
bool hasRcpd() const
Definition: ispc.h:267
bool hasRand() const
Definition: ispc.h:255
Representation of a range of positions in a source file.
Definition: ispc.h:123
bool disableUniformMemoryOptimizations
Definition: ispc.h:483
bool generateDebuggingSymbols
Definition: ispc.h:588
bool fastMath
Definition: ispc.h:396
int m_vectorWidth
Definition: ispc.h:335
bool hasTranscendentals() const
Definition: ispc.h:261
bool fastMaskedVload
Definition: ispc.h:402
llvm::TargetMachine * m_targetMachine
Definition: ispc.h:283
StorageClass
Definition: ispc.h:114
bool disableHandlePseudoMemoryOps
Definition: ispc.h:437
bool force32BitAddressing
Definition: ispc.h:412
bool dllExport
Definition: ispc.h:630
const char * name
Definition: ispc.h:126
bool hasGather() const
Definition: ispc.h:257
int getVectorWidth() const
Definition: ispc.h:245
int m_dataTypeWidth
Definition: ispc.h:330
int last_line
Definition: ispc.h:129
MathLib mathLib
Definition: ispc.h:520
const llvm::DataLayout * getDataLayout() const
Definition: ispc.h:224
bool disableUniformControlFlow
Definition: ispc.h:459
bool m_hasGather
Definition: ispc.h:359
int first_column
Definition: ispc.h:128
llvm::DataLayout * m_dataLayout
Definition: ispc.h:284
const llvm::Target * getTarget() const
Definition: ispc.h:220
bool disableMaskedStoreToStore
Definition: ispc.h:471
Arch getArch() const
Definition: ispc.h:233
bool m_hasScatter
Definition: ispc.h:362
Definition: ispc.h:114
ISA
Definition: ispc.h:157
bool hasTrigonometry() const
Definition: ispc.h:263
std::string getCPU() const
Definition: ispc.h:237
ISA getISA() const
Definition: ispc.h:231
bool m_valid
Definition: ispc.h:288
Type representing a function (return type + argument types)
Definition: type.h:829
Representation of a program symbol.
Definition: sym.h:62
bool dumpFile
Definition: ispc.h:548
Interface class that defines the type abstraction.
Definition: type.h:90
int generateDWARFVersion
Definition: ispc.h:596
int forceAlignment
Definition: ispc.h:627
ISPCTarget getISPCTarget() const
Definition: ispc.h:229
Expr is the abstract base class that defines the interface that all expression types must implement...
Definition: expr.h:47
bool quiet
Definition: ispc.h:572
bool m_hasTrigonometry
Definition: ispc.h:369
std::set< int > off_stages
Definition: ispc.h:555
bool noPragmaOnce
Definition: ispc.h:584
bool hasRsqrtd() const
Definition: ispc.h:265
bool isValid() const
Definition: ispc.h:227
std::vector< std::string > cppArgs
Definition: ispc.h:619
bool m_hasHalf
Definition: ispc.h:353
Definition: ispc.h:653
bool is32Bit() const
Definition: ispc.h:235
llvm::LLVMContext * ctx
Definition: ispc.h:611
ISA m_isa
Definition: ispc.h:294
bool m_hasVecPrefetch
Definition: ispc.h:378
llvm::AttrBuilder * m_tf_attributes
Definition: ispc.h:314
Arch
Definition: target_enums.h:50
bool disableAsserts
Definition: ispc.h:416
bool m_hasRsqrtd
Definition: ispc.h:372
llvm::TargetMachine * GetTargetMachine() const
Definition: ispc.h:191
bool disableGatherScatterFlattening
Definition: ispc.h:477
int debugIR
Definition: ispc.h:552
Structure that collects optimization options.
Definition: ispc.h:386
One-dimensional array type.
Definition: type.h:521