github-actions[bot] wrote: <!--LLVM CODE FORMAT COMMENT: {clang-format}-->
:warning: C/C++ code formatter, clang-format found issues in your code. :warning: <details> <summary> You can test this locally with the following command: </summary> ``````````bash git-clang-format --diff 399b9973e9f788a58c7476925a85f090d673ca0f 9ba01338705902014ddf5f6d4285cd0563ce1e28 --extensions h,cpp -- llvm/lib/Target/AMDGPU/AMDGPU.h llvm/lib/Target/AMDGPU/AMDGPUTargetMachine.cpp llvm/lib/Target/AMDGPU/GCNCreateVOPD.cpp `````````` </details> <details> <summary> View the diff from clang-format here. </summary> ``````````diff diff --git a/llvm/lib/Target/AMDGPU/AMDGPU.h b/llvm/lib/Target/AMDGPU/AMDGPU.h index f208a8bb99..f331f741e3 100644 --- a/llvm/lib/Target/AMDGPU/AMDGPU.h +++ b/llvm/lib/Target/AMDGPU/AMDGPU.h @@ -360,7 +360,8 @@ public: class GCNCreateVOPDPass : public PassInfoMixin<GCNCreateVOPDPass> { public: - PreservedAnalyses run(MachineFunction &MF, MachineFunctionAnalysisManager &AM); + PreservedAnalyses run(MachineFunction &MF, + MachineFunctionAnalysisManager &AM); }; FunctionPass *createAMDGPUAnnotateUniformValuesLegacy(); diff --git a/llvm/lib/Target/AMDGPU/GCNCreateVOPD.cpp b/llvm/lib/Target/AMDGPU/GCNCreateVOPD.cpp index 614262e817..b58511cafb 100644 --- a/llvm/lib/Target/AMDGPU/GCNCreateVOPD.cpp +++ b/llvm/lib/Target/AMDGPU/GCNCreateVOPD.cpp @@ -49,56 +49,59 @@ private: MachineInstr *SecondMI; }; -public: - const GCNSubtarget *ST = nullptr; - - bool doReplace(const SIInstrInfo *SII, VOPDCombineInfo &CI) { - auto *FirstMI = CI.FirstMI; - auto *SecondMI = CI.SecondMI; - unsigned Opc1 = FirstMI->getOpcode(); - unsigned Opc2 = SecondMI->getOpcode(); - unsigned EncodingFamily = - AMDGPU::getVOPDEncodingFamily(SII->getSubtarget()); - int NewOpcode = - AMDGPU::getVOPDFull(AMDGPU::getVOPDOpcode(Opc1), - AMDGPU::getVOPDOpcode(Opc2), EncodingFamily); - assert(NewOpcode != -1 && - "Should have previously determined this as a possible VOPD\n"); - - auto VOPDInst = BuildMI(*FirstMI->getParent(), FirstMI, - FirstMI->getDebugLoc(), SII->get(NewOpcode)) - .setMIFlags(FirstMI->getFlags() | SecondMI->getFlags()); - - namespace VOPD = AMDGPU::VOPD; - MachineInstr *MI[] = {FirstMI, SecondMI}; - auto InstInfo = - AMDGPU::getVOPDInstInfo(FirstMI->getDesc(), SecondMI->getDesc()); - - for (auto CompIdx : VOPD::COMPONENTS) { - auto MCOprIdx = InstInfo[CompIdx].getIndexOfDstInMCOperands(); - VOPDInst.add(MI[CompIdx]->getOperand(MCOprIdx)); - } - - for (auto CompIdx : VOPD::COMPONENTS) { - auto CompSrcOprNum = InstInfo[CompIdx].getCompSrcOperandsNum(); - for (unsigned CompSrcIdx = 0; CompSrcIdx < CompSrcOprNum; ++CompSrcIdx) { - auto MCOprIdx = InstInfo[CompIdx].getIndexOfSrcInMCOperands(CompSrcIdx); + public: + const GCNSubtarget *ST = nullptr; + + bool doReplace(const SIInstrInfo *SII, VOPDCombineInfo &CI) { + auto *FirstMI = CI.FirstMI; + auto *SecondMI = CI.SecondMI; + unsigned Opc1 = FirstMI->getOpcode(); + unsigned Opc2 = SecondMI->getOpcode(); + unsigned EncodingFamily = + AMDGPU::getVOPDEncodingFamily(SII->getSubtarget()); + int NewOpcode = + AMDGPU::getVOPDFull(AMDGPU::getVOPDOpcode(Opc1), + AMDGPU::getVOPDOpcode(Opc2), EncodingFamily); + assert(NewOpcode != -1 && + "Should have previously determined this as a possible VOPD\n"); + + auto VOPDInst = + BuildMI(*FirstMI->getParent(), FirstMI, FirstMI->getDebugLoc(), + SII->get(NewOpcode)) + .setMIFlags(FirstMI->getFlags() | SecondMI->getFlags()); + + namespace VOPD = AMDGPU::VOPD; + MachineInstr *MI[] = {FirstMI, SecondMI}; + auto InstInfo = + AMDGPU::getVOPDInstInfo(FirstMI->getDesc(), SecondMI->getDesc()); + + for (auto CompIdx : VOPD::COMPONENTS) { + auto MCOprIdx = InstInfo[CompIdx].getIndexOfDstInMCOperands(); VOPDInst.add(MI[CompIdx]->getOperand(MCOprIdx)); } - } - SII->fixImplicitOperands(*VOPDInst); - for (auto CompIdx : VOPD::COMPONENTS) - VOPDInst.copyImplicitOps(*MI[CompIdx]); + for (auto CompIdx : VOPD::COMPONENTS) { + auto CompSrcOprNum = InstInfo[CompIdx].getCompSrcOperandsNum(); + for (unsigned CompSrcIdx = 0; CompSrcIdx < CompSrcOprNum; + ++CompSrcIdx) { + auto MCOprIdx = + InstInfo[CompIdx].getIndexOfSrcInMCOperands(CompSrcIdx); + VOPDInst.add(MI[CompIdx]->getOperand(MCOprIdx)); + } + } + + SII->fixImplicitOperands(*VOPDInst); + for (auto CompIdx : VOPD::COMPONENTS) + VOPDInst.copyImplicitOps(*MI[CompIdx]); - LLVM_DEBUG(dbgs() << "VOPD Fused: " << *VOPDInst << " from\tX: " - << *CI.FirstMI << "\tY: " << *CI.SecondMI << "\n"); + LLVM_DEBUG(dbgs() << "VOPD Fused: " << *VOPDInst << " from\tX: " + << *CI.FirstMI << "\tY: " << *CI.SecondMI << "\n"); - for (auto CompIdx : VOPD::COMPONENTS) - MI[CompIdx]->eraseFromParent(); + for (auto CompIdx : VOPD::COMPONENTS) + MI[CompIdx]->eraseFromParent(); - ++NumVOPDCreated; - return true; + ++NumVOPDCreated; + return true; } bool run(MachineFunction &MF) { @@ -173,8 +176,9 @@ public: } // namespace -PreservedAnalyses llvm::GCNCreateVOPDPass::run(MachineFunction &MF, - MachineFunctionAnalysisManager &AM) { +PreservedAnalyses +llvm::GCNCreateVOPDPass::run(MachineFunction &MF, + MachineFunctionAnalysisManager &AM) { if (!GCNCreateVOPD().run(MF)) return PreservedAnalyses::all(); return getMachineFunctionPassPreservedAnalyses().preserveSet<CFGAnalyses>(); `````````` </details> https://github.com/llvm/llvm-project/pull/130059 _______________________________________________ llvm-branch-commits mailing list llvm-branch-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits