diff options
author | David Zarzycki <dave@znu.io> | 2019-10-28 14:39:40 +0200 |
---|---|---|
committer | David Zarzycki <dave@znu.io> | 2019-10-30 09:12:57 +0200 |
commit | f68925d45083407e6bf322a7ee18d85c83c001ce (patch) | |
tree | 9511b8e26bca526b9ef5dc24df8dba35858d9e25 /llvm/lib/CodeGen/ExpandMemCmp.cpp | |
parent | 1e589f67ef726ecfa1135750c557d4c8f95b71cd (diff) | |
download | bcm5719-llvm-f68925d45083407e6bf322a7ee18d85c83c001ce.tar.gz bcm5719-llvm-f68925d45083407e6bf322a7ee18d85c83c001ce.zip |
[X86] Make memcmp vector lowering handle arbitrary expansions
Teach combineVectorSizedSetCCEquality() to handle arbitrary memcmp
expansions but do not change any default policy for now.
This also fixes a bug in the memcmp expansion itself when large
displacements are needed.
https://reviews.llvm.org/D69507
Diffstat (limited to 'llvm/lib/CodeGen/ExpandMemCmp.cpp')
-rw-r--r-- | llvm/lib/CodeGen/ExpandMemCmp.cpp | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/llvm/lib/CodeGen/ExpandMemCmp.cpp b/llvm/lib/CodeGen/ExpandMemCmp.cpp index 9916f2de041..0539db58a61 100644 --- a/llvm/lib/CodeGen/ExpandMemCmp.cpp +++ b/llvm/lib/CodeGen/ExpandMemCmp.cpp @@ -264,9 +264,9 @@ Value *MemCmpExpansion::getPtrToElementAtOffset(Value *Source, uint64_t OffsetBytes) { if (OffsetBytes > 0) { auto *ByteType = Type::getInt8Ty(CI->getContext()); - Source = Builder.CreateGEP( + Source = Builder.CreateConstGEP1_64( ByteType, Builder.CreateBitCast(Source, ByteType->getPointerTo()), - ConstantInt::get(ByteType, OffsetBytes)); + OffsetBytes); } return Builder.CreateBitCast(Source, LoadSizeType->getPointerTo()); } |