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