diff options
author | Hari Limaye <hari.limaye@arm.com> | 2024-10-31 12:22:15 +0000 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-10-31 12:22:15 +0000 |
commit | b396921d0c7d9ad396a1ee6ac85d0dbda965699f (patch) | |
tree | b8e0f1b6329149f38ffc69828d7a0d73590dfa71 /llvm/lib/Transforms/Utils/SCCPSolver.cpp | |
parent | b185e925ada76e639f5d5eecd6c0a71a0f38235a (diff) | |
download | llvm-b396921d0c7d9ad396a1ee6ac85d0dbda965699f.zip llvm-b396921d0c7d9ad396a1ee6ac85d0dbda965699f.tar.gz llvm-b396921d0c7d9ad396a1ee6ac85d0dbda965699f.tar.bz2 |
[SCCP] Handle llvm.vscale intrinsic calls (#114033)
Teach SCCP to compute a constant range for calls to llvm.vscale
intrinsics.
Diffstat (limited to 'llvm/lib/Transforms/Utils/SCCPSolver.cpp')
-rw-r--r-- | llvm/lib/Transforms/Utils/SCCPSolver.cpp | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/llvm/lib/Transforms/Utils/SCCPSolver.cpp b/llvm/lib/Transforms/Utils/SCCPSolver.cpp index c65710e..4225e7e 100644 --- a/llvm/lib/Transforms/Utils/SCCPSolver.cpp +++ b/llvm/lib/Transforms/Utils/SCCPSolver.cpp @@ -1923,6 +1923,12 @@ void SCCPInstVisitor::handleCallResult(CallBase &CB) { return (void)mergeInValue(IV, &CB, CopyOfVal); } + if (II->getIntrinsicID() == Intrinsic::vscale) { + unsigned BitWidth = CB.getType()->getScalarSizeInBits(); + const ConstantRange Result = getVScaleRange(II->getFunction(), BitWidth); + return (void)mergeInValue(II, ValueLatticeElement::getRange(Result)); + } + if (ConstantRange::isIntrinsicSupported(II->getIntrinsicID())) { // Compute result range for intrinsics supported by ConstantRange. // Do this even if we don't know a range for all operands, as we may |