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