[all-commits] [llvm/llvm-project] 970796: [ConstraintElim] Handle single And/Or as exit cond...

Florian Hahn via All-commits all-commits at lists.llvm.org
Mon Sep 7 01:28:09 PDT 2026


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 9707960f6f229118dc4500e5c3f1be239fd7efb2
      https://github.com/llvm/llvm-project/commit/9707960f6f229118dc4500e5c3f1be239fd7efb2
  Author: Florian Hahn <flo at fhahn.com>
  Date:   2026-09-07 (Mon, 07 Sep 2026)

  Changed paths:
    M llvm/lib/Transforms/Scalar/ConstraintElimination.cpp
    M llvm/test/Transforms/ConstraintElimination/and-implied-by-operands.ll
    A llvm/test/Transforms/ConstraintElimination/induction-exit-condition-or-and.ll

  Log Message:
  -----------
  [ConstraintElim] Handle single And/Or as exit condition in loop. (#221228)

In some cases, exits conditions in the loop are And/Or of and IV-based
condition and another condition. If the loop continues only if all
conditions are true (AND + true successor is the header, OR + false
successor is the header), we can still use the IV based condition to
bound the IV.

For now, just peels a single AND/OR.

This enables folds in a few additional cases:
https://github.com/dtcxzyw/llvm-opt-benchmark-nightly/pull/1193.

PR: https://github.com/llvm/llvm-project/pull/221228



To unsubscribe from these emails, change your notification settings at https://github.com/llvm/llvm-project/settings/notifications


More information about the All-commits mailing list