File tree Expand file tree Collapse file tree 1 file changed +15
-0
lines changed Expand file tree Collapse file tree 1 file changed +15
-0
lines changed Original file line number Diff line number Diff line change @@ -475,6 +475,21 @@ bool AMDGPURegBankLegalize::runOnMachineFunction(MachineFunction &MF) {
475475 Combiner.tryCombineCopy (MI);
476476 continue ;
477477 }
478+ if (MI.getOpcode () == AMDGPU::G_TRUNC) {
479+ Register Dst = MI.getOperand (0 ).getReg ();
480+ Register Src = MI.getOperand (1 ).getReg ();
481+ auto *SrcDefMI = MRI.getVRegDef (Src);
482+ if (MRI.getType (Dst) != LLT::scalar (1 ) || !MRI.use_empty (Dst))
483+ continue ;
484+
485+ if (SrcDefMI->getOpcode () == AMDGPU::G_UADDO ||
486+ SrcDefMI->getOpcode () == AMDGPU::G_USUBO ||
487+ SrcDefMI->getOpcode () == AMDGPU::G_UADDE ||
488+ SrcDefMI->getOpcode () == AMDGPU::G_USUBE) {
489+ MI.eraseFromParent ();
490+ continue ;
491+ }
492+ }
478493 if (MI.getOpcode () == AMDGPU::G_ANYEXT) {
479494 Combiner.tryCombineS1AnyExt (MI);
480495 continue ;
You can’t perform that action at this time.
0 commit comments