[PATCH] D98633: [LV] Move exact FP math check out of Requirements.
Florian Hahn via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Wed Mar 24 04:02:05 PDT 2021
This revision was automatically updated to reflect the committed changes.
Closed by commit rGcd0c00c9fe39: [LV] Move exact FP math check out of Requirements. (authored by fhahn).
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D98633/new/
https://reviews.llvm.org/D98633
Files:
llvm/include/llvm/Transforms/Vectorize/LoopVectorizationLegality.h
llvm/lib/Transforms/Vectorize/LoopVectorizationLegality.cpp
llvm/lib/Transforms/Vectorize/LoopVectorize.cpp
Index: llvm/lib/Transforms/Vectorize/LoopVectorize.cpp
===================================================================
--- llvm/lib/Transforms/Vectorize/LoopVectorize.cpp
+++ llvm/lib/Transforms/Vectorize/LoopVectorize.cpp
@@ -9599,6 +9599,21 @@
return false;
}
+ if (!Requirements.canVectorizeFPMath(Hints)) {
+ ORE->emit([&]() {
+ auto *ExactFPMathInst = Requirements.getExactFPInst();
+ return OptimizationRemarkAnalysisFPCommute(DEBUG_TYPE, "CantReorderFPOps",
+ ExactFPMathInst->getDebugLoc(),
+ ExactFPMathInst->getParent())
+ << "loop not vectorized: cannot prove it is safe to reorder "
+ "floating-point operations";
+ });
+ LLVM_DEBUG(dbgs() << "LV: loop not vectorized: cannot prove it is safe to "
+ "reorder floating-point operations\n");
+ Hints.emitRemarkWithHints();
+ return false;
+ }
+
bool UseInterleaved = TTI->enableInterleavedAccessVectorization();
InterleavedAccessInfo IAI(PSE, L, DT, LI, LVL.getLAI());
Index: llvm/lib/Transforms/Vectorize/LoopVectorizationLegality.cpp
===================================================================
--- llvm/lib/Transforms/Vectorize/LoopVectorizationLegality.cpp
+++ llvm/lib/Transforms/Vectorize/LoopVectorizationLegality.cpp
@@ -250,16 +250,6 @@
Function *F, Loop *L, const LoopVectorizeHints &Hints) {
const char *PassName = Hints.vectorizeAnalysisPassName();
bool Failed = false;
- if (ExactFPMathInst && !Hints.allowReordering()) {
- ORE.emit([&]() {
- return OptimizationRemarkAnalysisFPCommute(
- PassName, "CantReorderFPOps", ExactFPMathInst->getDebugLoc(),
- ExactFPMathInst->getParent())
- << "loop not vectorized: cannot prove it is safe to reorder "
- "floating-point operations";
- });
- Failed = true;
- }
// Test if runtime memcheck thresholds are exceeded.
bool PragmaThresholdReached =
Index: llvm/include/llvm/Transforms/Vectorize/LoopVectorizationLegality.h
===================================================================
--- llvm/include/llvm/Transforms/Vectorize/LoopVectorizationLegality.h
+++ llvm/include/llvm/Transforms/Vectorize/LoopVectorizationLegality.h
@@ -189,6 +189,11 @@
bool doesNotMeet(Function *F, Loop *L, const LoopVectorizeHints &Hints);
+ Instruction *getExactFPInst() { return ExactFPMathInst; }
+ bool canVectorizeFPMath(const LoopVectorizeHints &Hints) const {
+ return !ExactFPMathInst || Hints.allowReordering();
+ }
+
private:
unsigned NumRuntimePointerChecks = 0;
Instruction *ExactFPMathInst = nullptr;
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D98633.332935.patch
Type: text/x-patch
Size: 2730 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20210324/079666ed/attachment.bin>
More information about the llvm-commits
mailing list