diff options
Diffstat (limited to 'llvm/lib/Transforms/Scalar/GVN.cpp')
-rw-r--r-- | llvm/lib/Transforms/Scalar/GVN.cpp | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/llvm/lib/Transforms/Scalar/GVN.cpp b/llvm/lib/Transforms/Scalar/GVN.cpp index 116dc69b372..7e937bf954a 100644 --- a/llvm/lib/Transforms/Scalar/GVN.cpp +++ b/llvm/lib/Transforms/Scalar/GVN.cpp @@ -1598,11 +1598,6 @@ bool GVN::processNonLocalLoad(LoadInst *LI) { if (LI->getParent()->getParent()->hasFnAttribute(Attribute::SanitizeAddress)) return false; - // This code hasn't been audited for atomic, ordered, or volatile memory - // access. - if (!LI->isSimple()) - return false; - // Step 1: Find the non-local dependencies of the load. LoadDepVect Deps; MD->getNonLocalPointerDependency(LI, Deps); @@ -1669,6 +1664,11 @@ bool GVN::processNonLocalLoad(LoadInst *LI) { return true; } + // This code hasn't been audited for atomic, ordered, or volatile memory + // access. + if (!LI->isSimple()) + return false; + // Step 4: Eliminate partial redundancy. if (!EnablePRE || !EnableLoadPRE) return false; |