[all-commits] [llvm/llvm-project] 9416b1: [InstCombine] Add missing constant check (#170068)

Yingwei Zheng via All-commits all-commits at lists.llvm.org
Sun Nov 30 23:21:08 PST 2025


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 9416b19e4f3b471216dcc3fcabac98f2a430faea
      https://github.com/llvm/llvm-project/commit/9416b19e4f3b471216dcc3fcabac98f2a430faea
  Author: Yingwei Zheng <dtcxzyw2333 at gmail.com>
  Date:   2025-12-01 (Mon, 01 Dec 2025)

  Changed paths:
    M llvm/lib/Transforms/InstCombine/InstCombineSelect.cpp
    M llvm/test/Transforms/InstCombine/saturating-add-sub.ll

  Log Message:
  -----------
  [InstCombine] Add missing constant check (#170068)

`cast<Constant>` is not guarded by a type check during canonicalization
of predicates. This patch adds a type check in the outer if to avoid the
crash. `dyn_cast` may introduce another nested if, so I just use
`isa<Constant>` instead.

Address the crash reported in
https://github.com/llvm/llvm-project/pull/153053#issuecomment-3593914124.



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