[ConstraintElimination] Fix undefined behaviour in shl decomposition
authorZain Jaffal <z_jaffal@apple.com>
Thu, 9 Mar 2023 18:16:19 +0000 (18:16 +0000)
committerZain Jaffal <z_jaffal@apple.com>
Thu, 9 Mar 2023 18:17:27 +0000 (18:17 +0000)
commit7faa8c6ec6d4518663f49b0298c1762d90cb14f5
tree4464836383500b84b78a17bee268aed035e674c2
parent4fa3cc6eb402a42bd8c677c285155237276c0f09
[ConstraintElimination] Fix undefined behaviour in shl decomposition

Add checks to prevent decomposing constants bigger than 64.
relates to https://github.com/llvm/llvm-project/issues/61127

Reviewed By: fhahn

Differential Revision: https://reviews.llvm.org/D145677
llvm/lib/Transforms/Scalar/ConstraintElimination.cpp
llvm/test/Transforms/ConstraintElimination/shl.ll