aboutsummaryrefslogtreecommitdiff
path: root/llvm/lib/CodeGen/CodeGenPrepare.cpp
diff options
context:
space:
mode:
authorSanjay Patel <spatel@rotateright.com>2017-06-07 12:44:36 +0000
committerSanjay Patel <spatel@rotateright.com>2017-06-07 12:44:36 +0000
commitab0ecc00b740a9204c403f6933dd0469d28166d0 (patch)
tree6a81caffe8fe79f93a610bc3f9c1c58837f2f4a4 /llvm/lib/CodeGen/CodeGenPrepare.cpp
parent0b4190a9d61ffe22b14881fabc3fe7f463074581 (diff)
downloadllvm-ab0ecc00b740a9204c403f6933dd0469d28166d0.zip
llvm-ab0ecc00b740a9204c403f6933dd0469d28166d0.tar.gz
llvm-ab0ecc00b740a9204c403f6933dd0469d28166d0.tar.bz2
[CGP] fix formatting in MemCmpExpansion; NFC
llvm-svn: 304903
Diffstat (limited to 'llvm/lib/CodeGen/CodeGenPrepare.cpp')
-rw-r--r--llvm/lib/CodeGen/CodeGenPrepare.cpp14
1 files changed, 6 insertions, 8 deletions
diff --git a/llvm/lib/CodeGen/CodeGenPrepare.cpp b/llvm/lib/CodeGen/CodeGenPrepare.cpp
index 12b00ea..3da61ca 100644
--- a/llvm/lib/CodeGen/CodeGenPrepare.cpp
+++ b/llvm/lib/CodeGen/CodeGenPrepare.cpp
@@ -1742,7 +1742,7 @@ void MemCmpExpansion::createResultBlock() {
}
// This function creates the IR instructions for loading and comparing 1 byte.
-// It loads 1 byte from each source of the memcmp paramters with the given
+// It loads 1 byte from each source of the memcmp parameters with the given
// GEPIndex. It then subtracts the two loaded values and adds this result to the
// final phi node for selecting the memcmp result.
void MemCmpExpansion::emitLoadCompareByteBlock(unsigned Index, int GEPIndex) {
@@ -2016,17 +2016,17 @@ void MemCmpExpansion::emitMemCmpResultBlock(bool IsLittleEndian) {
int MemCmpExpansion::calculateNumBlocks(unsigned Size) {
int NumBlocks = 0;
- bool haveOneByteLoad = false;
+ bool HaveOneByteLoad = false;
unsigned RemainingSize = Size;
unsigned LoadSize = MaxLoadSize;
while (RemainingSize) {
if (LoadSize == 1)
- haveOneByteLoad = true;
+ HaveOneByteLoad = true;
NumBlocks += RemainingSize / LoadSize;
RemainingSize = RemainingSize % LoadSize;
LoadSize = LoadSize / 2;
}
- NumBlocksNonOneByte = haveOneByteLoad ? (NumBlocks - 1) : NumBlocks;
+ NumBlocksNonOneByte = HaveOneByteLoad ? (NumBlocks - 1) : NumBlocks;
if (IsUsedForZeroCmp)
NumBlocks = NumBlocks / NumLoadsPerBlock +
@@ -2057,9 +2057,8 @@ Value *MemCmpExpansion::getMemCmpExpansionZeroCase(unsigned Size,
unsigned NumBytesProcessed = 0;
// This loop populates each of the LoadCmpBlocks with the IR sequence to
// handle multiple loads per block.
- for (unsigned i = 0; i < NumBlocks; ++i) {
+ for (unsigned i = 0; i < NumBlocks; ++i)
emitLoadCompareBlockMultipleLoads(i, Size, NumBytesProcessed);
- }
emitMemCmpResultBlock(IsLittleEndian);
return PhiRes;
@@ -2075,9 +2074,8 @@ Value *MemCmpExpansion::getMemCmpExpansion(bool IsLittleEndian) {
int LoadSize = MaxLoadSize;
int NumBytesToBeProcessed = Size;
- if (IsUsedForZeroCmp) {
+ if (IsUsedForZeroCmp)
return getMemCmpExpansionZeroCase(Size, IsLittleEndian);
- }
unsigned Index = 0;
// This loop calls emitLoadCompareBlock for comparing SizeVal bytes of the two