[llvm-branch-commits] [llvm] [SCEVDivision] Add assertion to check operand types match (NFCI) (PR #204146)
via llvm-branch-commits
llvm-branch-commits at lists.llvm.org
Tue Jun 16 06:36:03 PDT 2026
llvmorg-github-actions[bot] wrote:
<!--LLVM PR SUMMARY COMMENT-->
@llvm/pr-subscribers-llvm-analysis
Author: Ryotaro Kasuga (kasuga-fj)
<details>
<summary>Changes</summary>
Adding an assertion to verify that the operand types match would be useful, e.g., when investigating issues like #<!-- -->204066.
---
Full diff: https://github.com/llvm/llvm-project/pull/204146.diff
1 Files Affected:
- (modified) llvm/lib/Analysis/ScalarEvolutionDivision.cpp (+2)
``````````diff
diff --git a/llvm/lib/Analysis/ScalarEvolutionDivision.cpp b/llvm/lib/Analysis/ScalarEvolutionDivision.cpp
index 710473191f8c6..8bd5cb9d339b2 100644
--- a/llvm/lib/Analysis/ScalarEvolutionDivision.cpp
+++ b/llvm/lib/Analysis/ScalarEvolutionDivision.cpp
@@ -56,6 +56,8 @@ void SCEVDivision::divide(ScalarEvolution &SE, const SCEV *Numerator,
const SCEV *Denominator, const SCEV **Quotient,
const SCEV **Remainder) {
assert(Numerator && Denominator && "Uninitialized SCEV");
+ assert(Numerator->getType() == Denominator->getType() &&
+ "Numerator and Denominator must have the same type");
SCEVDivision D(SE, Numerator, Denominator);
``````````
</details>
https://github.com/llvm/llvm-project/pull/204146
More information about the llvm-branch-commits
mailing list