aboutsummaryrefslogtreecommitdiff
path: root/llvm/lib/CodeGen/ExpandMemCmp.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'llvm/lib/CodeGen/ExpandMemCmp.cpp')
-rw-r--r--llvm/lib/CodeGen/ExpandMemCmp.cpp10
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;