clang  19.0.0git
CGLoopInfo.h
Go to the documentation of this file.
1 //===---- CGLoopInfo.h - LLVM CodeGen for loop metadata -*- C++ -*---------===//
2 //
3 // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
4 // See https://llvm.org/LICENSE.txt for license information.
5 // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
6 //
7 //===----------------------------------------------------------------------===//
8 //
9 // This is the internal state used for llvm translation for loop statement
10 // metadata.
11 //
12 //===----------------------------------------------------------------------===//
13 
14 #ifndef LLVM_CLANG_LIB_CODEGEN_CGLOOPINFO_H
15 #define LLVM_CLANG_LIB_CODEGEN_CGLOOPINFO_H
16 
17 #include "llvm/ADT/ArrayRef.h"
18 #include "llvm/ADT/SmallVector.h"
19 #include "llvm/IR/DebugLoc.h"
20 #include "llvm/IR/Value.h"
21 #include "llvm/Support/Compiler.h"
22 
23 namespace llvm {
24 class BasicBlock;
25 class Instruction;
26 class MDNode;
27 } // end namespace llvm
28 
29 namespace clang {
30 class Attr;
31 class ASTContext;
32 class CodeGenOptions;
33 class ValueDecl;
34 namespace CodeGen {
35 
36 /// Attributes that may be specified on loops.
38  explicit LoopAttributes(bool IsParallel = false);
39  void clear();
40 
41  /// Generate llvm.loop.parallel metadata for loads and stores.
42  bool IsParallel;
43 
44  /// State of loop vectorization or unrolling.
46 
47  /// Value for llvm.loop.vectorize.enable metadata.
49 
50  /// Value for llvm.loop.unroll.* metadata (enable, disable, or full).
52 
53  /// Value for llvm.loop.unroll_and_jam.* metadata (enable, disable, or full).
55 
56  /// Value for llvm.loop.vectorize.predicate metadata
58 
59  /// Value for llvm.loop.vectorize.width metadata.
60  unsigned VectorizeWidth;
61 
62  // Value for llvm.loop.vectorize.scalable.enable
64 
65  /// Value for llvm.loop.interleave.count metadata.
66  unsigned InterleaveCount;
67 
68  // SYCLIVDepInfo represents a group of arrays that have the same IVDep safelen to
69  // them. The arrays contained in it will later be referred to from the same
70  // "llvm.loop.parallel_access_indices" metadata node.
71  struct SYCLIVDepInfo {
72  unsigned SafeLen;
75  SYCLIVDepInfo(unsigned SL) : SafeLen(SL) {}
76  SYCLIVDepInfo(unsigned SL, const ValueDecl *A, llvm::MDNode *MD) : SafeLen(SL) {
77  Arrays.emplace_back(A, MD);
78  }
79 
80  bool hasArray(const ValueDecl *Array) const {
81  return Arrays.end() != getArrayPairItr(Array);
82  }
83 
84  decltype(Arrays)::iterator getArrayPairItr(const ValueDecl *Array) {
85  return find_if(Arrays,
86  [Array](const auto &Pair) { return Pair.first == Array; });
87  }
88 
89  decltype(Arrays)::iterator getArrayPairItr(const ValueDecl *Array) const {
90  return find_if(Arrays,
91  [Array](const auto &Pair) { return Pair.first == Array; });
92  }
93 
94  void eraseArray(const ValueDecl *Array) {
95  assert(hasArray(Array) && "Precondition of EraseArray is HasArray");
96  Arrays.erase(getArrayPairItr(Array));
97  }
98 
99  bool isSafeLenGreaterOrEqual(unsigned OtherSL) const {
100  return SafeLen == 0 || (OtherSL != 0 && SafeLen >= OtherSL);
101  }
102  };
103 
104  // Value for llvm.loop.parallel_access_indices metadata, for the arrays that
105  // weren't put into a specific ivdep item.
106  std::optional<SYCLIVDepInfo> GlobalSYCLIVDepInfo;
107  // Value for llvm.loop.parallel_access_indices metadata, for array
108  // specifications.
110 
111  /// Value for llvm.loop.ii.count metadata.
112  unsigned SYCLIInterval;
113 
114  /// Value for llvm.loop.max_concurrency.count metadata.
115  std::optional<unsigned> SYCLMaxConcurrencyNThreads;
116 
117  /// Value for count variant (min/max/avg) and count metadata.
120 
121  /// Flag for llvm.loop.coalesce metadata.
123 
124  /// Value for llvm.loop.coalesce.count metadata.
126 
127  /// Flag for llvm.loop.intel.pipelining.enable, i32 0 metadata.
129 
130  /// Value for llvm.loop.max_interleaving.count metadata.
131  std::optional<unsigned> SYCLMaxInterleavingNInvocations;
132 
133  /// Value for llvm.loop.intel.speculated.iterations.count metadata.
134  std::optional<unsigned> SYCLSpeculatedIterationsNIterations;
135 
136  // Value for llvm.loop.intel.max_reinvocation_delay metadata.
137  std::optional<unsigned> SYCLMaxReinvocationDelayNCycles;
138 
139  /// Flag for llvm.loop.intel.pipelining.enable, i32 1 metadata.
141 
142  /// llvm.unroll.
143  unsigned UnrollCount;
144 
145  /// llvm.unroll.
147 
148  /// Value for llvm.loop.distribute.enable metadata.
150 
151  /// Value for llvm.loop.pipeline.disable metadata.
153 
154  /// Value for llvm.loop.pipeline.iicount metadata.
156 
157  /// Flag for llvm.loop.fusion.disable metatdata.
159 
160  /// Value for 'llvm.loop.align' metadata.
161  unsigned CodeAlign;
162 
163  /// Value for whether the loop is required to make progress.
165 };
166 
167 /// Information used when generating a structured loop.
168 class LoopInfo {
169 public:
170  /// Construct a new LoopInfo for the loop with entry Header.
171  LoopInfo(llvm::BasicBlock *Header, const LoopAttributes &Attrs,
172  const llvm::DebugLoc &StartLoc, const llvm::DebugLoc &EndLoc,
173  LoopInfo *Parent);
174 
175  /// Get the loop id metadata for this loop.
176  llvm::MDNode *getLoopID() const { return TempLoopID.get(); }
177 
178  /// Get the header block of this loop.
179  llvm::BasicBlock *getHeader() const { return Header; }
180 
181  /// Get the set of attributes active for this loop.
182  const LoopAttributes &getAttributes() const { return Attrs; }
183 
184  /// Return this loop's access group or nullptr if it does not have one.
185  llvm::MDNode *getAccessGroup() const { return AccGroup; }
186 
187  // Recursively adds the metadata for this Array onto this GEP.
188  void addIVDepMetadata(const ValueDecl *Array, llvm::Instruction *GEP) const;
189 
190  /// Create the loop's metadata. Must be called after its nested loops have
191  /// been processed.
192  void finish();
193 
194  /// Returns the first outer loop containing this loop if any, nullptr
195  /// otherwise.
196  const LoopInfo *getParent() const { return Parent; }
197 
198 private:
199  /// Loop ID metadata.
200  llvm::TempMDTuple TempLoopID;
201  /// Header block of this loop.
202  llvm::BasicBlock *Header;
203  /// The attributes for this loop.
204  LoopAttributes Attrs;
205  /// The access group for memory accesses parallel to this loop.
206  llvm::MDNode *AccGroup = nullptr;
207  /// Start location of this loop.
208  llvm::DebugLoc StartLoc;
209  /// End location of this loop.
210  llvm::DebugLoc EndLoc;
211  /// The next outer loop, or nullptr if this is the outermost loop.
212  LoopInfo *Parent;
213  /// If this loop has unroll-and-jam metadata, this can be set by the inner
214  /// loop's LoopInfo to set the llvm.loop.unroll_and_jam.followup_inner
215  /// metadata.
216  llvm::MDNode *UnrollAndJamInnerFollowup = nullptr;
217 
218  /// Create a LoopID without any transformations.
219  llvm::MDNode *
220  createLoopPropertiesMetadata(llvm::ArrayRef<llvm::Metadata *> LoopProperties);
221 
222  /// Create a LoopID for transformations.
223  ///
224  /// The methods call each other in case multiple transformations are applied
225  /// to a loop. The transformation first to be applied will use LoopID of the
226  /// next transformation in its followup attribute.
227  ///
228  /// @param Attrs The loop's transformations.
229  /// @param LoopProperties Non-transformation properties such as debug
230  /// location, parallel accesses and disabled
231  /// transformations. These are added to the returned
232  /// LoopID.
233  /// @param HasUserTransforms [out] Set to true if the returned MDNode encodes
234  /// at least one transformation.
235  ///
236  /// @return A LoopID (metadata node) that can be used for the llvm.loop
237  /// annotation or followup-attribute.
238  /// @{
239  llvm::MDNode *
240  createPipeliningMetadata(const LoopAttributes &Attrs,
241  llvm::ArrayRef<llvm::Metadata *> LoopProperties,
242  bool &HasUserTransforms);
243  llvm::MDNode *
244  createPartialUnrollMetadata(const LoopAttributes &Attrs,
245  llvm::ArrayRef<llvm::Metadata *> LoopProperties,
246  bool &HasUserTransforms);
247  llvm::MDNode *
248  createUnrollAndJamMetadata(const LoopAttributes &Attrs,
249  llvm::ArrayRef<llvm::Metadata *> LoopProperties,
250  bool &HasUserTransforms);
251  llvm::MDNode *
252  createLoopVectorizeMetadata(const LoopAttributes &Attrs,
253  llvm::ArrayRef<llvm::Metadata *> LoopProperties,
254  bool &HasUserTransforms);
255  llvm::MDNode *
256  createLoopDistributeMetadata(const LoopAttributes &Attrs,
257  llvm::ArrayRef<llvm::Metadata *> LoopProperties,
258  bool &HasUserTransforms);
259  llvm::MDNode *
260  createFullUnrollMetadata(const LoopAttributes &Attrs,
261  llvm::ArrayRef<llvm::Metadata *> LoopProperties,
262  bool &HasUserTransforms);
263  void collectIVDepMetadata(const ValueDecl *Array,
265  /// @}
266 
267  /// Create a LoopID for this loop, including transformation-unspecific
268  /// metadata such as debug location.
269  ///
270  /// @param Attrs This loop's attributes and transformations.
271  /// @param LoopProperties Additional non-transformation properties to add
272  /// to the LoopID, such as transformation-specific
273  /// metadata that are not covered by @p Attrs.
274  /// @param HasUserTransforms [out] Set to true if the returned MDNode encodes
275  /// at least one transformation.
276  ///
277  /// @return A LoopID (metadata node) that can be used for the llvm.loop
278  /// annotation.
279  llvm::MDNode *createMetadata(const LoopAttributes &Attrs,
280  llvm::ArrayRef<llvm::Metadata *> LoopProperties,
281  bool &HasUserTransforms);
282 };
283 
284 /// A stack of loop information corresponding to loop nesting levels.
285 /// This stack can be used to prepare attributes which are applied when a loop
286 /// is emitted.
288  LoopInfoStack(const LoopInfoStack &) = delete;
289  void operator=(const LoopInfoStack &) = delete;
290 
291 public:
293 
294  /// Begin a new structured loop. The set of staged attributes will be
295  /// applied to the loop and then cleared.
296  void push(llvm::BasicBlock *Header, const llvm::DebugLoc &StartLoc,
297  const llvm::DebugLoc &EndLoc);
298 
299  /// Begin a new structured loop. Stage attributes from the Attrs list.
300  /// The staged attributes are applied to the loop and then cleared.
301  void push(llvm::BasicBlock *Header, clang::ASTContext &Ctx,
302  const clang::CodeGenOptions &CGOpts,
303  llvm::ArrayRef<const Attr *> Attrs, const llvm::DebugLoc &StartLoc,
304  const llvm::DebugLoc &EndLoc, bool MustProgress = false);
305 
306  /// End the current loop.
307  void pop();
308 
309  /// Return the top loop id metadata.
310  llvm::MDNode *getCurLoopID() const { return getInfo().getLoopID(); }
311 
312  /// Return true if the top loop is parallel.
313  bool getCurLoopParallel() const {
314  return hasInfo() ? getInfo().getAttributes().IsParallel : false;
315  }
316 
317  /// Function called by the CodeGenFunction when an instruction is
318  /// created.
319  void InsertHelper(llvm::Instruction *I) const;
320 
321  /// Set the next pushed loop as parallel.
322  void setParallel(bool Enable = true) { StagedAttrs.IsParallel = Enable; }
323 
324  /// Set the next pushed loop 'vectorize.enable'
325  void setVectorizeEnable(bool Enable = true) {
326  StagedAttrs.VectorizeEnable =
327  Enable ? LoopAttributes::Enable : LoopAttributes::Disable;
328  }
329 
330  /// Set the next pushed loop as a distribution candidate.
331  void setDistributeState(bool Enable = true) {
332  StagedAttrs.DistributeEnable =
333  Enable ? LoopAttributes::Enable : LoopAttributes::Disable;
334  }
335 
336  /// Set the next pushed loop unroll state.
338  StagedAttrs.UnrollEnable = State;
339  }
340 
341  /// Set the next pushed vectorize predicate state.
343  StagedAttrs.VectorizePredicateEnable = State;
344  }
345 
346  /// Set the next pushed loop unroll_and_jam state.
348  StagedAttrs.UnrollAndJamEnable = State;
349  }
350 
351  /// Set the vectorize width for the next loop pushed.
352  void setVectorizeWidth(unsigned W) { StagedAttrs.VectorizeWidth = W; }
353 
355  StagedAttrs.VectorizeScalable = State;
356  }
357 
358  /// Set the interleave count for the next loop pushed.
359  void setInterleaveCount(unsigned C) { StagedAttrs.InterleaveCount = C; }
360 
361  /// Add a safelen value for the next loop pushed.
362  void addSYCLIVDepInfo(llvm::LLVMContext &Ctx, unsigned SafeLen,
363  const ValueDecl *Array);
364 
365  void addIVDepMetadata(const ValueDecl *Array, llvm::Instruction *GEP);
366 
367  /// Set value of an initiation interval for the next loop pushed.
368  void setSYCLIInterval(unsigned C) { StagedAttrs.SYCLIInterval = C; }
369 
370  /// Set value of max_concurrency for the next loop pushed.
371  void setSYCLMaxConcurrencyNThreads(unsigned C) {
372  StagedAttrs.SYCLMaxConcurrencyNThreads = C;
373  }
374 
375  /// Set flag of loop_coalesce for the next loop pushed.
377  StagedAttrs.SYCLLoopCoalesceEnable = true;
378  }
379 
380  /// Set value of coalesced levels for the next loop pushed.
381  void setSYCLLoopCoalesceNLevels(unsigned C) {
382  StagedAttrs.SYCLLoopCoalesceNLevels = C;
383  }
384 
385  /// Set flag of disable_loop_pipelining for the next loop pushed.
387  StagedAttrs.SYCLLoopPipeliningDisable = true;
388  }
389 
390  /// Set value of max interleaved invocations for the next loop pushed.
392  StagedAttrs.SYCLMaxInterleavingNInvocations = C;
393  }
394 
395  /// Set value of speculated iterations for the next loop pushed.
397  StagedAttrs.SYCLSpeculatedIterationsNIterations = C;
398  }
399 
400  /// Set value of variant and loop count for the next loop pushed.
401  void setSYCLIntelFPGAVariantCount(const char *Var, unsigned int Count) {
402  StagedAttrs.SYCLIntelFPGAVariantCount.push_back({Var, Count});
403  }
404 
405  /// Set the unroll count for the next loop pushed.
406  void setUnrollCount(unsigned C) { StagedAttrs.UnrollCount = C; }
407 
408  /// \brief Set the unroll count for the next loop pushed.
409  void setUnrollAndJamCount(unsigned C) { StagedAttrs.UnrollAndJamCount = C; }
410 
411  /// Set the pipeline disabled state.
412  void setPipelineDisabled(bool S) { StagedAttrs.PipelineDisabled = S; }
413 
414  /// Set the pipeline initiation interval.
415  void setPipelineInitiationInterval(unsigned C) {
416  StagedAttrs.PipelineInitiationInterval = C;
417  }
418 
419  /// Set flag of nofusion for the next loop pushed.
420  void setSYCLNofusionEnable() { StagedAttrs.SYCLNofusionEnable = true; }
421 
422  /// Set value of code align for the next loop pushed.
423  void setCodeAlign(unsigned C) { StagedAttrs.CodeAlign = C; }
424 
425  /// Set no progress for the next loop pushed.
426  void setMustProgress(bool P) { StagedAttrs.MustProgress = P; }
427 
428  /// Set value of max reinvocation delay for the next loop pushed.
430  StagedAttrs.SYCLMaxReinvocationDelayNCycles = C;
431  }
432 
433  /// Set flag of enable_loop_pipelining for the next loop pushed.
435  StagedAttrs.SYCLLoopPipeliningEnable = true;
436  }
437 
438  /// Returns true if there is LoopInfo on the stack.
439  bool hasInfo() const { return !Active.empty(); }
440  /// Return the LoopInfo for the current loop. HasInfo should be called
441  /// first to ensure LoopInfo is present.
442  const LoopInfo &getInfo() const { return *Active.back(); }
443 
444 private:
445  /// The set of attributes that will be applied to the next pushed loop.
446  LoopAttributes StagedAttrs;
447  /// Stack of active loops.
449 };
450 
451 } // end namespace CodeGen
452 } // end namespace clang
453 
454 #endif
NodeId Parent
Definition: ASTDiff.cpp:191
StringRef P
static const TypeInfo & getInfo(unsigned id)
Definition: Types.cpp:47
LineState State
return(__x >> __y)|(__x<<(32 - __y))
Holds long-lived AST nodes (such as types and decls) that can be referred to throughout the semantic ...
Definition: ASTContext.h:185
CodeGenOptions - Track various options which control how the code is optimized and passed to the back...
A stack of loop information corresponding to loop nesting levels.
Definition: CGLoopInfo.h:287
void setPipelineDisabled(bool S)
Set the pipeline disabled state.
Definition: CGLoopInfo.h:412
void setUnrollCount(unsigned C)
Set the unroll count for the next loop pushed.
Definition: CGLoopInfo.h:406
bool hasInfo() const
Returns true if there is LoopInfo on the stack.
Definition: CGLoopInfo.h:439
void setVectorizeWidth(unsigned W)
Set the vectorize width for the next loop pushed.
Definition: CGLoopInfo.h:352
void setSYCLLoopPipeliningDisable()
Set flag of disable_loop_pipelining for the next loop pushed.
Definition: CGLoopInfo.h:386
void setSYCLSpeculatedIterationsNIterations(unsigned C)
Set value of speculated iterations for the next loop pushed.
Definition: CGLoopInfo.h:396
void setDistributeState(bool Enable=true)
Set the next pushed loop as a distribution candidate.
Definition: CGLoopInfo.h:331
void setSYCLLoopPipeliningEnable()
Set flag of enable_loop_pipelining for the next loop pushed.
Definition: CGLoopInfo.h:434
void setParallel(bool Enable=true)
Set the next pushed loop as parallel.
Definition: CGLoopInfo.h:322
void push(llvm::BasicBlock *Header, clang::ASTContext &Ctx, const clang::CodeGenOptions &CGOpts, llvm::ArrayRef< const Attr * > Attrs, const llvm::DebugLoc &StartLoc, const llvm::DebugLoc &EndLoc, bool MustProgress=false)
Begin a new structured loop.
void setSYCLMaxReinvocationDelayNCycles(unsigned C)
Set value of max reinvocation delay for the next loop pushed.
Definition: CGLoopInfo.h:429
void setInterleaveCount(unsigned C)
Set the interleave count for the next loop pushed.
Definition: CGLoopInfo.h:359
void setSYCLMaxInterleavingNInvocations(unsigned C)
Set value of max interleaved invocations for the next loop pushed.
Definition: CGLoopInfo.h:391
void setUnrollState(const LoopAttributes::LVEnableState &State)
Set the next pushed loop unroll state.
Definition: CGLoopInfo.h:337
void setSYCLIntelFPGAVariantCount(const char *Var, unsigned int Count)
Set value of variant and loop count for the next loop pushed.
Definition: CGLoopInfo.h:401
void setSYCLIInterval(unsigned C)
Set value of an initiation interval for the next loop pushed.
Definition: CGLoopInfo.h:368
void setVectorizeScalable(const LoopAttributes::LVEnableState &State)
Definition: CGLoopInfo.h:354
void setVectorizePredicateState(const LoopAttributes::LVEnableState &State)
Set the next pushed vectorize predicate state.
Definition: CGLoopInfo.h:342
void setCodeAlign(unsigned C)
Set value of code align for the next loop pushed.
Definition: CGLoopInfo.h:423
void setSYCLMaxConcurrencyNThreads(unsigned C)
Set value of max_concurrency for the next loop pushed.
Definition: CGLoopInfo.h:371
void setSYCLLoopCoalesceEnable()
Set flag of loop_coalesce for the next loop pushed.
Definition: CGLoopInfo.h:376
void setSYCLNofusionEnable()
Set flag of nofusion for the next loop pushed.
Definition: CGLoopInfo.h:420
void push(llvm::BasicBlock *Header, const llvm::DebugLoc &StartLoc, const llvm::DebugLoc &EndLoc)
Begin a new structured loop.
void setSYCLLoopCoalesceNLevels(unsigned C)
Set value of coalesced levels for the next loop pushed.
Definition: CGLoopInfo.h:381
bool getCurLoopParallel() const
Return true if the top loop is parallel.
Definition: CGLoopInfo.h:313
void setMustProgress(bool P)
Set no progress for the next loop pushed.
Definition: CGLoopInfo.h:426
void setUnrollAndJamState(const LoopAttributes::LVEnableState &State)
Set the next pushed loop unroll_and_jam state.
Definition: CGLoopInfo.h:347
void setUnrollAndJamCount(unsigned C)
Set the unroll count for the next loop pushed.
Definition: CGLoopInfo.h:409
const LoopInfo & getInfo() const
Return the LoopInfo for the current loop.
Definition: CGLoopInfo.h:442
llvm::MDNode * getCurLoopID() const
Return the top loop id metadata.
Definition: CGLoopInfo.h:310
void setPipelineInitiationInterval(unsigned C)
Set the pipeline initiation interval.
Definition: CGLoopInfo.h:415
void setVectorizeEnable(bool Enable=true)
Set the next pushed loop 'vectorize.enable'.
Definition: CGLoopInfo.h:325
Information used when generating a structured loop.
Definition: CGLoopInfo.h:168
llvm::MDNode * getAccessGroup() const
Return this loop's access group or nullptr if it does not have one.
Definition: CGLoopInfo.h:185
const LoopInfo * getParent() const
Returns the first outer loop containing this loop if any, nullptr otherwise.
Definition: CGLoopInfo.h:196
llvm::BasicBlock * getHeader() const
Get the header block of this loop.
Definition: CGLoopInfo.h:179
const LoopAttributes & getAttributes() const
Get the set of attributes active for this loop.
Definition: CGLoopInfo.h:182
llvm::MDNode * getLoopID() const
Get the loop id metadata for this loop.
Definition: CGLoopInfo.h:176
Represent the declaration of a variable (in which case it is an lvalue) a function (in which case it ...
Definition: Decl.h:707
The JSON file list parser is used to communicate input to InstallAPI.
Diagnostic wrappers for TextAPI types for error reporting.
Definition: Dominators.h:30
decltype(Arrays) ::iterator getArrayPairItr(const ValueDecl *Array)
Definition: CGLoopInfo.h:84
bool hasArray(const ValueDecl *Array) const
Definition: CGLoopInfo.h:80
void eraseArray(const ValueDecl *Array)
Definition: CGLoopInfo.h:94
llvm::SmallVector< std::pair< const ValueDecl *, llvm::MDNode * >, 4 > Arrays
Definition: CGLoopInfo.h:74
bool isSafeLenGreaterOrEqual(unsigned OtherSL) const
Definition: CGLoopInfo.h:99
SYCLIVDepInfo(unsigned SL, const ValueDecl *A, llvm::MDNode *MD)
Definition: CGLoopInfo.h:76
Attributes that may be specified on loops.
Definition: CGLoopInfo.h:37
unsigned UnrollCount
llvm.unroll.
Definition: CGLoopInfo.h:143
bool MustProgress
Value for whether the loop is required to make progress.
Definition: CGLoopInfo.h:164
unsigned InterleaveCount
Value for llvm.loop.interleave.count metadata.
Definition: CGLoopInfo.h:66
LoopAttributes(bool IsParallel=false)
Definition: CGLoopInfo.cpp:647
llvm::SmallVector< SYCLIVDepInfo, 4 > ArraySYCLIVDepInfo
Definition: CGLoopInfo.h:109
unsigned SYCLLoopCoalesceNLevels
Value for llvm.loop.coalesce.count metadata.
Definition: CGLoopInfo.h:125
bool IsParallel
Generate llvm.loop.parallel metadata for loads and stores.
Definition: CGLoopInfo.h:42
bool SYCLLoopCoalesceEnable
Flag for llvm.loop.coalesce metadata.
Definition: CGLoopInfo.h:122
LVEnableState VectorizeScalable
Definition: CGLoopInfo.h:63
bool SYCLLoopPipeliningEnable
Flag for llvm.loop.intel.pipelining.enable, i32 1 metadata.
Definition: CGLoopInfo.h:140
llvm::SmallVector< std::pair< const char *, unsigned int >, 2 > SYCLIntelFPGAVariantCount
Value for count variant (min/max/avg) and count metadata.
Definition: CGLoopInfo.h:119
std::optional< unsigned > SYCLMaxReinvocationDelayNCycles
Definition: CGLoopInfo.h:137
LVEnableState UnrollAndJamEnable
Value for llvm.loop.unroll_and_jam.* metadata (enable, disable, or full).
Definition: CGLoopInfo.h:54
bool SYCLLoopPipeliningDisable
Flag for llvm.loop.intel.pipelining.enable, i32 0 metadata.
Definition: CGLoopInfo.h:128
std::optional< unsigned > SYCLSpeculatedIterationsNIterations
Value for llvm.loop.intel.speculated.iterations.count metadata.
Definition: CGLoopInfo.h:134
unsigned UnrollAndJamCount
llvm.unroll.
Definition: CGLoopInfo.h:146
std::optional< unsigned > SYCLMaxConcurrencyNThreads
Value for llvm.loop.max_concurrency.count metadata.
Definition: CGLoopInfo.h:115
LVEnableState
State of loop vectorization or unrolling.
Definition: CGLoopInfo.h:45
std::optional< unsigned > SYCLMaxInterleavingNInvocations
Value for llvm.loop.max_interleaving.count metadata.
Definition: CGLoopInfo.h:131
unsigned SYCLIInterval
Value for llvm.loop.ii.count metadata.
Definition: CGLoopInfo.h:112
LVEnableState VectorizePredicateEnable
Value for llvm.loop.vectorize.predicate metadata.
Definition: CGLoopInfo.h:57
LVEnableState DistributeEnable
Value for llvm.loop.distribute.enable metadata.
Definition: CGLoopInfo.h:149
bool PipelineDisabled
Value for llvm.loop.pipeline.disable metadata.
Definition: CGLoopInfo.h:152
unsigned CodeAlign
Value for 'llvm.loop.align' metadata.
Definition: CGLoopInfo.h:161
bool SYCLNofusionEnable
Flag for llvm.loop.fusion.disable metatdata.
Definition: CGLoopInfo.h:158
std::optional< SYCLIVDepInfo > GlobalSYCLIVDepInfo
Definition: CGLoopInfo.h:106
LVEnableState UnrollEnable
Value for llvm.loop.unroll.* metadata (enable, disable, or full).
Definition: CGLoopInfo.h:51
unsigned VectorizeWidth
Value for llvm.loop.vectorize.width metadata.
Definition: CGLoopInfo.h:60
unsigned PipelineInitiationInterval
Value for llvm.loop.pipeline.iicount metadata.
Definition: CGLoopInfo.h:155
LVEnableState VectorizeEnable
Value for llvm.loop.vectorize.enable metadata.
Definition: CGLoopInfo.h:48