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