Skip to content

Commit b343f8f

Browse files
MrSidimsvladimirlaz
authored andcommitted
[SYCL] Fix metadata for Intel FPGA loop attributes
llvm.loop.[ii/max_concurrency] -> llvm.loop.[ii/max_concurrency].count Signed-off-by: Dmitry Sidorov <[email protected]>
1 parent c6776ee commit b343f8f

File tree

3 files changed

+8
-8
lines changed

3 files changed

+8
-8
lines changed

clang/lib/CodeGen/CGLoopInfo.cpp

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -422,7 +422,7 @@ MDNode *LoopInfo::createMetadata(
422422
// Setting ii attribute with an initiation interval
423423
if (Attrs.IInterval > 0) {
424424
LLVMContext &Ctx = Header->getContext();
425-
Metadata *Vals[] = {MDString::get(Ctx, "llvm.loop.ii"),
425+
Metadata *Vals[] = {MDString::get(Ctx, "llvm.loop.ii.count"),
426426
ConstantAsMetadata::get(ConstantInt::get(
427427
llvm::Type::getInt32Ty(Ctx), Attrs.IInterval))};
428428
LoopProperties.push_back(MDNode::get(Ctx, Vals));
@@ -431,7 +431,7 @@ MDNode *LoopInfo::createMetadata(
431431
// Setting max_concurrency attribute with number of threads
432432
if (Attrs.MaxConcurrencyNThreads > 0) {
433433
LLVMContext &Ctx = Header->getContext();
434-
Metadata *Vals[] = {MDString::get(Ctx, "llvm.loop.max_concurrency"),
434+
Metadata *Vals[] = {MDString::get(Ctx, "llvm.loop.max_concurrency.count"),
435435
ConstantAsMetadata::get(ConstantInt::get(
436436
llvm::Type::getInt32Ty(Ctx),
437437
Attrs.MaxConcurrencyNThreads))};
@@ -766,9 +766,9 @@ void LoopInfoStack::push(BasicBlock *Header, clang::ASTContext &Ctx,
766766
// 0 - 'llvm.loop.ivdep.enable' metadata will be emitted
767767
// n - 'llvm.loop.ivdep.safelen, i32 n' metadata will be emitted
768768
// For attribute ii:
769-
// n - 'llvm.loop.ii, i32 n' metadata will be emitted
769+
// n - 'llvm.loop.ii.count, i32 n' metadata will be emitted
770770
// For attribute max_concurrency:
771-
// n - 'llvm.loop.max_concurrency, i32 n' metadata will be emitted
771+
// n - 'llvm.loop.max_concurrency.count, i32 n' metadata will be emitted
772772
for (const auto *Attr : Attrs) {
773773
const IntelFPGAIVDepAttr *IntelFPGAIVDep =
774774
dyn_cast<IntelFPGAIVDepAttr>(Attr);

clang/lib/CodeGen/CGLoopInfo.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -63,10 +63,10 @@ struct LoopAttributes {
6363
/// Value for llvm.loop.ivdep.safelen metadata.
6464
unsigned IVDepSafelen;
6565

66-
/// Value for llvm.loop.ii metadata.
66+
/// Value for llvm.loop.ii.count metadata.
6767
unsigned IInterval;
6868

69-
/// Value for llvm.loop.max_concurrency metadata.
69+
/// Value for llvm.loop.max_concurrency.count metadata.
7070
unsigned MaxConcurrencyNThreads;
7171

7272
/// llvm.unroll.

clang/test/CodeGenSYCL/intel-fpga-loops.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ void boo() {
2424
}
2525

2626
// CHECK: ![[MD_C]] = distinct !{![[MD_C]], ![[MD_ii:[0-9]+]]}
27-
// CHECK-NEXT: ![[MD_ii]] = !{!"llvm.loop.ii", i32 2}
27+
// CHECK-NEXT: ![[MD_ii]] = !{!"llvm.loop.ii.count", i32 2}
2828
void goo() {
2929
int a[10];
3030
[[intelfpga::ii(2)]]
@@ -33,7 +33,7 @@ void goo() {
3333
}
3434

3535
// CHECK: ![[MD_D]] = distinct !{![[MD_D]], ![[MD_max_concurrency:[0-9]+]]}
36-
// CHECK-NEXT: ![[MD_max_concurrency]] = !{!"llvm.loop.max_concurrency", i32 2}
36+
// CHECK-NEXT: ![[MD_max_concurrency]] = !{!"llvm.loop.max_concurrency.count", i32 2}
3737
void zoo() {
3838
int a[10];
3939
[[intelfpga::max_concurrency(2)]]

0 commit comments

Comments
 (0)