[llvm] b525430 - [GlobalISel] Fix GIM_CheckIsSameOperandIgnoreCopies

via llvm-commits llvm-commits at lists.llvm.org
Mon Jul 24 06:27:15 PDT 2023


Author: pvanhout
Date: 2023-07-24T15:27:10+02:00
New Revision: b5254300b4bc3fd988dbdb8506df7c574500c860

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

LOG: [GlobalISel] Fix GIM_CheckIsSameOperandIgnoreCopies

If the MI had more than one def it incorrectly returrned true.

Reviewed By: arsenm

Differential Revision: https://reviews.llvm.org/D156119

Added: 
    

Modified: 
    llvm/include/llvm/CodeGen/GlobalISel/GIMatchTableExecutorImpl.h

Removed: 
    


################################################################################
diff  --git a/llvm/include/llvm/CodeGen/GlobalISel/GIMatchTableExecutorImpl.h b/llvm/include/llvm/CodeGen/GlobalISel/GIMatchTableExecutorImpl.h
index e6ea7adfdbebbe..1d24563071cbb8 100644
--- a/llvm/include/llvm/CodeGen/GlobalISel/GIMatchTableExecutorImpl.h
+++ b/llvm/include/llvm/CodeGen/GlobalISel/GIMatchTableExecutorImpl.h
@@ -847,9 +847,8 @@ bool GIMatchTableExecutor::executeMatchTable(
 
       if (MatcherOpcode == GIM_CheckIsSameOperandIgnoreCopies) {
         if (Op.isReg() && OtherOp.isReg()) {
-          MachineInstr *MI = getDefIgnoringCopies(Op.getReg(), MRI);
-          MachineInstr *OtherMI = getDefIgnoringCopies(OtherOp.getReg(), MRI);
-          if (MI && MI == OtherMI)
+          if (getSrcRegIgnoringCopies(Op.getReg(), MRI) ==
+              getSrcRegIgnoringCopies(OtherOp.getReg(), MRI))
             break;
         }
       }


        


More information about the llvm-commits mailing list