Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[ValueTracking] Avoid blind cast from Operator to Instruction
Summary: Avoid blind cast from Operator to ExtractElementInst in computeKnownBitsFromOperator. This resulted in some crashes in downstream fuzzy testing. Instead we use getOperand directly on the Operator when accessing the vector/index operands. Haven't seen any problems with InsertElement and ShuffleVector, but I believe those could be used in constant expressions as well. So the same kind of fix as for ExtractElement was also applied for InsertElement. When it comes to ShuffleVector we now simply bail out if a dynamic cast of the Operator to ShuffleVectorInst fails. I've got no reproducer indicating problems for ShuffleVector, and a fix would be slightly more complicated as getShuffleDemandedElts is involved. Reviewers: RKSimon, nikic, spatel, efriedma Reviewed By: RKSimon Subscribers: hiraditya, llvm-commits Tags: #llvm Differential Revision: https://reviews.llvm.org/D76564
- Loading branch information