[llvm] e33b07f - llvm-reduce: Inform MRI of used phys reg masks

Matt Arsenault via llvm-commits llvm-commits at lists.llvm.org
Thu Apr 14 17:52:14 PDT 2022


Author: Matt Arsenault
Date: 2022-04-14T20:52:05-04:00
New Revision: e33b07f8599523e1e39b20b134dfc870635353bc

URL: https://github.com/llvm/llvm-project/commit/e33b07f8599523e1e39b20b134dfc870635353bc
DIFF: https://github.com/llvm/llvm-project/commit/e33b07f8599523e1e39b20b134dfc870635353bc.diff

LOG: llvm-reduce: Inform MRI of used phys reg masks

I'm not sure how to directly observe this invisible cache for a test.

Added: 
    

Modified: 
    llvm/tools/llvm-reduce/ReducerWorkItem.cpp

Removed: 
    


################################################################################
diff  --git a/llvm/tools/llvm-reduce/ReducerWorkItem.cpp b/llvm/tools/llvm-reduce/ReducerWorkItem.cpp
index abfb82a31f91d..7d71d222ec171 100644
--- a/llvm/tools/llvm-reduce/ReducerWorkItem.cpp
+++ b/llvm/tools/llvm-reduce/ReducerWorkItem.cpp
@@ -35,6 +35,11 @@ static std::unique_ptr<MachineFunction> cloneMF(MachineFunction *SrcMF) {
     for (auto &SrcMI : SrcMBB) {
       for (unsigned I = 0, E = SrcMI.getNumOperands(); I < E; ++I) {
         auto &DMO = SrcMI.getOperand(I);
+        if (DMO.isRegMask()) {
+          DstMRI->addPhysRegsUsedFromRegMask(DMO.getRegMask());
+          continue;
+        }
+
         if (!DMO.isReg())
           continue;
         Register SrcReg = DMO.getReg();


        


More information about the llvm-commits mailing list