@@ -455,12 +455,6 @@ void CustomSafeOptPass::visitCallInst(CallInst& C)
455
455
break ;
456
456
}
457
457
458
- case GenISAIntrinsic::GenISA_ldrawvector_indexed:
459
- {
460
- visitLdRawVec (inst);
461
- break ;
462
- }
463
-
464
458
default :
465
459
break ;
466
460
}
@@ -1327,56 +1321,6 @@ void IGC::CustomSafeOptPass::visitLdptr(llvm::SamplerLoadIntrinsic* inst)
1327
1321
}
1328
1322
}
1329
1323
1330
-
1331
- void IGC::CustomSafeOptPass::visitLdRawVec (llvm::CallInst* inst)
1332
- {
1333
- // Try to optimize and remove vector ld raw and change to scalar ld raw
1334
-
1335
- // %a = call <4 x float> @llvm.genx.GenISA.ldrawvector.indexed.v4f32.p1441792f32(
1336
- // .....float addrspace(1441792) * %243, i32 %offset, i32 4, i1 false), !dbg !216
1337
- // %b = extractelement <4 x float> % 245, i32 0, !dbg !216
1338
-
1339
- // into
1340
-
1341
- // %new_offset = add i32 %offset, 0, !dbg !216
1342
- // %b = call float @llvm.genx.GenISA.ldraw.indexed.f32.p1441792f32.i32.i32.i1(
1343
- // .....float addrspace(1441792) * %251, i32 %new_offset, i32 4, i1 false)
1344
-
1345
- if (inst->hasOneUse () &&
1346
- isa<ExtractElementInst>(inst->user_back ()))
1347
- {
1348
- auto EE = cast<ExtractElementInst>(inst->user_back ());
1349
- if (auto constIndex = dyn_cast<ConstantInt>(EE->getIndexOperand ()))
1350
- {
1351
- llvm::IRBuilder<> builder (inst);
1352
-
1353
- llvm::SmallVector<llvm::Type*, 2 > ovldtypes{
1354
- EE->getType (), // float type
1355
- inst->getOperand (0 )->getType (),
1356
- };
1357
-
1358
- // For new_offset we need to take into acount the index of the Extract
1359
- // and convert it to bytes and add it to the existing offset
1360
- auto new_offset = constIndex->getZExtValue () * 4 ;
1361
-
1362
- llvm::SmallVector<llvm::Value*, 4 > new_args{
1363
- inst->getOperand (0 ),
1364
- builder.CreateAdd (inst->getOperand (1 ),builder.getInt32 ((unsigned )new_offset)),
1365
- inst->getOperand (2 ),
1366
- inst->getOperand (3 )
1367
- };
1368
-
1369
- Function* pLdraw_indexed_intrinsic = llvm::GenISAIntrinsic::getDeclaration (
1370
- inst->getModule (),
1371
- GenISAIntrinsic::GenISA_ldraw_indexed,
1372
- ovldtypes);
1373
-
1374
- llvm::Value* ldraw_indexed = builder.CreateCall (pLdraw_indexed_intrinsic, new_args, " " );
1375
- EE->replaceAllUsesWith (ldraw_indexed);
1376
- }
1377
- }
1378
- }
1379
-
1380
1324
void IGC::CustomSafeOptPass::visitSampleBptr (llvm::SampleIntrinsic* sampleInst)
1381
1325
{
1382
1326
// sampleB with bias_value==0 -> sample
0 commit comments