[llvm] bff94a8 - [LoopIdiomRecognize] Remove unnecessary MaybeAlign use (NFC)
Nikita Popov via llvm-commits
llvm-commits at lists.llvm.org
Fri Jun 5 14:12:08 PDT 2020
Author: Nikita Popov
Date: 2020-06-05T23:11:57+02:00
New Revision: bff94a8e2bb93267a561ca96287f570af499b090
URL: https://github.com/llvm/llvm-project/commit/bff94a8e2bb93267a561ca96287f570af499b090
DIFF: https://github.com/llvm/llvm-project/commit/bff94a8e2bb93267a561ca96287f570af499b090.diff
LOG: [LoopIdiomRecognize] Remove unnecessary MaybeAlign use (NFC)
Loads and stores always have an alignment now.
Added:
Modified:
llvm/lib/Transforms/Scalar/LoopIdiomRecognize.cpp
Removed:
################################################################################
diff --git a/llvm/lib/Transforms/Scalar/LoopIdiomRecognize.cpp b/llvm/lib/Transforms/Scalar/LoopIdiomRecognize.cpp
index 5b93aad11e14..a20f369b69f8 100644
--- a/llvm/lib/Transforms/Scalar/LoopIdiomRecognize.cpp
+++ b/llvm/lib/Transforms/Scalar/LoopIdiomRecognize.cpp
@@ -1109,11 +1109,9 @@ bool LoopIdiomRecognize::processLoopStoreOfLoopLoad(StoreInst *SI,
else {
// We cannot allow unaligned ops for unordered load/store, so reject
// anything where the alignment isn't at least the element size.
- const MaybeAlign StoreAlign = SI->getAlign();
- const MaybeAlign LoadAlign = LI->getAlign();
- if (StoreAlign == None || LoadAlign == None)
- return false;
- if (*StoreAlign < StoreSize || *LoadAlign < StoreSize)
+ const Align StoreAlign = SI->getAlign();
+ const Align LoadAlign = LI->getAlign();
+ if (StoreAlign < StoreSize || LoadAlign < StoreSize)
return false;
// If the element.atomic memcpy is not lowered into explicit
@@ -1127,7 +1125,7 @@ bool LoopIdiomRecognize::processLoopStoreOfLoopLoad(StoreInst *SI,
// Note that unordered atomic loads/stores are *required* by the spec to
// have an alignment but non-atomic loads/stores may not.
NewCall = Builder.CreateElementUnorderedAtomicMemCpy(
- StoreBasePtr, *StoreAlign, LoadBasePtr, *LoadAlign, NumBytes,
+ StoreBasePtr, StoreAlign, LoadBasePtr, LoadAlign, NumBytes,
StoreSize);
}
NewCall->setDebugLoc(SI->getDebugLoc());
More information about the llvm-commits
mailing list