diff options
author | Paul Walker <paul.walker@arm.com> | 2025-06-10 12:35:59 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2025-06-10 12:35:59 +0100 |
commit | f43aaf90df6153f39c6cfd3471fec5dea1a0b650 (patch) | |
tree | f08d983d42fde0e83eaa0334d081418ff73a108e /llvm/lib/Transforms/Utils/ScalarEvolutionExpander.cpp | |
parent | a08bf50ccf95ab89a5e1252be87c4cf093ce3b60 (diff) | |
download | llvm-f43aaf90df6153f39c6cfd3471fec5dea1a0b650.zip llvm-f43aaf90df6153f39c6cfd3471fec5dea1a0b650.tar.gz llvm-f43aaf90df6153f39c6cfd3471fec5dea1a0b650.tar.bz2 |
[NFC][LLVM] Refactor IRBuilder::Create{VScale,ElementCount,TypeSize}. (#142803)
CreateVScale took a scaling parameter that had a single use outside of
IRBuilder with all other callers having to create a redundant
ConstantInt. To work round this some code perferred to use
CreateIntrinsic directly.
This patch simplifies CreateVScale to return a call to the llvm.vscale()
intrinsic and nothing more. As well as simplifying the existing call
sites I've also migrated the uses of CreateIntrinsic.
Whilst IRBuilder used CreateVScale's scaling parameter as part of the
implementations of CreateElementCount and CreateTypeSize, I have
follow-on work to switch them to the NUW varaiety and thus they would
stop using CreateVScale's scaling as well. To prepare for this I have
moved the multiplication and constant folding into the implementations
of CreateElementCount and CreateTypeSize.
As a final step I have replaced some callers of CreateVScale with
CreateElementCount where it's clear from the code they wanted the
latter.
Diffstat (limited to 'llvm/lib/Transforms/Utils/ScalarEvolutionExpander.cpp')
-rw-r--r-- | llvm/lib/Transforms/Utils/ScalarEvolutionExpander.cpp | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/llvm/lib/Transforms/Utils/ScalarEvolutionExpander.cpp b/llvm/lib/Transforms/Utils/ScalarEvolutionExpander.cpp index 88d2eca..70afd41 100644 --- a/llvm/lib/Transforms/Utils/ScalarEvolutionExpander.cpp +++ b/llvm/lib/Transforms/Utils/ScalarEvolutionExpander.cpp @@ -1440,7 +1440,7 @@ Value *SCEVExpander::visitSequentialUMinExpr(const SCEVSequentialUMinExpr *S) { } Value *SCEVExpander::visitVScale(const SCEVVScale *S) { - return Builder.CreateVScale(ConstantInt::get(S->getType(), 1)); + return Builder.CreateVScale(S->getType()); } Value *SCEVExpander::expandCodeFor(const SCEV *SH, Type *Ty, |