Skip to content

[SYCL][FPGA] Enable a set of loop attributes #1312

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 4 commits into from
Mar 26, 2020
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions clang/lib/CodeGen/CGLoopInfo.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -535,6 +535,8 @@ MDNode *LoopInfo::createMetadata(
LoopProperties.push_back(MDNode::get(Ctx, Vals));
}

// disable_loop_pipelining attribute corresponds to
// 'llvm.loop.intel.pipelining.enable, i32 0' metadata
if (Attrs.SYCLLoopPipeliningDisable) {
Metadata *Vals[] = {MDString::get(Ctx, "llvm.loop.intel.pipelining.enable"),
ConstantAsMetadata::get(
Expand Down
4 changes: 2 additions & 2 deletions clang/test/SemaSYCL/intel-fpga-loops.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -261,7 +261,7 @@ void zoo() {
}

// Test for Intel FPGA loop attributes compatibility
void woo() {
void loop_attrs_compatibility() {
int a[10];
// no diagnostics are expected
[[intelfpga::disable_loop_pipelining]]
Expand Down Expand Up @@ -364,7 +364,7 @@ int main() {
boo();
goo();
zoo();
woo();
loop_attrs_compatibility();
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can't stop laughing on this test: "foo, boo, goo. zoo... loop_attrs_compatibility" :)

ivdep_dependent<4, 2, 1>();
//expected-note@-1 +{{in instantiation of function template specialization}}
ivdep_dependent<2, 4, -1>();
Expand Down