diff options
author | Youngsuk Kim <youngsuk.kim@hpe.com> | 2023-06-23 21:52:43 -0400 |
---|---|---|
committer | JOE1994 <joseph942010@gmail.com> | 2023-06-23 22:32:29 -0400 |
commit | d22a236ae72157fa0309d98ca244f387d66f3532 (patch) | |
tree | 99fd20bfea28296b6e0e0d7f9201395213b189f2 /llvm/lib/CodeGen/ExpandMemCmp.cpp | |
parent | 91ae1f5d08d98daae2122b0ab3779b8e1603a045 (diff) | |
download | llvm-d22a236ae72157fa0309d98ca244f387d66f3532.zip llvm-d22a236ae72157fa0309d98ca244f387d66f3532.tar.gz llvm-d22a236ae72157fa0309d98ca244f387d66f3532.tar.bz2 |
[llvm] Replace use of Type::getPointerTo() (NFC)
Partial progress towards replacing in-tree uses of
`Type::getPointerTo()`.
If `getPointerTo()` is used solely to support an unnecessary bitcast,
remove the bitcast.
Reviewed By: barannikov88, nikic
Differential Revision: https://reviews.llvm.org/D153307
Diffstat (limited to 'llvm/lib/CodeGen/ExpandMemCmp.cpp')
-rw-r--r-- | llvm/lib/CodeGen/ExpandMemCmp.cpp | 10 |
1 files changed, 2 insertions, 8 deletions
diff --git a/llvm/lib/CodeGen/ExpandMemCmp.cpp b/llvm/lib/CodeGen/ExpandMemCmp.cpp index 6ebcc4f..500f31b 100644 --- a/llvm/lib/CodeGen/ExpandMemCmp.cpp +++ b/llvm/lib/CodeGen/ExpandMemCmp.cpp @@ -288,17 +288,11 @@ MemCmpExpansion::LoadPair MemCmpExpansion::getLoadPair(Type *LoadSizeType, Align RhsAlign = RhsSource->getPointerAlignment(DL); if (OffsetBytes > 0) { auto *ByteType = Type::getInt8Ty(CI->getContext()); - LhsSource = Builder.CreateConstGEP1_64( - ByteType, Builder.CreateBitCast(LhsSource, ByteType->getPointerTo()), - OffsetBytes); - RhsSource = Builder.CreateConstGEP1_64( - ByteType, Builder.CreateBitCast(RhsSource, ByteType->getPointerTo()), - OffsetBytes); + LhsSource = Builder.CreateConstGEP1_64(ByteType, LhsSource, OffsetBytes); + RhsSource = Builder.CreateConstGEP1_64(ByteType, RhsSource, OffsetBytes); LhsAlign = commonAlignment(LhsAlign, OffsetBytes); RhsAlign = commonAlignment(RhsAlign, OffsetBytes); } - LhsSource = Builder.CreateBitCast(LhsSource, LoadSizeType->getPointerTo()); - RhsSource = Builder.CreateBitCast(RhsSource, LoadSizeType->getPointerTo()); // Create a constant or a load from the source. Value *Lhs = nullptr; |