File tree Expand file tree Collapse file tree 2 files changed +15
-0
lines changed
Expand file tree Collapse file tree 2 files changed +15
-0
lines changed Original file line number Diff line number Diff line change @@ -446,6 +446,11 @@ void CustomSafeOptPass::visitCallInst(CallInst& C)
446446 break ;
447447 }
448448
449+ case GenISAIntrinsic::GenISA_WaveShuffleIndex:
450+ {
451+ visitWaveShuffleIndex (inst);
452+ break ;
453+ }
449454 default :
450455 break ;
451456 }
@@ -1173,6 +1178,15 @@ void IGC::CustomSafeOptPass::visitLdptr(llvm::CallInst* inst)
11731178 }
11741179}
11751180
1181+ void IGC::CustomSafeOptPass::visitWaveShuffleIndex (llvm::CallInst* inst)
1182+ {
1183+ llvm::Constant* src1 = llvm::dyn_cast<llvm::Constant>(inst->getOperand (1 ));
1184+ llvm::Constant* src2 = llvm::dyn_cast<llvm::Constant>(inst->getOperand (2 ));
1185+ if (src1 && src2 && src1->isZeroValue () && src2->isZeroValue ())
1186+ {
1187+ inst->replaceAllUsesWith (inst->getOperand (0 ));
1188+ }
1189+ }
11761190
11771191void IGC::CustomSafeOptPass::visitLdRawVec (llvm::CallInst* inst)
11781192{
Original file line number Diff line number Diff line change @@ -82,6 +82,7 @@ namespace IGC
8282 void visitLdptr (llvm::CallInst* inst);
8383 void visitLdRawVec (llvm::CallInst* inst);
8484 void visitLoadInst (llvm::LoadInst& I);
85+ void visitWaveShuffleIndex (llvm::CallInst* inst);
8586
8687 //
8788 // IEEE Floating point arithmetic is not associative. Any pattern
You can’t perform that action at this time.
0 commit comments