@@ -242,26 +242,24 @@ static void createEntryMD(Module &M, const uint64_t ShaderFlags,
242
242
// EntryPro.Entry is 0.
243
243
ShaderEntryMDInfo SEP (EntryProp, Ctx, MDAnalysisInfo.ShaderProfile ,
244
244
nullptr , 0 );
245
- MDTuple *EmptyMDT = SEP.getAsMetadata ();
246
- EntryFnMDNodes.emplace_back (EmptyMDT );
245
+ MDTuple *MDT = SEP.getAsMetadata ();
246
+ EntryFnMDNodes.emplace_back (MDT );
247
247
}
248
248
} break ;
249
249
case Triple::EnvironmentType::Compute: {
250
250
size_t NumEntries = MDAnalysisInfo.EntryPropertyVec .size ();
251
- if (NumEntries > 0 ) {
252
- assert (NumEntries == 1 &&
253
- " Compute shader: One and only one entry expected" );
254
- EntryProperties EntryProp = MDAnalysisInfo.EntryPropertyVec [0 ];
255
- // ShaderFlagsAnalysis pass needs to collect and provide ShaderFlags for
256
- // each entry function. Currently, even though the ShaderFlags value
257
- // provided by ShaderFlagsAnalysis pass is created by walking all the
258
- // function instructions of the module, it is sufficient to since there is
259
- // only one entry function in the module.
260
- ShaderEntryMDInfo SEP (EntryProp, Ctx, MDAnalysisInfo.ShaderProfile ,
261
- MDResources, ShaderFlags);
262
- MDTuple *EmptyMDT = SEP.getAsMetadata ();
263
- EntryFnMDNodes.emplace_back (EmptyMDT);
264
- }
251
+ assert (NumEntries == 1 &&
252
+ " Compute shader: One and only one entry expected" );
253
+ EntryProperties EntryProp = MDAnalysisInfo.EntryPropertyVec [0 ];
254
+ // ShaderFlagsAnalysis pass needs to collect and provide ShaderFlags for
255
+ // each entry function. Currently, even though the ShaderFlags value
256
+ // provided by ShaderFlagsAnalysis pass is created by walking all the
257
+ // function instructions of the module, it is sufficient to since there is
258
+ // only one entry function in the module.
259
+ ShaderEntryMDInfo SEP (EntryProp, Ctx, MDAnalysisInfo.ShaderProfile ,
260
+ MDResources, ShaderFlags);
261
+ MDTuple *MDT = SEP.getAsMetadata ();
262
+ EntryFnMDNodes.emplace_back (MDT);
265
263
break ;
266
264
}
267
265
case Triple::EnvironmentType::Amplification:
@@ -272,19 +270,17 @@ static void createEntryMD(Module &M, const uint64_t ShaderFlags,
272
270
case Triple::EnvironmentType::Geometry:
273
271
case Triple::EnvironmentType::Pixel: {
274
272
size_t NumEntries = MDAnalysisInfo.EntryPropertyVec .size ();
275
- if (NumEntries > 0 ) {
276
- assert (NumEntries == 1 && " non-lib profiles should only have one entry" );
277
- EntryProperties EntryProp = MDAnalysisInfo.EntryPropertyVec [0 ];
278
- // ShaderFlagsAnalysis pass needs to collect and provide ShaderFlags for
279
- // each entry function. Currently, even though the ShaderFlags value
280
- // provided by ShaderFlagsAnalysis pass is created by walking all the
281
- // function instructions of the module, it is sufficient to since there is
282
- // only one entry function in the module.
283
- ShaderEntryMDInfo SEP (EntryProp, Ctx, MDAnalysisInfo.ShaderProfile ,
284
- MDResources, ShaderFlags);
285
- MDTuple *EmptyMDT = SEP.getAsMetadata ();
286
- EntryFnMDNodes.emplace_back (EmptyMDT);
287
- }
273
+ assert (NumEntries == 1 && " non-lib profiles should only have one entry" );
274
+ EntryProperties EntryProp = MDAnalysisInfo.EntryPropertyVec [0 ];
275
+ // ShaderFlagsAnalysis pass needs to collect and provide ShaderFlags for
276
+ // each entry function. Currently, even though the ShaderFlags value
277
+ // provided by ShaderFlagsAnalysis pass is created by walking all the
278
+ // function instructions of the module, it is sufficient to since there is
279
+ // only one entry function in the module.
280
+ ShaderEntryMDInfo SEP (EntryProp, Ctx, MDAnalysisInfo.ShaderProfile ,
281
+ MDResources, ShaderFlags);
282
+ MDTuple *MDT = SEP.getAsMetadata ();
283
+ EntryFnMDNodes.emplace_back (MDT);
288
284
} break ;
289
285
default :
290
286
assert (0 && " invalid profile" );
0 commit comments