aboutsummaryrefslogtreecommitdiff
path: root/llvm/lib/CodeGen/MachineScheduler.cpp
diff options
context:
space:
mode:
authorPhilip Reames <preames@rivosinc.com>2025-04-18 07:46:31 -0700
committerGitHub <noreply@github.com>2025-04-18 07:46:31 -0700
commitf2ecd86e34ed5323f2a8ec2259f11e9f5e9bb078 (patch)
tree7c3310d587f14854bbe6e39a4b7fdc1b214657bb /llvm/lib/CodeGen/MachineScheduler.cpp
parentdda4b968e77e1bb2c319bf2d523de3b5c4ccbb23 (diff)
downloadllvm-f2ecd86e34ed5323f2a8ec2259f11e9f5e9bb078.zip
llvm-f2ecd86e34ed5323f2a8ec2259f11e9f5e9bb078.tar.gz
llvm-f2ecd86e34ed5323f2a8ec2259f11e9f5e9bb078.tar.bz2
[Analysis] Remove implicit LocationSize conversion from uint64_t (#133342)
This change removes the uint64_t constructor on LocationSize preventing implicit conversion, and fixes up the using APIs to adapt to the change. Note that I'm adding a couple of explicit conversion points on routines where passing in a fixed offset as an integer seems likely to have well understood semantics. We had an unfortunate case which arose if you tried to pass a TypeSize value to a parameter of LocationSize type. We'd find the implicit conversion path through TypeSize -> uint64_t -> LocationSize which works just fine for fixed values, but looses information and fails assertions if the TypeSize was scalable. This change breaks the first link in that implicit conversion chain since that seemed to be the easier one.
Diffstat (limited to 'llvm/lib/CodeGen/MachineScheduler.cpp')
-rw-r--r--llvm/lib/CodeGen/MachineScheduler.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/llvm/lib/CodeGen/MachineScheduler.cpp b/llvm/lib/CodeGen/MachineScheduler.cpp
index 97f2727..0c3ffb1 100644
--- a/llvm/lib/CodeGen/MachineScheduler.cpp
+++ b/llvm/lib/CodeGen/MachineScheduler.cpp
@@ -2106,7 +2106,7 @@ void BaseMemOpClusterMutation::collectMemOpRecords(
SmallVector<const MachineOperand *, 4> BaseOps;
int64_t Offset;
bool OffsetIsScalable;
- LocationSize Width = 0;
+ LocationSize Width = LocationSize::precise(0);
if (TII->getMemOperandsWithOffsetWidth(MI, BaseOps, Offset,
OffsetIsScalable, Width, TRI)) {
if (!Width.hasValue())