[all-commits] [llvm/llvm-project] 26e34c: [IR] Handle vector tys in ConstantExpr::getIntrins...

Justin Lebar via All-commits all-commits at lists.llvm.org
Sun Jul 12 22:39:05 PDT 2026


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 26e34c6896626f0874a1eface84b8fb25111f4b0
      https://github.com/llvm/llvm-project/commit/26e34c6896626f0874a1eface84b8fb25111f4b0
  Author: Justin Lebar <justin.lebar at gmail.com>
  Date:   2026-07-12 (Sun, 12 Jul 2026)

  Changed paths:
    M llvm/lib/IR/Constants.cpp
    M llvm/test/Transforms/TailCallElim/accum_recursion.ll
    M llvm/test/Transforms/TailCallElim/tre-minmax-intrinsic.ll

  Log Message:
  -----------
  [IR] Handle vector tys in ConstantExpr::getIntrinsicIdentity for smin/max. (#208367)

The code was using getIntegerBitWidth() when it should have been using
getScalarSizeInBits().  This resulted in an assert in debug builds, and
who-knows-what in opt builds.

Reproducer:

```
  define <4 x i32> @f(<4 x i32> %a, i32 %b) {
    %c = call <4 x i32> @f(<4 x i32> %a, i32 %b)
    %m = call <4 x i32> @llvm.smax.v4i32(<4 x i32> %c, <4 x i32> %a)
    ret <4 x i32> %m
  }

  $ opt -passes=tailcallelim repro.ll
  Casting.h:572: Assertion `isa<To>(Val) && "cast<Ty>() argument of
  incompatible type!"' failed.
```

Bug found and fixed by Claude Mythos 5.



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