llvm-project
26e34c68 - [IR] Handle vector tys in ConstantExpr::getIntrinsicIdentity for smin/max. (#208367)

Commit
80 days ago
[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.
Author
Parents
Loading