[llvm] 50f4168 - [GlobalISel] Fix implementation of CheckNumOperandsLE/GE

via llvm-commits llvm-commits at lists.llvm.org
Mon Aug 12 00:18:18 PDT 2024


Author: pvanhout
Date: 2024-08-12T09:18:12+02:00
New Revision: 50f4168e40790bd91123824ee338643ac18ccc0b

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

LOG: [GlobalISel] Fix implementation of CheckNumOperandsLE/GE

The condition was backwards - it was rejecting when the condition was met.

Fixes #102719

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 5a5a750ac6b4a..9f8eb030a96c6 100644
--- a/llvm/include/llvm/CodeGen/GlobalISel/GIMatchTableExecutorImpl.h
+++ b/llvm/include/llvm/CodeGen/GlobalISel/GIMatchTableExecutorImpl.h
@@ -320,7 +320,7 @@ bool GIMatchTableExecutor::executeMatchTable(
                              << "], Expected=" << Expected << ")\n");
       assert(State.MIs[InsnID] != nullptr && "Used insn before defined");
       const unsigned NumOps = State.MIs[InsnID]->getNumOperands();
-      if (IsLE ? (NumOps <= Expected) : (NumOps >= Expected)) {
+      if (IsLE ? (NumOps > Expected) : (NumOps < Expected)) {
         if (handleReject() == RejectAndGiveUp)
           return false;
       }


        


More information about the llvm-commits mailing list