diff options
author | Philip Reames <listmail@philipreames.com> | 2019-09-10 21:12:29 +0000 |
---|---|---|
committer | Philip Reames <listmail@philipreames.com> | 2019-09-10 21:12:29 +0000 |
commit | 1e1db800487cbaf96e8f7809e3df42ba979c121d (patch) | |
tree | dbbbe3f0f5f91f2db38effd71ac89eef916c8f1b /llvm/lib/Transforms | |
parent | 699bea494c01fffe351223d8064ed8a091b13957 (diff) | |
download | bcm5719-llvm-1e1db800487cbaf96e8f7809e3df42ba979c121d.tar.gz bcm5719-llvm-1e1db800487cbaf96e8f7809e3df42ba979c121d.zip |
[ValueTracking] Factor our common speculation suppression logic [NFC]
Expose a utility function so that all places which want to suppress speculation (when otherwise legal) due to ordering and/or sanitizer interaction can do so.
llvm-svn: 371556
Diffstat (limited to 'llvm/lib/Transforms')
-rw-r--r-- | llvm/lib/Transforms/Vectorize/LoopVectorizationLegality.cpp | 15 |
1 files changed, 0 insertions, 15 deletions
diff --git a/llvm/lib/Transforms/Vectorize/LoopVectorizationLegality.cpp b/llvm/lib/Transforms/Vectorize/LoopVectorizationLegality.cpp index fe1e978a20d..3b3e055f01c 100644 --- a/llvm/lib/Transforms/Vectorize/LoopVectorizationLegality.cpp +++ b/llvm/lib/Transforms/Vectorize/LoopVectorizationLegality.cpp @@ -969,21 +969,6 @@ static bool isDereferenceableAndAlignedInLoop(LoadInst *LI, Loop *L, DL, HeaderFirstNonPHI, &DT); } -/// Return true if speculation of the given load must be suppressed for -/// correctness reasons. If not suppressed, dereferenceability and alignment -/// must be proven. -/// TODO: Move to ValueTracking.h/cpp in a separate change -static bool mustSuppressSpeculation(const LoadInst &LI) { - if (!LI.isUnordered()) - return true; - const Function &F = *LI.getFunction(); - // Speculative load may create a race that did not exist in the source. - return F.hasFnAttribute(Attribute::SanitizeThread) || - // Speculative load may load data from dirty regions. - F.hasFnAttribute(Attribute::SanitizeAddress) || - F.hasFnAttribute(Attribute::SanitizeHWAddress); -} - bool LoopVectorizationLegality::canVectorizeWithIfConvert() { if (!EnableIfConversion) { reportVectorizationFailure("If-conversion is disabled", |