[llvm] VectorCombine: fix logical error after m_Trunc match (PR #91201)

Simon Pilgrim via llvm-commits llvm-commits at lists.llvm.org
Mon May 6 10:31:03 PDT 2024


================
@@ -1961,15 +1961,14 @@ bool VectorCombine::foldTruncFromReductions(Instruction &I) {
   if (!match(ReductionSrc, m_OneUse(m_Trunc(m_Value(TruncSrc)))))
     return false;
 
-  auto *Trunc = cast<CastInst>(ReductionSrc);
----------------
RKSimon wrote:

dyn_cast instead?

https://github.com/llvm/llvm-project/pull/91201


More information about the llvm-commits mailing list