Lines Matching +full:polly +full:- +full:build
1 //===- CodeGeneration.cpp - Code generate the Scops using ISL. ---------======//
5 // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
7 //===----------------------------------------------------------------------===//
10 // back to LLVM-IR using the ISL code generator.
15 // the updated execution order. This clast is used to create new LLVM-IR that is
19 //===----------------------------------------------------------------------===//
21 #include "polly/CodeGen/CodeGeneration.h"
22 #include "polly/CodeGen/IRBuilder.h"
23 #include "polly/CodeGen/IslAst.h"
24 #include "polly/CodeGen/IslNodeBuilder.h"
25 #include "polly/CodeGen/PerfMonitor.h"
26 #include "polly/CodeGen/Utils.h"
27 #include "polly/DependenceInfo.h"
28 #include "polly/LinkAllPasses.h"
29 #include "polly/Options.h"
30 #include "polly/ScopInfo.h"
31 #include "polly/Support/ScopHelper.h"
49 using namespace polly;
51 #include "polly/Support/PollyDebug.h"
52 #define DEBUG_TYPE "polly-codegen"
54 static cl::opt<bool> Verify("polly-codegen-verify",
55 cl::desc("Verify the function generated by Polly"),
58 bool polly::PerfMonitoring;
61 XPerfMonitoring("polly-codegen-perf-monitoring",
62 cl::desc("Add run-time performance monitoring"), cl::Hidden,
63 cl::location(polly::PerfMonitoring),
73 namespace polly {
83 OrigTerminator->eraseFromParent();
85 } // namespace polly
101 llvm_unreachable("Polly generated function could not be verified. Add "
102 "-polly-codegen-verify=false to disable this assertion.");
146 for (auto *BB : R->blocks()) {
147 auto InstIt = BB->begin();
148 auto InstEnd = BB->end();
155 switch (IT->getIntrinsicID()) {
158 IT->eraseFromParent();
173 // Check whether IslAstInfo uses the same isl_ctx. Since -polly-codegen
204 assert(!R->isTopLevelRegion() && "Top level regions are not supported");
209 assert(R->isSimple());
212 PollyIRBuilder Builder(EnteringBB->getContext(), ConstantFolder(),
214 Builder.SetInsertPoint(EnteringBB->getTerminator());
216 // Only build the run-time condition and parameters _after_ having
228 auto *SplitBlock = StartBlock->getSinglePredecessor();
240 // loop when Polly is enabled.
247 PerfMonitor P(S, EnteringBB->getParent()->getParent());
249 P.insertRegionStart(SplitBlock->getTerminator());
251 BasicBlock *MergeBlock = ExitBlock->getUniqueSuccessor();
252 P.insertRegionEnd(MergeBlock->getTerminator());
257 // might reference the hoisted loads. Finally, build the runtime check
260 Builder.SetInsertPoint(SplitBlock->getTerminator());
265 auto *SplitBBTerm = Builder.GetInsertBlock()->getTerminator();
266 SplitBBTerm->setOperand(0, FalseI1);
270 auto *ExitingBlock = StartBlock->getUniqueSuccessor();
272 auto *MergeBlock = ExitingBlock->getUniqueSuccessor();
284 Builder.GetInsertBlock()->getTerminator()->setOperand(0, RTC);
291 // between polly.start and polly.exiting (at this point).
292 Builder.SetInsertPoint(StartBlock->getTerminator());
296 fixRegionInfo(*EnteringBB->getParent(), *R->getParent(), RI);
303 Function *F = EnteringBB->getParent();
310 F->addFnAttr("polly-optimized");
335 /// Generate LLVM-IR for the SCoP @p S.
381 Pass *polly::createCodeGenerationPass() { return new CodeGeneration(); }
383 INITIALIZE_PASS_BEGIN(CodeGeneration, "polly-codegen",
384 "Polly - Create LLVM-IR from SCoPs", false, false);
391 INITIALIZE_PASS_END(CodeGeneration, "polly-codegen",
392 "Polly - Create LLVM-IR from SCoPs", false, false)