[llvm] Implement foldICmpRemConstant in InstCombineCompares (PR #77410)

Yingwei Zheng via llvm-commits llvm-commits at lists.llvm.org
Mon Jan 8 23:24:19 PST 2024


================
@@ -3708,7 +3748,12 @@ Instruction *InstCombinerImpl::foldICmpBinOpWithConstant(ICmpInst &Cmp,
   case Instruction::SRem:
     if (Instruction *I = foldICmpSRemConstant(Cmp, BO, C))
       return I;
+   [[fallthrough]]; 
+  case Instruction::URem:
----------------
dtcxzyw wrote:

Could you please add some tests?
You should add tests in the first commit. Then you should apply your code changes and show the test changes in the second commit.
Example: https://github.com/llvm/llvm-project/pull/76685/commits
**CAUTION:** Please generate check lines using `llvm/utils/update_test_checks.py`.


https://github.com/llvm/llvm-project/pull/77410


More information about the llvm-commits mailing list