Skip to content

Commit bff94a8

Browse files
committed
[LoopIdiomRecognize] Remove unnecessary MaybeAlign use (NFC)
Loads and stores always have an alignment now.
1 parent 2dd83a9 commit bff94a8

File tree

1 file changed

+4
-6
lines changed

1 file changed

+4
-6
lines changed

llvm/lib/Transforms/Scalar/LoopIdiomRecognize.cpp

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1109,11 +1109,9 @@ bool LoopIdiomRecognize::processLoopStoreOfLoopLoad(StoreInst *SI,
11091109
else {
11101110
// We cannot allow unaligned ops for unordered load/store, so reject
11111111
// anything where the alignment isn't at least the element size.
1112-
const MaybeAlign StoreAlign = SI->getAlign();
1113-
const MaybeAlign LoadAlign = LI->getAlign();
1114-
if (StoreAlign == None || LoadAlign == None)
1115-
return false;
1116-
if (*StoreAlign < StoreSize || *LoadAlign < StoreSize)
1112+
const Align StoreAlign = SI->getAlign();
1113+
const Align LoadAlign = LI->getAlign();
1114+
if (StoreAlign < StoreSize || LoadAlign < StoreSize)
11171115
return false;
11181116

11191117
// If the element.atomic memcpy is not lowered into explicit
@@ -1127,7 +1125,7 @@ bool LoopIdiomRecognize::processLoopStoreOfLoopLoad(StoreInst *SI,
11271125
// Note that unordered atomic loads/stores are *required* by the spec to
11281126
// have an alignment but non-atomic loads/stores may not.
11291127
NewCall = Builder.CreateElementUnorderedAtomicMemCpy(
1130-
StoreBasePtr, *StoreAlign, LoadBasePtr, *LoadAlign, NumBytes,
1128+
StoreBasePtr, StoreAlign, LoadBasePtr, LoadAlign, NumBytes,
11311129
StoreSize);
11321130
}
11331131
NewCall->setDebugLoc(SI->getDebugLoc());

0 commit comments

Comments
 (0)