@@ -201,7 +201,6 @@ namespace {
201
201
private:
202
202
using ConvListT = std::array<llvm::Instruction *, vc::numRegCategories()>;
203
203
204
- bool commonUpSurface (BasicBlock *BB);
205
204
bool processFunction (Function *F);
206
205
bool fixCircularPhis (Function *F);
207
206
bool processValue (Value *V);
@@ -506,50 +505,6 @@ static bool commonUpPredicate(BasicBlock *BB) {
506
505
return Changed;
507
506
}
508
507
509
- /* **********************************************************************
510
- * isToSurfaceConversion : returns true if the input instruction is a
511
- * surface conversion intrinsic.
512
- */
513
- static bool isToSurfaceConversion (Instruction *I,
514
- const GenXLiveness *Liveness) {
515
- if (IntrinsicInst *IC = dyn_cast<IntrinsicInst>(I)) {
516
- unsigned IntrinsicID = vc::getAnyIntrinsicID (IC);
517
- if (IntrinsicID != GenXIntrinsic::genx_convert)
518
- return false ;
519
- if (auto LR = Liveness->getLiveRangeOrNull (I)) {
520
- auto Cat = LR->getCategory ();
521
- if (Cat == vc::RegCategory::Surface)
522
- return true ;
523
- }
524
- }
525
- return false ;
526
- }
527
-
528
- /* **********************************************************************
529
- * commonUpSurface : perform surface commoning to reduce number of
530
- * instructions to stop the surface conversion falling outside of the
531
- * register into which it points to avoid going out of spec (256). The
532
- * logic is applied within a basic block to avoid dramatic live ranges
533
- * increase.
534
- */
535
- bool GenXCategory::commonUpSurface (BasicBlock *BB) {
536
- bool Modified = false ;
537
- // Maps the original value to after-conversion value.
538
- SmallDenseMap<Value *, Value *> ConvMap;
539
- for (auto bi = BB->begin (), be = BB->end (); bi != be; ++bi) {
540
- Instruction *I = &*bi;
541
- if (!isToSurfaceConversion (I, Liveness))
542
- continue ;
543
- IGC_ASSERT (I->hasOneUse ());
544
- if (!ConvMap.insert ({I->getOperand (0 ), I}).second ) {
545
- Modified = true ;
546
- I->replaceAllUsesWith (ConvMap[I->getOperand (0 )]);
547
- ToErase.push_back (I);
548
- }
549
- }
550
- return Modified;
551
- }
552
-
553
508
/* **********************************************************************
554
509
* processFunction : run the category conversion pass for this Function
555
510
*
@@ -583,8 +538,6 @@ bool GenXCategory::processFunction(Function *F)
583
538
584
539
// This commons up constpred calls just loaded.
585
540
Modified |= commonUpPredicate (BB);
586
- // This commons up to-surface conversion calls.
587
- Modified |= commonUpSurface (BB);
588
541
589
542
// Erase instructions (and their live ranges) as requested by processValue.
590
543
for (unsigned i = 0 , e = ToErase.size (); i != e; ++i) {
0 commit comments