[llvm] [SCEVDivision] Add SCEVDivisionPrinterPass with corresponding tests (PR #155832)
Ryotaro Kasuga via llvm-commits
llvm-commits at lists.llvm.org
Thu Aug 28 06:51:20 PDT 2025
================
@@ -0,0 +1,210 @@
+; NOTE: Assertions have been autogenerated by utils/update_analyze_test_checks.py
+; RUN: opt < %s "-passes=print<scev-division>" -disable-output 2>&1 | FileCheck %s
+
+define i8 @add(i8 %x, i8 %y) {
+; CHECK-LABEL: 'add'
+; CHECK-NEXT: Instruction: %div = sdiv i8 %add, %y
+; CHECK-NEXT: Numerator: (%x + %y)
+; CHECK-NEXT: Denominator: %y
+; CHECK-NEXT: Quotient: 1
+; CHECK-NEXT: Remainder: %x
+;
+ %add = add i8 %x, %y
+ %div = sdiv i8 %add, %y
+ ret i8 %div
+}
----------------
kasuga-fj wrote:
I'm not confident whether `nsw` on `add` is necessary...
https://github.com/llvm/llvm-project/pull/155832
More information about the llvm-commits
mailing list