[all-commits] [llvm/llvm-project] 8fc0ac: [SCEV] Support larger than 64-bit types in ashr(ad...
Björn Pettersson via All-commits
all-commits at lists.llvm.org
Wed Nov 8 02:29:27 PST 2023
Branch: refs/heads/main
Home: https://github.com/llvm/llvm-project
Commit: 8fc0aca5d1c12482d72fc412cea975de330a78b4
https://github.com/llvm/llvm-project/commit/8fc0aca5d1c12482d72fc412cea975de330a78b4
Author: Björn Pettersson <bjorn.a.pettersson at ericsson.com>
Date: 2023-11-08 (Wed, 08 Nov 2023)
Changed paths:
M llvm/lib/Analysis/ScalarEvolution.cpp
M llvm/test/Analysis/ScalarEvolution/sext-add-inreg.ll
Log Message:
-----------
[SCEV] Support larger than 64-bit types in ashr(add(shl(x, n), c), m) (#71600)
In commit 5a9a02f67b771fb2edcf06 scalar evolution got support for
computing SCEV:s for (ashr(add(shl(x, n), c), m)) constructs. The code
however used APInt::getZExtValue without first checking that the APInt
would fit inside an uint64_t. When for example using 128-bit types we
ended up in assertion failures (or maybe miscompiles in non-assert
builds).
This patch simply avoid converting from APInt to uint64_t when creating
the truncated constant. We can just truncate the APInt instead.
More information about the All-commits
mailing list