Skip to content

Commit 34114bc

Browse files
krystian-andrzejewskiigcbot
authored andcommitted
Propagate intrinsic comments from the intrinsic definitions
This change is to address an issue relatd to no propagating intrinsic comments to GenIntrinsicDefinition.cpp.
1 parent 3326804 commit 34114bc

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

IGC/GenISAIntrinsics/generator/Intrinsic_generator.py

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -157,9 +157,6 @@ def get_prefix():
157157
return prefix
158158

159159
def generate_intrinsic_defintion_files(intrinsic_definitions : List[IntrinsicDefinition], output_directory : str, use_comments):
160-
161-
IntrinsicFormatter.use_comments = use_comments
162-
163160
intrinsic_ids = set()
164161
unique_intrinsic_definitions = []
165162
for intrinsic_def in intrinsic_definitions:
@@ -193,7 +190,7 @@ def generate_intrinsic_defintion_files(intrinsic_definitions : List[IntrinsicDef
193190
lookup=template_lookup)
194191
output_file_path = os.path.join(
195192
output_directory, from_template_name_to_destination_name(template.filename))
196-
write_to_file_using_template(output_file_path, template, intrinsic_definitions=intrinsic_definitions)
193+
write_to_file_using_template(output_file_path, template, intrinsic_definitions=intrinsic_definitions, use_comments=use_comments)
197194

198195
template = Template(filename=r'templates/GenIntrinsicLookupTable.h.mako',
199196
lookup=template_lookup)

IGC/GenISAIntrinsics/generator/templates/GenIntrinsicDefinition.cpp.mako

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,9 @@ namespace IGC
1313
<%!
1414
from Intrinsic_generator import IntrinsicFormatter
1515
%>\
16+
<%
17+
IntrinsicFormatter.use_comments=use_comments
18+
%>\
1619
% for el in intrinsic_definitions:
1720

1821
const char* IntrinsicDefinition<llvm::GenISAIntrinsic::ID::${el.name}>::scFunctionRootName =

0 commit comments

Comments
 (0)