Skip to content

Commit

Permalink
[scev-aa] Make TypeSize -> uint64_t conversion explicit
Browse files Browse the repository at this point in the history
Some versions of MSVC have issues with the implicit conversion, and it
also makes it clearer what's going on (the current code doesn't handle
scalable vectors)
  • Loading branch information
d0k committed Oct 26, 2023
1 parent 0c6759b commit 80ff42b
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions llvm/lib/Analysis/ScalarEvolutionAliasAnalysis.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -55,10 +55,10 @@ AliasResult SCEVAAResult::alias(const MemoryLocation &LocA,
if (canComputePointerDiff(SE, AS, BS)) {
unsigned BitWidth = SE.getTypeSizeInBits(AS->getType());
APInt ASizeInt(BitWidth, LocA.Size.hasValue()
? LocA.Size.getValue()
? static_cast<uint64_t>(LocA.Size.getValue())
: MemoryLocation::UnknownSize);
APInt BSizeInt(BitWidth, LocB.Size.hasValue()
? LocB.Size.getValue()
? static_cast<uint64_t>(LocB.Size.getValue())
: MemoryLocation::UnknownSize);

// Compute the difference between the two pointers.
Expand Down

0 comments on commit 80ff42b

Please sign in to comment.