├── .arcconfig ├── .arclint ├── .clang-format ├── .clang-tidy ├── .gitignore ├── .gitmodules ├── CMakeLists.txt ├── LLVMBuild.txt ├── README.md ├── cmake ├── FindIsl-cxx.cmake ├── FindIsl.cmake ├── FindLikwid.cmake ├── FindPapi.cmake ├── FindPolly.cmake ├── FindPqxx.cmake ├── FindPthread.cmake └── polli_macros.cmake ├── external └── catch │ └── include │ └── catch.hpp ├── include ├── CMakeLists.txt ├── polli │ ├── CMakeLists.txt │ ├── Caching.h │ ├── Compiler.h │ ├── ExportMetrics.h │ ├── FuncTools.h │ ├── FunctionCloner.h │ ├── InstrumentRegions.h │ ├── Jit.h │ ├── LikwidMarker.h │ ├── ModuleExtractor.h │ ├── Monitor.h │ ├── NonAffineSCEVs.h │ ├── Options.h │ ├── PapiProfiling.h │ ├── PolyJIT.h │ ├── ProfileScops.h │ ├── RegisterCompilationPasses.h │ ├── RunValues.h │ ├── RuntimeOptimizer.h │ ├── Schema.h │ ├── ScopDetection.h │ ├── Stats.h │ ├── Tasks.h │ ├── TypeMapper.h │ ├── Utils.h │ ├── VariantFunction.h │ └── log.h └── pprof │ ├── CMakeLists.txt │ ├── Config.h.cmake │ ├── Tracing.h │ ├── file.h │ ├── pgsql.h │ └── pprof.h ├── lib ├── Analysis │ ├── NonAffineSCEVs.cpp │ └── ScopDetection.cpp ├── CMakeLists.txt ├── Extract │ └── ModuleExtraction.cpp ├── LibPJIT │ ├── CMakeLists.txt │ ├── Compiler.cpp │ ├── ExportMetrics.cpp │ ├── Jit.cpp │ ├── RunValues.cpp │ └── libpjit.cpp ├── LibPPROF │ ├── CMakeLists.txt │ ├── README.md │ ├── Tracing.cpp │ ├── libpprof-file.cpp │ ├── libpprof-pgsql.cpp │ ├── libpprof.cpp │ └── pprof.cpp ├── Persist │ └── Schema.cpp ├── PolyJIT.cpp ├── RegisterCompilationPasses.cpp ├── Runtime │ ├── LikwidMarker.cpp │ ├── RuntimeOptimizer.cpp │ └── VariantFunction.cpp ├── Support │ ├── FuncTools.cpp │ ├── Log.cpp │ ├── Options.cpp │ ├── Stats.cpp │ ├── Tasks.cpp │ ├── TypeMapper.cpp │ └── Utils.cpp └── Transform │ ├── InstrumentRegions.cpp │ └── ProfileScops.cpp ├── test ├── CMakeLists.txt ├── Catch │ ├── CMakeLists.txt │ ├── CatchTests.cpp │ ├── test_RunValues.cpp │ └── test_RuntimeValues.cpp ├── Globals │ ├── global-int-var.c │ ├── global-multiple-structs.c │ └── global-struct-var.c ├── JitScops │ ├── linpack_daxpy_r_for.body.scop0.ll │ ├── linpack_daxpy_r_for.cond28.preheader.scop1.ll │ ├── linpack_daxpy_ur_for.body.scop1.ll │ ├── linpack_daxpy_ur_for.cond30.preheader.scop0.ll │ ├── linpack_ddot_r_for.cond21.preheader.scop1.ll │ ├── linpack_ddot_r_for.inc.scop0.ll │ ├── linpack_ddot_ur_for.cond23.preheader.scop0.ll │ ├── linpack_ddot_ur_for.inc.scop1.ll │ └── linpack_matgen_for.body36.scop0.ll ├── Run │ ├── 1-param.c │ ├── 1-struct-param.c │ ├── 2-struct-param.c │ └── ptr-param.c ├── Unit │ ├── CMakeLists.txt │ └── Schema.cpp ├── lit.cfg ├── lit.site.cfg.in └── pprof │ ├── 2mm │ └── main_for.body.15.i.pjit.scop.ll │ ├── 3mm │ └── main_for.body.16.i.pjit.scop.ll │ ├── 7z │ └── _ZNK8NArchive3N7z7CFolder14CheckStructureEj_for.cond.130.preheader.pjit.scop.ll │ ├── MultiSourceApplications │ ├── CalculateQuant8Param_for.cond.1.preheader.pjit.scop.ll │ ├── CalculateQuantParam_for.cond.1.preheader.pjit.scop.ll │ ├── bark_noise_hybridmp_for.end.194.pjit.scop.ll │ ├── dct_luma_16x16_for.cond.72.preheader.pjit.scop.ll │ ├── dpb_combine_field_for.cond.4.preheader.pjit.scop.ll │ ├── dradbg_for.body.537.lr.ph.pjit.scop.ll │ ├── ercPixConcealIMB_for.body.6.lr.ph.i.pjit.scop.ll │ ├── getVerSubImageSixTap_for.cond.199.preheader.pjit.scop.ll │ ├── initialize_board_for.cond.67.preheader.lr.ph.pjit.scop.ll │ ├── mix32_entry.split.pjit.scop.ll │ ├── unmix24_entry.split.pjit.scop.ll │ └── vexopy_entry.split.pjit.scop.ll │ ├── MultiSourceBenchmarks │ ├── Crystal_Cholesky_for.cond.107.preheader.pjit.scop.ll │ ├── Crystal_div_for.body.22.lr.ph.pjit.scop.ll │ ├── DoLUIteration_entry.split.pjit.scop.ll │ ├── HYPRE_StructDiagScale_for.body.429.lr.ph.us.us.pjit.scop.ll │ ├── JTTmtx_for.body.768.lr.ph.pjit.scop.ll │ ├── L3psycho_anal_for.end.1341.pjit.scop.ll │ ├── MSalignmm_rec_for.body.31.i.pjit.scop.ll │ ├── _Z8wavModelR5Mixer_for.body.402.us.pjit.scop.ll │ ├── _ZN17btSoftBodyHelpers11CreatePatchER19btSoftBodyWorldInfoRK9btVector3S4_S4_S4_iiib_for.body.lr.ph.pjit.scop.ll │ ├── _ZNK8NArchive3N7z7CFolder14CheckStructureEv_for.cond.123.preheader.pjit.scop.ll │ ├── begin_for.body.105.pjit.scop.ll │ ├── compute_next_for.body.33.lr.ph.pjit.scop.ll │ ├── compute_next_for.body.68.lr.ph.pjit.scop.ll │ ├── examboard_for.cond.2.preheader.pjit.scop.ll │ ├── form_component_prediction_for.cond.110.preheader.lr.ph.pjit.scop.ll │ ├── hypre_CyclicReduction_for.body.1455.lr.ph.us.us.pjit.scop.ll │ ├── hypre_PointRelax_for.body.1521.lr.ph.us.us.pjit.scop.ll │ ├── hypre_SMG2RAPPeriodicNoSym_for.body.229.lr.ph.us.us.pjit.scop.ll │ ├── hypre_SMG3RAPPeriodicSym_for.body.348.lr.ph.us.us.pjit.scop.ll │ ├── hypre_SMGAxpy_for.body.345.lr.ph.us.us.pjit.scop.ll │ ├── hypre_SMGResidual_for.body.314.lr.ph.us.us.pjit.scop.ll │ ├── hypre_SMGSetupInterpOp_for.body.442.lr.ph.us.us.pjit.scop.ll │ ├── hypre_SemiInterp_for.body.333.lr.ph.us.us.pjit.scop.ll │ ├── hypre_SemiRestrict_for.body.622.lr.ph.us.us.pjit.scop.ll │ ├── hypre_StructAxpy_for.body.307.lr.ph.us.us.pjit.scop.ll │ ├── hypre_StructCopy_for.body.307.lr.ph.us.us.pjit.scop.ll │ ├── hypre_StructMatrixSetBoxValues_for.body.385.lr.ph.us.us.pjit.scop.ll │ ├── hypre_StructMatvecCompute_for.body.1594.lr.ph.us.pjit.scop.ll │ ├── hypre_StructScale_for.body.184.lr.ph.us.us.pjit.scop.ll │ ├── hypre_StructVectorGetBoxValues_for.body.364.lr.ph.us.us.pjit.scop.ll │ ├── match_calc_for.body.31.pjit.scop.ll │ ├── mm_inner_for.cond.5.preheader.lr.ph.us.pjit.scop.ll │ ├── start_pass_1_quant_for.cond.2.preheader.i.i.pjit.scop.ll │ └── zurasu2_entry.split.pjit.scop.ll │ ├── Rasdaman │ ├── GDALCreateGeoLocTransformer_for.cond.42.preheader.i.pjit.scop.ll │ ├── _ZL11L1BInterpolPdiiii_entry.split.pjit.scop.ll │ ├── _ZN12GTiffDataset12VirtualMemIOE10GDALRWFlagiiiiPvii12GDALDataTypeiPixxxP20GDALRasterIOExtraArg_for.cond.471.preheader.pjit.scop.ll │ ├── _ZN14DTEDRasterBand10IReadBlockEiiPv_for.body.22.pjit.scop.ll │ ├── _ZN14OGRWarpedLayer17ReprojectEnvelopeEP11OGREnvelopeP27OGRCoordinateTransformation_for.cond.9.preheader.pjit.scop.ll │ ├── _ZN17VizGeorefSpline2D5solveEv_for.cond.139.preheader.i.pjit.scop.ll │ ├── _ZN6PCIDSK13CTiledChannel18RLEDecompressBlockERNS_12PCIDSKBufferES2__for.cond.preheader.pjit.scop.ll │ └── calccoef_for.body.101.lr.ph.i.pjit.scop.ll │ ├── SPEC2006 │ ├── BZ2_hbAssignCodes_for.body.3.lr.ph.us.pjit.scop.ll │ ├── FMX2Multiply_for.body.3.us.us.pjit.scop.ll │ ├── P9ZeroHMM_for.body.3.us.pjit.scop.ll │ ├── S_cl_and_if.then.pjit.scop.ll │ ├── _ZN14DoFRenumbering22compute_subdomain_wiseILi3EEEvRSt6vectorIjSaIjEERK10DoFHandlerIXT_EE_for.cond.28.preheader.lr.ph.pjit.scop.ll │ ├── _ZN20ComputeNonbondedUtil6selectEP13SimParametersP8MoleculeP7LJTable_for.body.61.lr.ph.pjit.scop.ll │ ├── _ZN6TensorILi4ELi3EEdVERKd_for.body.pjit.scop.ll │ ├── _ZNK10FullMatrixIdE5vmultIfEEvR6VectorIT_ERKS4_b_for.cond.715.preheader.lr.ph.pjit.scop.ll │ ├── _ZNK10FullMatrixIfE5vmultIfEEvR6VectorIT_ERKS4_b_for.cond.461.preheader.lr.ph.pjit.scop.ll │ ├── _ZNK18FunctionDerivativeILi3EE10value_listERKSt6vectorI5PointILi3EESaIS3_EERS1_IdSaIdEEj_for.body.65.lr.ph.pjit.scop.ll │ ├── compute_followup_influence_for.cond.119.preheader.pjit.scop.ll │ ├── dct_chroma_sp_for.cond.309.preheader.pjit.scop.ll │ ├── encode_one_macroblock_for.cond.3507.preheader.pjit.scop.ll │ ├── find_sad_16x16_for.cond.123.preheader.pjit.scop.ll │ ├── finish_and_score_game_for.body.4.lr.ph.us.pjit.scop.ll │ ├── init_regs_for.cond.116.preheader.i.pjit.scop.ll │ ├── owl_determine_life_for.body.181.lr.ph.us.pjit.scop.ll │ └── transformation_init_for.cond.1.preheader.pjit.scop.ll │ ├── SingleSourceBenchmarks │ ├── Bubble_while.body.3.preheader.pjit.scop.ll │ ├── Intmm_for.cond.1.preheader.pjit.scop.ll │ ├── Mm_for.cond.1.preheader.pjit.scop.ll │ ├── _ZNK15MatrixBenchmark9oop_styleEv_for.cond.2.preheader.pjit.scop.ll │ ├── eval_AtA_times_u_eval_A_times_u.exit.pjit.scop.ll │ ├── main_for.body.16.i.pjit.scop.ll │ ├── main_for.body.22.us.i.pjit.scop.ll │ ├── main_for.body.3.i.44.pjit.scop.ll │ ├── main_for.body.3.i.92.pjit.scop.ll │ ├── main_for.body.3.i.pjit.scop.ll │ ├── main_for.body.35.i.pjit.scop.ll │ ├── main_for.body.35.lr.ph.us.i.pjit.scop.ll │ ├── main_for.body.36.i.pjit.scop.ll │ ├── main_for.body.38.i.pjit.scop.ll │ ├── main_for.body.5.i.pjit.scop.ll │ ├── main_for.body.6.lr.ph.us.i.pjit.scop.ll │ ├── main_for.body.90.i.pjit.scop.ll │ ├── main_for.body.i.37.pjit.scop.ll │ ├── main_for.body.i.62.pjit.scop.ll │ ├── main_for.body.i.74.pjit.scop.ll │ ├── main_for.body.pjit.scop.ll │ ├── main_for.cond.1.preheader.i.24.pjit.scop.ll │ ├── main_for.cond.1.preheader.i.37.pjit.scop.ll │ ├── main_for.cond.1.preheader.i.40.pjit.scop.ll │ ├── main_for.cond.12.preheader.i.pjit.scop.ll │ ├── main_for.cond.12.preheader.pjit.scop.ll │ ├── main_for.cond.4.preheader.i.43.pjit.scop.ll │ ├── main_for.cond.7.preheader.i.pjit.scop.ll │ ├── main_for.cond.7.preheader.pjit.scop.ll │ └── main_for.cond.8.preheader.i.pjit.scop.ll │ ├── adi │ └── main_for.body.135.i.pjit.scop.ll │ ├── atax │ └── main_for.body.9.i.pjit.scop.ll │ ├── bicg │ └── main_for.body.8.i.133.pjit.scop.ll │ ├── bzip2 │ └── BZ2_hbAssignCodes_entry.split.pjit.scop.ll │ ├── cholesky │ └── main_for.cond.57.preheader.i.pjit.scop.ll │ ├── correlation │ └── main_for.body.104.i.pjit.scop.ll │ ├── covariance │ └── main_for.body.43.i.pjit.scop.ll │ ├── crafty │ └── InitializeKingSafety_for.cond.1.preheader.pjit.scop.ll │ ├── deriche │ └── main_for.cond.100.preheader.i.pjit.scop.ll │ ├── doitgen │ └── kernel_doitgen_for.body.11.us.us.pjit.scop.ll │ ├── fdtd-2d │ └── main_for.cond.7.preheader.i.140.pjit.scop.ll │ ├── ffmpeg │ ├── blend_multiply_for.cond.2.preheader.lr.ph.pjit.scop.ll │ ├── fade_samples_s16_for.body.us.pjit.scop.ll │ └── plot_cqt_for.body.399.pjit.scop.ll │ ├── gemm │ └── main_for.cond.6.preheader.i.129.pjit.scop.ll │ ├── gemver │ └── main_for.cond.10.preheader.i.pjit.scop.ll │ ├── gesummv │ └── main_for.body.i.142.pjit.scop.ll │ ├── gramschmidt │ └── main_for.body.41.i.pjit.scop.ll │ ├── heat-3d │ └── main_for.cond.6.preheader.i.120.pjit.scop.ll │ ├── jacobi-1d │ └── main_for.cond.2.preheader.i.pjit.scop.ll │ ├── jacobi-2d │ └── main_for.cond.4.preheader.i.105.pjit.scop.ll │ ├── lammps │ ├── _ZN9LAMMPS_NS11DeleteAtoms16recount_topologyEv_for.body.lr.ph.split.pjit.scop.ll │ └── _ZN9LAMMPS_NS8Variable12compute_atomEiiPdii_if.else.71.pjit.scop.ll │ ├── lapack │ ├── cchk3__for.body.363.lr.ph.pjit.scop.ll │ ├── dchk3__for.body.332.lr.ph.pjit.scop.ll │ ├── dmvch__for.body.us.pjit.scop.ll │ ├── f2c_cgemm_for.body.113.lr.ph.pjit.scop.ll │ ├── f2c_chemm_for.body.98.lr.ph.pjit.scop.ll │ ├── f2c_cher2k_for.cond.87.preheader.pjit.scop.ll │ ├── f2c_cherk_for.cond.67.preheader.pjit.scop.ll │ ├── f2c_csymm_for.body.98.lr.ph.pjit.scop.ll │ ├── f2c_csyr2k_for.body.100.lr.ph.pjit.scop.ll │ ├── f2c_csyrk_for.body.536.lr.ph.pjit.scop.ll │ ├── f2c_ctrmv_for.body.475.pjit.scop.ll │ ├── f2c_dgbmv_for.body.202.pjit.scop.ll │ ├── f2c_dgemm_for.body.190.lr.ph.pjit.scop.ll │ ├── f2c_dgemv_for.body.167.lr.ph.pjit.scop.ll │ ├── f2c_dsbmv_for.body.101.pjit.scop.ll │ ├── f2c_dsymm_for.body.280.pjit.scop.ll │ ├── f2c_dsymv_for.body.179.pjit.scop.ll │ ├── f2c_dsyr2k_for.cond.81.preheader.pjit.scop.ll │ ├── f2c_dsyrk_for.cond.69.preheader.pjit.scop.ll │ ├── f2c_dtbmv_for.body.244.pjit.scop.ll │ ├── f2c_dtbsv_for.body.236.pjit.scop.ll │ ├── f2c_dtrmm_for.body.186.pjit.scop.ll │ ├── f2c_dtrmv_for.body.201.lr.ph.pjit.scop.ll │ ├── f2c_dtrsm_for.body.212.pjit.scop.ll │ ├── f2c_dtrsv_for.body.200.lr.ph.pjit.scop.ll │ ├── f2c_sgbmv_for.body.202.pjit.scop.ll │ ├── f2c_sgemm_for.body.190.lr.ph.pjit.scop.ll │ ├── f2c_sgemv_for.body.167.lr.ph.pjit.scop.ll │ ├── f2c_ssbmv_for.body.101.pjit.scop.ll │ ├── f2c_ssymm_for.body.280.pjit.scop.ll │ ├── f2c_ssymv_for.body.179.pjit.scop.ll │ ├── f2c_ssyr2k_for.cond.81.preheader.pjit.scop.ll │ ├── f2c_ssyrk_for.cond.69.preheader.pjit.scop.ll │ ├── f2c_stbmv_for.body.244.pjit.scop.ll │ ├── f2c_stbsv_for.body.236.pjit.scop.ll │ ├── f2c_strmm_for.body.186.pjit.scop.ll │ ├── f2c_strmv_for.body.201.lr.ph.pjit.scop.ll │ ├── f2c_strsm_for.body.212.pjit.scop.ll │ ├── f2c_strsv_for.body.200.lr.ph.pjit.scop.ll │ ├── f2c_zgemm_for.body.113.lr.ph.pjit.scop.ll │ ├── f2c_zhemm_for.body.98.lr.ph.pjit.scop.ll │ ├── f2c_zher2k_for.cond.87.preheader.pjit.scop.ll │ ├── f2c_zherk_for.cond.67.preheader.pjit.scop.ll │ ├── f2c_zsymm_for.body.98.lr.ph.pjit.scop.ll │ ├── f2c_zsyr2k_for.body.100.lr.ph.pjit.scop.ll │ ├── f2c_zsyrk_for.body.536.lr.ph.pjit.scop.ll │ ├── schk3__for.body.332.lr.ph.pjit.scop.ll │ ├── smvch__for.body.us.pjit.scop.ll │ └── zchk3__for.body.363.lr.ph.pjit.scop.ll │ ├── linpack │ └── main_for.cond.33.preheader.i.40.i.pjit.scop.ll │ ├── lu │ └── main_for.cond.57.preheader.i.pjit.scop.ll │ ├── ludcmp │ └── main_for.cond.116.preheader.i.pjit.scop.ll │ ├── lulesh-omp │ └── main_for.body.187.lr.ph.pjit.scop.ll │ ├── lulesh │ └── main_for.body.187.lr.ph.pjit.scop.ll │ ├── mvt │ └── main_for.cond.24.preheader.i.pjit.scop.ll │ ├── nussinov │ └── main_for.body.6.us.i.pjit.scop.ll │ ├── python │ ├── PyBuffer_FillContiguousStrides_entry.split.pjit.scop.ll │ ├── PyUnknownEncodingHandler_cond.end.65.split.us.pjit.scop.ll │ ├── mpd_qformat_spec_for.body.51.lr.ph.us.i.pjit.scop.ll │ └── std_trans_for.body.us.pjit.scop.ll │ ├── ruby │ └── onigenc_unicode_get_case_fold_codes_by_str_for.body.165.lr.ph.us.us.pjit.scop.ll │ ├── symm │ └── main_for.cond.9.preheader.us.i.pjit.scop.ll │ ├── syr2k │ └── main_for.cond.17.preheader.i.pjit.scop.ll │ ├── syrk │ └── main_for.body.6.lr.ph.i.pjit.scop.ll │ ├── trisolv │ └── main_for.body.i.109.pjit.scop.ll │ ├── trmm │ └── main_for.body.10.lr.ph.us.i.pjit.scop.ll │ └── x264 │ ├── get_frame_for.body.6.lr.ph.us.i.359.i.pjit.scop.ll │ ├── pixel_ssd_nv12_core_for.body.4.lr.ph.us.pjit.scop.ll │ ├── x264_cabac_init_for.cond.8.preheader.pjit.scop.ll │ ├── x264_cqm_init_for.cond.463.preheader.pjit.scop.ll │ ├── x264_plane_copy_interleave_c_for.body.4.lr.ph.us.pjit.scop.ll │ └── x264_ratecontrol_new_for.body.225.us.i.pjit.scop.ll └── utils └── arcanist └── LitTestEngine ├── __phutil_library_init__.php ├── __phutil_library_map__.php └── src └── LitTestEngine.php /.arcconfig: -------------------------------------------------------------------------------- 1 | { 2 | "project_id" : "polli", 3 | "conduit_uri" : "https://phabricator.lairosiel.de", 4 | "history.immutable" : true, 5 | "load" : [ 6 | "utils/arcanist/LitTestEngine" 7 | ], 8 | "unit.engine" : "LitTestEngine" 9 | } 10 | -------------------------------------------------------------------------------- /.arclint: -------------------------------------------------------------------------------- 1 | { 2 | "linters": { 3 | "chmod": { 4 | "type": "chmod" 5 | }, 6 | "cpplint": { 7 | "include": "(include/polli/.+\\.h$|include/pprof/.+\\.h$|lib/.+\\.cpp$)", 8 | "type": "cpplint", 9 | "severity": { 10 | "runtime/int": "advice", 11 | "whitespace/comments": "advice", 12 | "whitespace/blank_line": "advice", 13 | "legal/copyright": "disabled" 14 | } 15 | }, 16 | "filename": { 17 | "exclude": "(www/experiments/.+|.*\\.jscop.*)", 18 | "type": "filename" 19 | }, 20 | "merge-conflict": { 21 | "type": "merge-conflict" 22 | }, 23 | "spelling": { 24 | "exclude": "(configure|autoconf/.*)", 25 | "type": "spelling" 26 | }, 27 | "clang-tidy": { 28 | "type": "script-and-regex", 29 | "script-and-regex.script": "clang-tidy -fix", 30 | "script-and-regex.regex": "/^(?P.+):(?P[0-9]+):(?P[0-9]+): (?Pwarning|error|advice):(?P.+) \\[(?P.+)\\]$/m" 31 | } 32 | } 33 | } 34 | -------------------------------------------------------------------------------- /.clang-format: -------------------------------------------------------------------------------- 1 | BasedOnStyle: LLVM 2 | 3 | -------------------------------------------------------------------------------- /.clang-tidy: -------------------------------------------------------------------------------- 1 | Checks: '-*, 2 | clang-diagnostic-*, 3 | llvm-*, 4 | misc-*, 5 | -misc-unused-parameters, 6 | readability-*, 7 | -readability-else-after*, 8 | -readability-simplify-boolean-expr, 9 | -readability-implicit-bool-cast, 10 | -readability-static-definition-in-anonymous-namespace, 11 | -readability-implicit-bool-conversion, 12 | cppcoreguidelines-*, 13 | -cppcoreguidelines-pro-bounds-array-to-pointer-decay, 14 | -cppcoreguidelines-owning-memory, 15 | bugprone-*, 16 | modernize-*, 17 | performance-*, 18 | clang-analyzer-*, 19 | ' 20 | CheckOptions: 21 | - key: readability-identifier-naming.ClassCase 22 | value: CamelCase 23 | - key: readability-identifier-naming.EnumCase 24 | value: CamelCase 25 | - key: readability-identifier-naming.FunctionCase 26 | value: camelBack, lower_case 27 | - key: readability-identifier-naming.MemberCase 28 | value: CamelCase 29 | - key: readability-identifier-naming.ParameterCase 30 | value: CamelCase 31 | - key: readability-identifier-naming.UnionCase 32 | value: CamelCase 33 | - key: readability-identifier-naming.VariableCase 34 | value: CamelCase 35 | - key: cppcoreguidelines-special-member-functions.AllowSoleDefaultDtor 36 | value: 1 37 | - key: cppcoreguidelines-special-member-functions.AllowMissingMoveFunctions 38 | value: 1 -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | .idea/ 2 | -------------------------------------------------------------------------------- /.gitmodules: -------------------------------------------------------------------------------- 1 | [submodule "external/spdlog"] 2 | path = external/spdlog 3 | url = https://github.com/gabime/spdlog 4 | [submodule "external/cppformat"] 5 | path = external/cppformat 6 | url = https://github.com/cppformat/cppformat 7 | [submodule "external/isl-cpp"] 8 | path = external/isl 9 | url = https://github.com/simbuerg/isl-cpp.git 10 | [submodule "external/abseil"] 11 | path = external/abseil 12 | url = https://github.com/abseil/abseil-cpp 13 | [submodule "external/cctz"] 14 | path = external/cctz 15 | url = https://github.com/google/cctz 16 | [submodule "external/gtest"] 17 | path = external/gtest 18 | url = https://github.com/google/googletest 19 | -------------------------------------------------------------------------------- /LLVMBuild.txt: -------------------------------------------------------------------------------- 1 | ;===- ./tools/lli/LLVMBuild.txt --------------------------------*- Conf -*--===; 2 | ; 3 | ; The LLVM Compiler Infrastructure 4 | ; 5 | ; This file is distributed under the University of Illinois Open Source 6 | ; License. See LICENSE.TXT for details. 7 | ; 8 | ;===------------------------------------------------------------------------===; 9 | ; 10 | ; This is an LLVMBuild description file for the components in this subdirectory. 11 | ; 12 | ; For more information on the LLVMBuild system, please see: 13 | ; 14 | ; http://llvm.org/docs/LLVMBuild.html 15 | ; 16 | ;===------------------------------------------------------------------------===; 17 | 18 | [component_0] 19 | type = Tool 20 | name = lli 21 | parent = Tools 22 | required_libraries = AsmParser BitReader Interpreter JIT MCJIT NativeCodeGen SelectionDAG Native 23 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # PolyJIT - Polyhedral JIT compilation 2 | 3 | PolyJIT provides polyhedral compilation techniques at run-time of 4 | a program. By exploiting run-time information that is not available at 5 | compile-time some constraints due to the linear nature of the polyhedral 6 | model can be relaxed or ignored all-together, e.g. non-linear parameters in 7 | array-subscript expressions or may-aliases. 8 | 9 | PolyJIT is implemented in 2 stages. The first stage selects suitable targets 10 | for just-in-time compilation (LLVMPolyJIT). This can be integrated into 11 | clang just as any other clang compiler plugin. The selected JIT candidates 12 | are instrumented with library calls that let us enter the JIT environment 13 | on demand. 14 | 15 | The second stage (libPolyJIT) is a runtime module that needs to be linked 16 | to instrumented binaries. It provides the JIT itself and becomes active 17 | as soon as one of the selected candidates gets called the first time. 18 | 19 | * [PolyJIT](http://www.infosun.fim.uni-passau.de/cl/PolyJIT/) 20 | 21 | PolyJIT relies on the work of the following projects: 22 | 23 | * [Polly](http://polly.llvm.org) 24 | * [LLVM](http://llvm.org) 25 | * [Likwid](https://code.google.com/p/likwid) 26 | * [PAPI](http://icl.cs.utk.edu/papi/) 27 | * [cppformat](https://github.com/cppformat/cppformat) 28 | * [libpqxx](http://pqxx.org/development/libpqxx/) 29 | 30 | ## Installation 31 | 32 | It is easiest to use the ```pprof build``` command included with 33 | simbuerg/pprof-study. More details follow. 34 | 35 | ``` 36 | ``` 37 | 38 | ## LLVMPolyJIT components 39 | 40 | The following sections describe the components available in the static 41 | clang/llvm compiler plugin. 42 | 43 | ### Configuration options 44 | ``` 45 | TODO 46 | ``` 47 | 48 | ### JIT ScopDetection 49 | ``` 50 | TODO 51 | ``` 52 | 53 | ### SCoP extraction 54 | ``` 55 | TODO 56 | ``` 57 | 58 | ### JIT instrumentation 59 | ``` 60 | TODO 61 | ``` 62 | 63 | ### PAPI instrumentation 64 | ``` 65 | TODO 66 | ``` 67 | 68 | ## libPolyJIT components 69 | 70 | The following sections describe the components available in the run-time 71 | library. 72 | 73 | ### Configuration options 74 | 75 | ### Function variant generation 76 | ``` 77 | TODO 78 | ``` 79 | -------------------------------------------------------------------------------- /cmake/FindIsl-cxx.cmake: -------------------------------------------------------------------------------- 1 | if (ISL_FOUND) 2 | FIND_PATH(ISL_CXX_INCLUDE_DIR isl++/Aff.h) 3 | FIND_LIBRARY(ISL_CXX_LIBRARY isl-cxx) 4 | else () 5 | set(ISL_CXX_INSTALL_ROOT "" CACHE STRING "Location of ISL-C++ bindings installation") 6 | FIND_PATH(ISL_CXX_INCLUDE_DIR isl++/Aff.h HINTS ${ISL_CXX_INSTALL_ROOT}/include) 7 | FIND_LIBRARY(ISL_CXX_LIBRARY isl-cxx HINTS ${ISL_CXX_INSTALL_ROOT}/lib) 8 | endif (ISL_FOUND) 9 | 10 | IF (ISL_CXX_INCLUDE_DIR AND ISL_CXX_LIBRARY) 11 | SET(ISL_CXX_FOUND TRUE) 12 | ENDIF (ISL_CXX_INCLUDE_DIR AND ISL_CXX_LIBRARY) 13 | 14 | IF (ISL_CXX_FOUND) 15 | IF (NOT ISL_CXX_FIND_QUIETLY) 16 | MESSAGE(STATUS "Found Isl C++ bindings: ${ISL_CXX_LIBRARY}") 17 | ENDIF (NOT ISL_CXX_FIND_QUIETLY) 18 | ELSE (ISL_CXX_FOUND) 19 | IF (ISL_CXX_FIND_REQUIRED) 20 | MESSAGE(FATAL_ERROR "Could not find Isl C++ bindings") 21 | ENDIF (ISL_CXX_FIND_REQUIRED) 22 | ENDIF (ISL_CXX_FOUND) 23 | 24 | -------------------------------------------------------------------------------- /cmake/FindIsl.cmake: -------------------------------------------------------------------------------- 1 | if (NOT ISL_FOUND) 2 | set(ISL_INSTALL_ROOT "" CACHE STRING "Location of ISL installation") 3 | 4 | FIND_PATH(ISL_INCLUDE_DIR isl/aff.h HINTS ${ISL_INSTALL_ROOT}/include) 5 | 6 | IF (ISL_INCLUDE_DIR) 7 | SET(ISL_FOUND TRUE) 8 | ENDIF (ISL_INCLUDE_DIR) 9 | 10 | IF (ISL_FOUND) 11 | IF (NOT Isl_FIND_QUIETLY) 12 | MESSAGE(STATUS "Found Isl headers.") 13 | ENDIF (NOT Isl_FIND_QUIETLY) 14 | ELSE (ISL_FOUND) 15 | IF (Isl_FIND_REQUIRED) 16 | MESSAGE(FATAL_ERROR "Could not find Isl headers.") 17 | ENDIF (Isl_FIND_REQUIRED) 18 | ENDIF (ISL_FOUND) 19 | endif (NOT ISL_FOUND) 20 | -------------------------------------------------------------------------------- /cmake/FindLikwid.cmake: -------------------------------------------------------------------------------- 1 | set(LIKWID_INSTALL_ROOT "" CACHE STRING "Location of LIKWID installation") 2 | 3 | FIND_PATH(LIKWID_INCLUDE_DIR likwid.h HINTS ${LIKWID_INSTALL_ROOT}/include) 4 | FIND_LIBRARY(LIKWID_LIBRARY likwid HINTS ${LIKWID_INSTALL_ROOT}/lib) 5 | 6 | IF (LIKWID_INCLUDE_DIR AND LIKWID_LIBRARY) 7 | SET(LIKWID_FOUND TRUE) 8 | ENDIF (LIKWID_INCLUDE_DIR AND LIKWID_LIBRARY) 9 | 10 | 11 | IF (LIKWID_FOUND) 12 | IF (NOT LIKWID_FIND_QUIETLY) 13 | MESSAGE(STATUS "Found Likwid: ${LIKWID_LIBRARY}") 14 | ENDIF (NOT LIKWID_FIND_QUIETLY) 15 | ELSE (LIKWID_FOUND) 16 | IF (LIKWID_FIND_REQUIRED) 17 | MESSAGE(FATAL_ERROR "Could not find Likwid") 18 | ENDIF (LIKWID_FIND_REQUIRED) 19 | ENDIF (LIKWID_FOUND) 20 | -------------------------------------------------------------------------------- /cmake/FindPapi.cmake: -------------------------------------------------------------------------------- 1 | set(PAPI_INSTALL_ROOT "" CACHE STRING "Location of PAPI installation") 2 | 3 | FIND_PATH(PAPI_INCLUDE_DIR papi.h HINTS ${PAPI_INSTALL_ROOT}/include) 4 | FIND_LIBRARY(PAPI_LIBRARY papi HINTS ${PAPI_INSTALL_ROOT}/lib) 5 | 6 | IF (PAPI_INCLUDE_DIR AND PAPI_LIBRARY) 7 | SET(PAPI_FOUND TRUE) 8 | ENDIF (PAPI_INCLUDE_DIR AND PAPI_LIBRARY) 9 | 10 | 11 | IF (PAPI_FOUND) 12 | IF (NOT PAPI_FIND_QUIETLY) 13 | MESSAGE(STATUS "Found Papi: ${PAPI_LIBRARY}") 14 | ENDIF (NOT PAPI_FIND_QUIETLY) 15 | ELSE (PAPI_FOUND) 16 | IF (PAPI_FIND_REQUIRED) 17 | MESSAGE(FATAL_ERROR "Could not find Papi") 18 | ENDIF (PAPI_FIND_REQUIRED) 19 | ENDIF (PAPI_FOUND) 20 | -------------------------------------------------------------------------------- /cmake/FindPolly.cmake: -------------------------------------------------------------------------------- 1 | set(POLLY_INSTALL_ROOT "${LLVM_INSTALL_ROOT}" CACHE STRING "Location of Polly installation") 2 | 3 | FIND_PATH(POLLY_INCLUDE_DIRS polly/LinkAllPasses.h 4 | PATHS 5 | ${POLLY_INSTALL_ROOT}/include/ 6 | ${POLLY_INSTALL_ROOT}/tools/polly/include/ 7 | ) 8 | FIND_PATH(POLLY_ISL_INCLUDE_DIRS isl/isl-noexceptions.h 9 | PATHS 10 | ${POLLY_INSTALL_ROOT}/include/polly/ 11 | ) 12 | 13 | FIND_LIBRARY(POLLY_LIBRARY lib 14 | NAMES 15 | libPolly.so 16 | libPolly.a PATHS ${POLLY_INSTALL_ROOT}/lib/) 17 | 18 | IF (POLLY_ISL_INCLUDE_DIRS AND 19 | POLLY_INCLUDE_DIRS AND 20 | POLLY_LIBRARY) 21 | SET(Polly_FOUND TRUE) 22 | ENDIF (POLLY_ISL_INCLUDE_DIRS AND 23 | POLLY_INCLUDE_DIRS AND 24 | POLLY_LIBRARY) 25 | 26 | IF (Polly_FOUND) 27 | IF (NOT Polly_FIND_QUIETLY) 28 | MESSAGE(STATUS "Found Polly: ${POLLY_LIBRARY}") 29 | ENDIF (NOT Polly_FIND_QUIETLY) 30 | get_filename_component(POLLY_LIBRARY_DIRS ${POLLY_LIBRARY} DIRECTORY) 31 | ELSE (Polly_FOUND) 32 | IF (Polly_FIND_REQUIRED) 33 | MESSAGE(FATAL_ERROR "Could not find Polly") 34 | ENDIF (Polly_FIND_REQUIRED) 35 | ENDIF (Polly_FOUND) 36 | -------------------------------------------------------------------------------- /cmake/FindPqxx.cmake: -------------------------------------------------------------------------------- 1 | set(PQXX_INSTALL_ROOT "" CACHE STRING "Location of PQXX installation") 2 | 3 | FIND_PATH(PQXX_INCLUDE_DIR pqxx HINTS ${PQXX_INSTALL_ROOT}/include) 4 | FIND_LIBRARY(PQXX_LIBRARY pqxx HINTS ${PQXX_INSTALL_ROOT}/lib) 5 | 6 | IF (PQXX_INCLUDE_DIR AND PQXX_LIBRARY) 7 | SET(PQXX_FOUND TRUE) 8 | ENDIF (PQXX_INCLUDE_DIR AND PQXX_LIBRARY) 9 | 10 | 11 | IF (PQXX_FOUND) 12 | IF (NOT PQXX_FIND_QUIETLY) 13 | MESSAGE(STATUS "Found PQxx: ${PQXX_LIBRARY}") 14 | ENDIF (NOT PQXX_FIND_QUIETLY) 15 | ELSE (PQXX_FOUND) 16 | IF (PQXX_FIND_REQUIRED) 17 | MESSAGE(FATAL_ERROR "Could not find PQxx") 18 | ENDIF (PQXX_FIND_REQUIRED) 19 | ENDIF (PQXX_FOUND) 20 | -------------------------------------------------------------------------------- /cmake/FindPthread.cmake: -------------------------------------------------------------------------------- 1 | set(PTHREAD_INSTALL_ROOT "" CACHE STRING "Location of PTHREAD installation") 2 | 3 | FIND_PATH(PTHREAD_INCLUDE_DIR pthread.h HINTS ${PTHREAD_INSTALL_ROOT}/include) 4 | FIND_LIBRARY(PTHREAD_LIBRARY pthread HINTS ${PTHREAD_INSTALL_ROOT}/lib) 5 | 6 | IF (PTHREAD_INCLUDE_DIR AND PTHREAD_LIBRARY) 7 | SET(PTHREAD_FOUND TRUE) 8 | ENDIF (PTHREAD_INCLUDE_DIR AND PTHREAD_LIBRARY) 9 | 10 | 11 | IF (PTHREAD_FOUND) 12 | IF (NOT PTHREAD_FIND_QUIETLY) 13 | MESSAGE(STATUS "Found Pthread: ${PTHREAD_LIBRARY}") 14 | ENDIF (NOT PTHREAD_FIND_QUIETLY) 15 | ELSE (PTHREAD_FOUND) 16 | IF (PTHREAD_FIND_REQUIRED) 17 | MESSAGE(FATAL_ERROR "Could not find Pthread") 18 | ENDIF (PTHREAD_FIND_REQUIRED) 19 | ENDIF (PTHREAD_FOUND) 20 | -------------------------------------------------------------------------------- /cmake/polli_macros.cmake: -------------------------------------------------------------------------------- 1 | macro(add_polli_executable name) 2 | set(LLVM_RUNTIME_OUTPUT_INTDIR ${CMAKE_BINARY_DIR}/${CMAKE_CFG_INTDIR}/bin) 3 | set(LLVM_LIBRARY_OUTPUT_INTDIR ${CMAKE_BINARY_DIR}/${CMAKE_CFG_INTDIR}/lib) 4 | add_executable( ${name} ${ARGN} ) 5 | 6 | if(POLLI_LINK_LIBS) 7 | foreach(lib ${POLLI_LINK_LIBS}) 8 | target_link_libraries(${name} LINK_PRIVATE ${lib}) 9 | endforeach(lib) 10 | endif(POLLI_LINK_LIBS) 11 | 12 | set_target_properties(${name} PROPERTIES FOLDER "Polli executables") 13 | install (TARGETS ${name} 14 | RUNTIME DESTINATION bin 15 | ) 16 | endmacro(add_polli_executable) 17 | 18 | macro(add_polli_library name) 19 | set(srcs ${ARGN}) 20 | if (MODULE) 21 | set(libkind MODULE) 22 | elseif (SHARED_LIBRARY) 23 | set(libkind SHARED) 24 | else() 25 | set(libkind) 26 | endif() 27 | add_library( ${name} ${libkind} ${srcs} ) 28 | if( LLVM_COMMON_DEPENDS ) 29 | add_dependencies( ${name} ${LLVM_COMMON_DEPENDS} ) 30 | endif( LLVM_COMMON_DEPENDS ) 31 | if( LLVM_USED_LIBS ) 32 | foreach(lib ${LLVM_USED_LIBS}) 33 | target_link_libraries( ${name} ${lib} ) 34 | endforeach(lib) 35 | endif( LLVM_USED_LIBS ) 36 | 37 | if( LLVM_LINK_COMPONENTS ) 38 | llvm_config(${name} ${LLVM_LINK_COMPONENTS}) 39 | endif( LLVM_LINK_COMPONENTS ) 40 | if(POLLI_LINK_LIBS) 41 | foreach(lib ${POLLI_LINK_LIBS}) 42 | target_link_libraries(${name} PUBLIC ${lib}) 43 | endforeach(lib) 44 | endif(POLLI_LINK_LIBS) 45 | 46 | install(TARGETS ${name} 47 | EXPORT LLVMExports 48 | LIBRARY DESTINATION lib 49 | ARCHIVE DESTINATION lib${LLVM_LIBDIR_SUFFIX}) 50 | set_property(GLOBAL APPEND PROPERTY LLVM_EXPORTS ${name}) 51 | set_output_directory(${name} LIBRARY_DIR ${POLLI_LIBRARY_OUTPUT_INTDIR}) 52 | unset(POLLI_LINK_LIBS) 53 | endmacro(add_polli_library) 54 | 55 | macro(add_polli_loadable_module name) 56 | set(srcs ${ARGN}) 57 | # klduge: pass different values for MODULE with multiple targets in same dir 58 | # this allows building shared-lib and module in same dir 59 | # there must be a cleaner way to achieve this.... 60 | if (MODULE) 61 | else() 62 | set(GLOBAL_NOT_MODULE TRUE) 63 | endif() 64 | set(MODULE TRUE) 65 | add_polli_library(${name} ${srcs}) 66 | if (GLOBAL_NOT_MODULE) 67 | unset (MODULE) 68 | endif() 69 | if (APPLE) 70 | # Darwin-specific linker flags for loadable modules. 71 | set_target_properties(${name} PROPERTIES 72 | LINK_FLAGS "-Wl,-flat_namespace -Wl,-undefined -Wl,suppress") 73 | endif() 74 | endmacro(add_polli_loadable_module) 75 | -------------------------------------------------------------------------------- /include/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | add_subdirectory(polli) 2 | add_subdirectory(pprof) 3 | -------------------------------------------------------------------------------- /include/polli/CMakeLists.txt: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PolyJIT/polli/832ccdbcd43608695a78409b89294e9053dbce78/include/polli/CMakeLists.txt -------------------------------------------------------------------------------- /include/polli/Caching.h: -------------------------------------------------------------------------------- 1 | /* Caching utilities for the PolyJIT JIT Compiler 2 | * 3 | * Copyright © 2016 Andreas Simbürger 4 | * 5 | * Permission is hereby granted, free of charge, to any person obtaining 6 | * a copy of this software and associated documentation files (the "Software"), 7 | * to deal in the Software without restriction, including without limitation 8 | * the rights to use, copy, modify, merge, publish, distribute, sublicense, 9 | * and/or sell copies of the Software, and to permit persons to whom the 10 | * Software is furnished to do so, subject to the following conditions: 11 | * 12 | * The above copyright notice and this permission notice shall be included 13 | * in all copies or substantial portions of the Software. 14 | * 15 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 16 | * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES 17 | * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. 18 | * IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, 19 | * DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, 20 | * TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE 21 | * OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 22 | */ 23 | #ifndef POLLI_CACHING_H 24 | #define POLLI_CACHING_H 25 | 26 | #include 27 | #include 28 | 29 | namespace polli { 30 | struct CacheKey { 31 | uint64_t Addr; 32 | size_t ValueHash; 33 | 34 | CacheKey(uint64_t Addr, size_t ValueHash) 35 | : Addr(Addr), ValueHash(ValueHash) {} 36 | 37 | bool operator==(const CacheKey &O) const { 38 | return Addr == O.Addr && ValueHash == O.ValueHash; 39 | } 40 | 41 | bool operator<(const CacheKey &O) const { 42 | return Addr < O.Addr || (Addr == O.Addr && ValueHash < O.ValueHash); 43 | } 44 | }; 45 | } // namespace polli 46 | 47 | namespace std { 48 | template <> struct hash { 49 | std::size_t operator()(const polli::CacheKey &K) const { 50 | size_t H = (size_t)K.Addr ^ K.ValueHash; 51 | return H; 52 | } 53 | }; 54 | } // namespace std 55 | #endif // POLLI_CACHING_H 56 | -------------------------------------------------------------------------------- /include/polli/ExportMetrics.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include 4 | #include 5 | 6 | #include "llvm/ADT/SmallVector.h" 7 | 8 | namespace polli { 9 | using EventMapTy = std::unordered_map; 10 | using RegionMapTy = std::unordered_map; 11 | 12 | struct JitEventData { 13 | using EventTy = std::pair; 14 | using IdToNameTy = std::pair; 15 | 16 | std::string OutFile; 17 | uint64_t RunID; 18 | 19 | llvm::SmallVector Events; 20 | llvm::SmallVector Entries; 21 | llvm::SmallVector Regions; 22 | }; 23 | 24 | struct ScopMetadata { 25 | uint64_t RunID; 26 | std::string FunctionName; 27 | std::string Schedule; 28 | std::string AST; 29 | std::string OutFile; 30 | }; 31 | 32 | namespace yaml { 33 | void StoreRun(JitEventData &Data); 34 | void StoreScopMetadata(ScopMetadata &Data); 35 | 36 | } // namespace yaml 37 | } // namespace polli -------------------------------------------------------------------------------- /include/polli/FuncTools.h: -------------------------------------------------------------------------------- 1 | #ifndef POLLI_FUNCTOOLS_H 2 | #define POLLI_FUNCTOOLS_H 3 | 4 | #include "llvm/ADT/SetVector.h" 5 | #include "llvm/ADT/SmallVector.h" 6 | #include "llvm/IR/Function.h" 7 | #include "llvm/IR/GlobalValue.h" 8 | #include "llvm/Transforms/Utils/ValueMapper.h" 9 | 10 | namespace polli { 11 | using GlobalList = llvm::SetVector; 12 | 13 | /** 14 | * @brief Collect all global variables used within this Instruction. 15 | * 16 | * We need to keep track of global vars, when extracting prototypes. 17 | * This is used in conjunction with the apply function. 18 | * 19 | * @param I The Instruction we collect globals from. 20 | * @param Globals A list of globals we collected so far. 21 | * @return void 22 | */ 23 | void selectGV(llvm::Instruction &I, GlobalList &Globals); 24 | 25 | using InstrList = llvm::SmallVector; 26 | /** 27 | * @brief Convert a ConstantExpr pointer operand to an Instruction Value. 28 | * 29 | * This is used in conjunction with the apply function. 30 | * 31 | * @param I The Instruction we want to convert the operand in. 32 | * @param Converted A list of Instructions where we keep track of all found 33 | * Instructions so far. 34 | * @return void 35 | */ 36 | void constantExprToInstruction(llvm::Instruction &I, InstrList &Converted, 37 | llvm::ValueToValueMapTy &VMap); 38 | 39 | /** 40 | * @brief Apply a selector function on the function body. 41 | * 42 | * This is a little helper function that allows us to scan over all instructions 43 | * within a function, collecting arbitrary stuff on the way. 44 | * 45 | * @param T The type we track our state in. 46 | * @param F The Function we operate on. 47 | * @param I The Instruction the selector operates on next. 48 | * @param L The state the SelectorF operates with. 49 | * @param SelectorF The selector function we apply to all instructions in the 50 | * function. 51 | * @return T 52 | */ 53 | template 54 | static T apply(llvm::Function &F, 55 | std::function SelectorF) { 56 | T L; 57 | for (llvm::BasicBlock &BB : F) 58 | for (llvm::Instruction &I : BB) 59 | SelectorF(I, L); 60 | 61 | return L; 62 | } 63 | } // namespace polli 64 | 65 | 66 | #endif // POLLI_FUNCTOOLS_H 67 | -------------------------------------------------------------------------------- /include/polli/Jit.h: -------------------------------------------------------------------------------- 1 | #ifndef POLLI_JIT_H 2 | #define POLLI_JIT_H 3 | 4 | #include 5 | #include 6 | #include 7 | 8 | #include "llvm/ExecutionEngine/JITSymbol.h" 9 | 10 | #include "polli/Caching.h" 11 | #include "polli/ExportMetrics.h" 12 | 13 | using llvm::JITSymbol; 14 | 15 | namespace polli { 16 | enum JitRegion : int { 17 | START = 0, 18 | CODEGEN = 1, 19 | VARIANTS = 2, 20 | CACHE_HIT = 3, 21 | REQUESTS = 4, 22 | BLOCKED = 5 23 | }; 24 | 25 | class PolyJIT { 26 | void setup(); 27 | void tearDown(); 28 | 29 | mutable std::recursive_mutex TracingMutex; 30 | mutable std::recursive_mutex CacheMutex; 31 | 32 | JitEventData EventData; 33 | 34 | std::unordered_map Events; 35 | std::unordered_map Entries; 36 | std::unordered_map Regions; 37 | 38 | public: 39 | explicit PolyJIT() { setup(); } 40 | 41 | ~PolyJIT() { 42 | tearDown(); 43 | } 44 | 45 | void enter(uint64_t id, uint64_t time) { 46 | std::lock_guard CS(TracingMutex); 47 | 48 | if (!Events.count(id)) 49 | Events[id] = 0; 50 | if (!Entries.count(id)) 51 | Entries[id] = 0; 52 | Events[id] -= time; 53 | Entries[id] += 1; 54 | } 55 | 56 | void exit(uint64_t id, uint64_t time) { 57 | std::lock_guard CS(TracingMutex); 58 | Events[id] += time; 59 | } 60 | 61 | void increment(uint64_t id, uint64_t step = 1) { 62 | std::lock_guard CS(TracingMutex); 63 | enter(id, 0); 64 | exit(id, step); 65 | } 66 | 67 | void addRegion(const std::string Name, uint64_t id) { 68 | std::lock_guard CS(TracingMutex); 69 | Regions[id] = Name; 70 | } 71 | 72 | /** 73 | * @name CodeCache interface. 74 | * @{ */ 75 | using CodeCacheT = 76 | std::unordered_map; 77 | using value_type = std::pair; 78 | using iterator = CodeCacheT::iterator; 79 | using const_iterator = CodeCacheT::const_iterator; 80 | 81 | std::pair insert(value_type &&value) { 82 | std::lock_guard CS(CacheMutex); 83 | return CodeCache.insert(std::forward(value)); 84 | } 85 | 86 | iterator find(const CacheKey &key) { 87 | std::lock_guard CS(CacheMutex); 88 | return CodeCache.find(key); 89 | } 90 | 91 | iterator end() { 92 | std::lock_guard CS(CacheMutex); 93 | return CodeCache.end(); 94 | } 95 | 96 | iterator begin() { 97 | std::lock_guard CS(CacheMutex); 98 | return CodeCache.begin(); 99 | } 100 | 101 | /** @} */ 102 | 103 | private: 104 | CodeCacheT CodeCache; 105 | }; 106 | } // namespace polli 107 | #endif // POLLI_JIT_H 108 | -------------------------------------------------------------------------------- /include/polli/LikwidMarker.h: -------------------------------------------------------------------------------- 1 | #ifndef POLLI_LIKWIDMARKER_H 2 | #define POLLI_LIKWIDMARKER_H 3 | 4 | #ifndef POLLI_LIKWIDMARKER_H 5 | #define POLLI_LIKWIDMARKER_H 6 | 7 | //===-- JitScopDetection.h --------------------------------*- C++ -*-===// 8 | // 9 | // The LLVM Compiler Infrastructure 10 | // 11 | // This file is distributed under the University of Illinois Open Source 12 | // License. See LICENSE.TXT for details. 13 | // 14 | //===----------------------------------------------------------------------===// 15 | // 16 | // 17 | //===----------------------------------------------------------------------===// 18 | #include "llvm/Pass.h" 19 | 20 | namespace polli { 21 | llvm::ModulePass *createLikwidMarkerPass(); 22 | llvm::ModulePass *createTraceMarkerPass(); 23 | llvm::ModulePass *createOpenMPTracerPass(); 24 | } // namespace polli // namespace polli 25 | 26 | extern "C" { 27 | void pjit_trace_openmp_entry(uint64_t Id, const char *Name); 28 | void pjit_trace_openmp_exit(uint64_t Id, const char *Name); 29 | } 30 | 31 | #endif 32 | 33 | #endif 34 | -------------------------------------------------------------------------------- /include/polli/ModuleExtractor.h: -------------------------------------------------------------------------------- 1 | //===- ModuleExtractor.h - Class definition for the ScopMapper --*- C++ -*-===// 2 | // 3 | // The LLVM Compiler Infrastructure 4 | // 5 | // This file is distributed under the University of Illinois Open Source 6 | // License. See LICENSE.TXT for details. 7 | // 8 | //===----------------------------------------------------------------------===// 9 | // Copyright 2015 Andreas Simbürger 10 | // 11 | //===----------------------------------------------------------------------===// 12 | #ifndef POLLI_MODULEEXTRACTOR_H 13 | #define POLLI_MODULEEXTRACTOR_H 14 | 15 | #include "llvm/ADT/SetVector.h" 16 | #include "llvm/IR/Function.h" 17 | #include "llvm/IR/Module.h" 18 | #include "llvm/Pass.h" 19 | 20 | namespace polli { 21 | class ModuleExtractor : public llvm::FunctionPass { 22 | private: 23 | llvm::SetVector ExtractedFunctions; 24 | public: 25 | static char ID; 26 | explicit ModuleExtractor() : llvm::FunctionPass(ID) {} 27 | 28 | using iterator = llvm::SetVector::iterator; 29 | using const_iterator = llvm::SetVector::const_iterator; 30 | iterator begin() { return ExtractedFunctions.begin(); } 31 | iterator end() { return ExtractedFunctions.end(); } 32 | const_iterator begin() const { return ExtractedFunctions.begin(); } 33 | const_iterator end() const { return ExtractedFunctions.end(); } 34 | 35 | /// @name FunctionPass interface 36 | //@{ 37 | virtual void getAnalysisUsage(llvm::AnalysisUsage &AU) const override; 38 | virtual void releaseMemory() override; 39 | virtual bool runOnFunction(llvm::Function &M) override; 40 | virtual void print(llvm::raw_ostream &, const llvm::Module *) const override; 41 | //@} 42 | //===--------------------------------------------------------------------===// 43 | // DO NOT IMPLEMENT 44 | ModuleExtractor(const ModuleExtractor &); 45 | // DO NOT IMPLEMENT 46 | const ModuleExtractor &operator=(const ModuleExtractor &); 47 | }; 48 | 49 | class ModuleInstrumentation : public llvm::FunctionPass { 50 | public: 51 | static char ID; 52 | explicit ModuleInstrumentation() : llvm::FunctionPass(ID) {} 53 | 54 | /// @name FunctionPass interface 55 | //@{ 56 | virtual void getAnalysisUsage(llvm::AnalysisUsage &AU) const override; 57 | virtual void releaseMemory() override; 58 | virtual bool runOnFunction(llvm::Function &M) override; 59 | virtual void print(llvm::raw_ostream &, const llvm::Module *) const override; 60 | //@} 61 | private: 62 | llvm::SetVector InstrumentedFunctions; 63 | //===--------------------------------------------------------------------===// 64 | // DO NOT IMPLEMENT 65 | ModuleInstrumentation(const ModuleInstrumentation &); 66 | // DO NOT IMPLEMENT 67 | const ModuleInstrumentation &operator=(const ModuleInstrumentation &); 68 | }; 69 | } // end of namespace polli 70 | #endif // POLLI_MODULEEXTRACTOR_H 71 | -------------------------------------------------------------------------------- /include/polli/Monitor.h: -------------------------------------------------------------------------------- 1 | #ifndef POLLI_MONITOR_H 2 | #define POLLI_MONITOR_H 3 | 4 | #include 5 | #include 6 | 7 | namespace polli { 8 | template struct FunctionType; 9 | 10 | template 11 | struct FunctionType { 12 | using return_type = R; 13 | }; 14 | 15 | template 16 | struct FunctionType { 17 | using return_type = R; 18 | }; 19 | 20 | template 21 | struct FunctionType { 22 | using return_type = R; 23 | }; 24 | 25 | template 26 | struct FunctionType { 27 | using return_type = R; 28 | }; 29 | 30 | template 31 | class Monitor { 32 | public: 33 | using object_type = O; 34 | template 35 | typename FunctionType::return_type RunMethodInCS(const Function &F, 36 | Args... args) { 37 | std::lock_guard CS(M); 38 | return (Obj.*F)(args...); 39 | } 40 | 41 | template 42 | typename FunctionType::return_type 43 | RunMethodInCS(const Function &F, Args... args) const { 44 | std::lock_guard CS(M); 45 | return (Obj.*F)(args...); 46 | } 47 | 48 | template 49 | typename FunctionType::return_type RunInCS(const Function &F, 50 | Args... args) { 51 | std::lock_guard CS(M); 52 | return F(args...); 53 | } 54 | 55 | template 56 | typename FunctionType::return_type RunInCS(const Function &F, 57 | Args... args) const { 58 | std::lock_guard CS(M); 59 | return F(args...); 60 | } 61 | 62 | ~Monitor() {} 63 | 64 | object_type &monitored() { 65 | return Obj; 66 | } 67 | 68 | private: 69 | object_type Obj; 70 | mutable std::mutex M; 71 | }; 72 | } // namespace polli 73 | 74 | #endif // POLLI_MONITOR_H 75 | 76 | -------------------------------------------------------------------------------- /include/polli/NonAffineSCEVs.h: -------------------------------------------------------------------------------- 1 | /* SCEVValidators from Polly modified for PolyJIT. 2 | * 3 | * Copyright © 2016 Andreas Simbürger 4 | * 5 | * Permission is hereby granted, free of charge, to any person obtaining 6 | * a copy of this software and associated documentation files (the "Software"), 7 | * to deal in the Software without restriction, including without limitation 8 | * the rights to use, copy, modify, merge, publish, distribute, sublicense, 9 | * and/or sell copies of the Software, and to permit persons to whom the 10 | * Software is furnished to do so, subject to the following conditions: 11 | * 12 | * The above copyright notice and this permission notice shall be included 13 | * in all copies or substantial portions of the Software. 14 | * 15 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 16 | * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES 17 | * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. 18 | * IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, 19 | * DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, 20 | * TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE 21 | * OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 22 | */ 23 | #ifndef POLLI_NONAFFINESCEVS_H 24 | #define POLLI_NONAFFINESCEVS_H 25 | 26 | #include "polly/Support/ScopHelper.h" 27 | #include "llvm/ADT/SetVector.h" 28 | #include 29 | 30 | namespace llvm { 31 | class Region; 32 | class SCEV; 33 | class SCEVConstant; 34 | class ScalarEvolution; 35 | class Value; 36 | class Loop; 37 | class LoadInst; 38 | } // namespace llvm 39 | 40 | namespace polli { 41 | bool isNonAffineExpr(const llvm::Region *R, llvm::Loop *Scope, 42 | const llvm::SCEV *Expr, llvm::ScalarEvolution &SE, 43 | polly::InvariantLoadsSetTy *ILS); 44 | 45 | std::vector 46 | getParamsInNonAffineExpr(const llvm::Region *R, llvm::Loop *Scope, 47 | const llvm::SCEV *Expr, llvm::ScalarEvolution &SE); 48 | } // namespace polli 49 | #endif // POLLI_NONAFFINESCEVS_H 50 | -------------------------------------------------------------------------------- /include/polli/Options.h: -------------------------------------------------------------------------------- 1 | //===--------------- polli/Options.h - The Polli option category *- C++ -*-===// 2 | // 3 | // The LLVM Compiler Infrastructure 4 | // 5 | // This file is distributed under the University of Illinois Open Source 6 | // License. See LICENSE.TXT for details. 7 | // 8 | //===----------------------------------------------------------------------===// 9 | // 10 | // Introduce an option category for Polli. 11 | // 12 | //===----------------------------------------------------------------------===// 13 | 14 | #ifndef POLLI_OPTIONS_H 15 | #define POLLI_OPTIONS_H 16 | 17 | #include "spdlog/spdlog.h" 18 | #include "llvm/Support/CodeGen.h" 19 | #include "llvm/Support/CommandLine.h" 20 | #include "llvm/Target/TargetOptions.h" 21 | 22 | #include 23 | #include 24 | 25 | extern llvm::cl::OptionCategory PolliCategory; 26 | extern llvm::cl::OptionCategory PolyJitRuntime; 27 | extern llvm::cl::OptionCategory PolyJitCompiletime; 28 | 29 | namespace polli { 30 | enum PipelineType { 31 | RELEASE, 32 | DEBUG 33 | }; 34 | 35 | namespace opt { 36 | extern bool EnableTracking; 37 | extern std::string TrackMetricsFilename; 38 | extern std::string TrackScopMetadataFilename; 39 | extern bool EnableLogFile; 40 | extern bool DisableRecompile; 41 | extern bool DisableCoreFiles; 42 | extern std::string EntryFunc; 43 | extern std::string FakeArgv0; 44 | 45 | extern spdlog::level::level_enum LogLevel; 46 | 47 | extern int RunID; 48 | 49 | namespace runtime { 50 | extern char OptLevel; 51 | extern std::string TargetTriple; 52 | extern std::string MArch; 53 | extern std::string MCPU; 54 | extern std::vector MAttrs; 55 | 56 | extern bool DisableExecution; 57 | extern bool DisableSpecialization; 58 | extern bool EnablePapi; 59 | extern bool EnableDatabaseExport; 60 | extern bool GenerateOutput; 61 | extern bool EnableScheduleReport; 62 | extern bool EnableScopReport; 63 | extern bool EnableFunctionReport; 64 | extern bool EnableASTReport; 65 | extern bool UsePollyOptions; 66 | extern bool DisableDelinearization; 67 | extern bool EnablePolly; 68 | 69 | extern PipelineType PipelineChoice; 70 | } // namespace runtime 71 | 72 | namespace compiletime { 73 | extern bool Enabled; 74 | extern bool InstrumentRegions; 75 | extern bool AnalyzeIR; 76 | extern bool ProfileScops; 77 | extern bool CollectRegressionTests; 78 | } // namespace compiletime 79 | 80 | 81 | void ValidateOptions(); 82 | 83 | /** 84 | * @brief Check, if we're wrapped in a likwid binary, e.g., likwid-perfctr. 85 | * 86 | * @return bool 87 | */ 88 | bool haveLikwid(); 89 | 90 | /** 91 | * Get the number of OpenMP-Threads available to us. 92 | */ 93 | uint64_t getNumThreads(); 94 | } // namespace opt 95 | } // namespace polli 96 | #endif 97 | -------------------------------------------------------------------------------- /include/polli/PapiProfiling.h: -------------------------------------------------------------------------------- 1 | #ifndef POLLI_PAPIPROFILING_H 2 | #define POLLI_PAPIPROFILING_H 3 | 4 | #include "llvm/Analysis/LoopInfo.h" 5 | #include "llvm/Analysis/RegionPass.h" 6 | #include "llvm/Pass.h" 7 | 8 | #include "polly/ScopDetection.h" 9 | #include "polly/Support/ScopHelper.h" 10 | 11 | #include "polly/LinkAllPasses.h" 12 | 13 | namespace llvm { 14 | 15 | class Value; 16 | class Instruction; 17 | class GlobalVariable; 18 | class GlobalValue; 19 | class LoopInfo; 20 | class PointerType; 21 | class RegionInfo; 22 | class Region; 23 | 24 | typedef SmallVector, 8> TimerPairs; 25 | 26 | class PapiRegionPrepare : public RegionPass { 27 | public: 28 | static char ID; 29 | 30 | explicit PapiRegionPrepare() : RegionPass (ID) {} 31 | virtual void getAnalysisUsage(AnalysisUsage &AU) const { 32 | AU.addRequired(); 33 | AU.addRequired(); 34 | AU.setPreservesAll(); 35 | } 36 | 37 | virtual bool runOnRegion(Region *R, RGPassManager &RGM); 38 | 39 | private: 40 | LoopInfo *LI; 41 | DominatorTree *DT; 42 | 43 | bool isParent(Region *R, Region *Child); 44 | void createPapiEntry(Region *R); 45 | void createPapiExit(Region *R); 46 | }; 47 | 48 | class PapiProfiling : public ModulePass { 49 | public: 50 | static char ID; 51 | 52 | explicit PapiProfiling() : ModulePass (ID) {} 53 | virtual void getAnalysisUsage(AnalysisUsage &AU) const { 54 | AU.setPreservesAll(); 55 | } 56 | 57 | virtual bool runOnModule(Module &M); 58 | virtual void print(raw_ostream &OS, const Module *) const; 59 | 60 | private: 61 | void instrumentFunction(int idx, Function *F, 62 | GlobalValue *Array); 63 | }; 64 | 65 | } // namespace llvm 66 | 67 | namespace llvm { 68 | class PassRegistry; 69 | void initializePapiProfilingPass(llvm::PassRegistry&); 70 | void initializePapiRegionPreparePass(llvm::PassRegistry&); 71 | } // namespace llvm 72 | #endif // POLLI_PAPIPROFILING_H 73 | -------------------------------------------------------------------------------- /include/polli/ProfileScops.h: -------------------------------------------------------------------------------- 1 | #ifndef POLLI_PROFILESCOPS_H 2 | #define POLLI_PROFILESCOPS_H 3 | 4 | #include "llvm/Pass.h" 5 | 6 | namespace polli { 7 | Pass *createProfileScopsPass(bool); 8 | } // namespace polli 9 | 10 | namespace llvm { 11 | class PassRegistry; 12 | void initializeProfileScopsPass(llvm::PassRegistry &); 13 | } // namespace llvm 14 | 15 | #endif 16 | -------------------------------------------------------------------------------- /include/polli/RegisterCompilationPasses.h: -------------------------------------------------------------------------------- 1 | //===---- RegisterCompilationPasses.h - LLVM Just in Time Compiler --------===// 2 | // 3 | // The LLVM Compiler Infrastructure 4 | // 5 | // This file is distributed under the University of Illinois Open Source 6 | // License. See LICENSE.TXT for details. 7 | // 8 | //===----------------------------------------------------------------------===// 9 | // 10 | // Register the compilation sequence required for the PolyJIT runtime support. 11 | // 12 | //===----------------------------------------------------------------------===// 13 | #ifndef POLLI_REGISTERCOMPILATIONPASSES_H 14 | #define POLLI_REGISTERCOMPILATIONPASSES_H 15 | 16 | #include "llvm/IR/LegacyPassManager.h" 17 | #include "llvm/PassRegistry.h" 18 | 19 | namespace llvm { 20 | namespace legacy { 21 | class PassManagerBase; 22 | } // namespace legacy 23 | 24 | class PassRegistry; 25 | } // namespace llvm 26 | 27 | namespace polli { 28 | /** 29 | * @brief Register PolyJIT's passes with the PassManager 30 | * 31 | * @param PM The PassManager we put PolyJIT's compilation passes into. 32 | * @return void 33 | */ 34 | void registerPolli(llvm::legacy::PassManagerBase &PM); 35 | 36 | /** 37 | * @brief Initialize PolyJIT's compilation passes. 38 | * 39 | * @param Registry The registry we put ourselves in. Usually PolyJIT wants to 40 | * run as early as possible, like Polly. 41 | * @return void 42 | */ 43 | void initializePolliPasses(llvm::PassRegistry &Registry); 44 | } // namespace polli 45 | #endif 46 | -------------------------------------------------------------------------------- /include/polli/RunValues.h: -------------------------------------------------------------------------------- 1 | /* RunValue extraction for the PolyJIT Compiler 2 | * Copyright © 2016 Andreas Simbürger 3 | * 4 | * Permission is hereby granted, free of charge, to any person obtaining 5 | * a copy of this software and associated documentation files (the "Software"), 6 | * to deal in the Software without restriction, including without limitation 7 | * the rights to use, copy, modify, merge, publish, distribute, sublicense, 8 | * and/or sell copies of the Software, and to permit persons to whom the 9 | * Software is furnished to do so, subject to the following conditions: 10 | * 11 | * The above copyright notice and this permission notice shall be included 12 | * in all copies or substantial portions of the Software. 13 | * 14 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 15 | * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES 16 | * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. 17 | * IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, 18 | * DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, 19 | * TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE 20 | * OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 21 | */ 22 | #ifndef POLLI_RUNVALUES_H 23 | #define POLLI_RUNVALUES_H 24 | 25 | #include 26 | #include 27 | #include 28 | #include 29 | #include 30 | 31 | #include "absl/strings/string_view.h" 32 | #include "absl/types/optional.h" 33 | #include "absl/types/variant.h" 34 | 35 | #include "llvm/IR/Function.h" 36 | #include "llvm/IR/Module.h" 37 | 38 | using llvm::Function; 39 | using llvm::Module; 40 | 41 | namespace polli { 42 | using VarParam = absl::variant; 43 | struct JitRequest { 44 | size_t Hash; 45 | std::shared_ptr M; 46 | llvm::SmallVector Params; 47 | }; 48 | 49 | struct VariantRequest { 50 | size_t Hash; 51 | absl::optional F; 52 | llvm::SmallVector Params; 53 | }; 54 | 55 | JitRequest make_request(const absl::string_view FnName, 56 | std::shared_ptr M, 57 | llvm::SmallVector Params); 58 | 59 | VariantRequest make_variant_request(JitRequest JitReq); 60 | 61 | inline bool canSpecialize(const llvm::Argument &Arg) { 62 | const llvm::Function *F = Arg.getParent(); 63 | llvm::Attribute Attr = 64 | F->getAttribute(Arg.getArgNo() + 1, "polli.specialize"); 65 | return Attr.getAsString() == "\"polli.specialize\""; 66 | } 67 | 68 | #if 0 69 | #ifndef NDEBUG 70 | void printArgs(const Function &F, size_t argc, 71 | const std::vector &Params); 72 | #endif 73 | #endif 74 | } // namespace polli 75 | #endif // POLLI_RUNVALUES_H 76 | -------------------------------------------------------------------------------- /include/polli/RuntimeOptimizer.h: -------------------------------------------------------------------------------- 1 | //===-- RuntimeOptimizer.h - JIT function optimizer -------------*- C++ -*-===// 2 | // 3 | // The LLVM Compiler Infrastructure 4 | // 5 | // This file is distributed under the University of Illinois Open Source 6 | // License. See LICENSE.TXT for details. 7 | // 8 | //===----------------------------------------------------------------------===// 9 | // 10 | // This file defines a small interface to determine the benefits of optimizing 11 | // a given function at run time. If the benefit exceeds a threshold the 12 | // optimization should be executed, e.g. with Polly. 13 | // 14 | //===----------------------------------------------------------------------===// 15 | #ifndef POLLI_RUNTIMEOPTIMIZER_H 16 | #define POLLI_RUNTIMEOPTIMIZER_H 17 | #include "polli/Options.h" 18 | #include 19 | 20 | #include "llvm/IR/Module.h" 21 | #include 22 | 23 | namespace polli { 24 | using SharedModule = std::shared_ptr; 25 | void SetOptimizationPipeline(PipelineType Choice); 26 | 27 | // @brief Optimize a function during the runtime of the program. 28 | // 29 | // We only perform relatively 'cheap' optimizations here, to avoid increasing 30 | // the run-time overhead by too much. 31 | // 32 | // @param F The function to optimize 33 | // @return The optimized function. 34 | struct RuntimeOptimizer { 35 | std::set &OptimizedModules; 36 | explicit RuntimeOptimizer(std::set &ModRef) 37 | : OptimizedModules(ModRef) {} 38 | SharedModule operator()(SharedModule M); 39 | }; 40 | } // namespace polli 41 | #endif // POLLI_RUNTIMEOPTIMIZER_H 42 | -------------------------------------------------------------------------------- /include/polli/Stats.h: -------------------------------------------------------------------------------- 1 | //===-- Stats.h - RUNTIME statistics ----------------------------*- C++ -*-===// 2 | // 3 | // The LLVM Compiler Infrastructure 4 | // 5 | // This file is distributed under the University of Illinois Open Source 6 | // License. See LICENSE.TXT for details. 7 | // 8 | //===----------------------------------------------------------------------===// 9 | // 10 | // 11 | //===----------------------------------------------------------------------===// 12 | #ifndef POLLI_STATS_H 13 | #define POLLI_STATS_H 14 | 15 | #include 16 | 17 | #include "llvm/ADT/Twine.h" 18 | #include "llvm/IR/Function.h" 19 | 20 | using llvm::Function; 21 | using llvm::Twine; 22 | 23 | namespace llvm { 24 | class Value; 25 | } // namespace llvm 26 | 27 | namespace polli { 28 | struct Stats { 29 | uint64_t NumCalls; 30 | uint64_t LookupTime; 31 | uint64_t LastRuntime; 32 | bool JumpIntoJIT; 33 | uint64_t RegionEnter; 34 | uint64_t RegionExit; 35 | }; 36 | 37 | llvm::Value *registerStatStruct(Function &F, const Twine &NameSuffix); 38 | 39 | uint64_t GetCandidateId(const Function &F); 40 | } // namespace polli 41 | #endif // POLLI_STATS_H 42 | -------------------------------------------------------------------------------- /include/polli/TypeMapper.h: -------------------------------------------------------------------------------- 1 | #ifndef POLLI_TYPEMAPPER_H 2 | #define POLLI_TYPEMAPPER_H 3 | 4 | #include "llvm/ADT/DenseMap.h" 5 | #include "llvm/ADT/SmallPtrSet.h" 6 | #include "llvm/ADT/SmallVector.h" 7 | #include "llvm/IR/Function.h" 8 | #include "llvm/IR/Type.h" 9 | #include "llvm/IR/TypeFinder.h" 10 | #include "llvm/Linker/IRMover.h" 11 | #include "llvm/Support/Casting.h" 12 | #include "llvm/Transforms/Utils/ValueMapper.h" 13 | 14 | namespace polli { 15 | class TypeMapTy : public llvm::ValueMapTypeRemapper { 16 | /// This is a mapping from a source type to a destination type to use. 17 | llvm::DenseMap MappedTypes; 18 | 19 | /// When checking to see if two subgraphs are isomorphic, we speculatively 20 | /// add types to MappedTypes, but keep track of them here in case we need to 21 | /// roll back. 22 | llvm::SmallVector SpeculativeTypes; 23 | 24 | llvm::SmallVector SpeculativeDstOpaqueTypes; 25 | 26 | /// This is a list of non-opaque structs in the source module that are mapped 27 | /// to an opaque struct in the destination module. 28 | llvm::SmallVector SrcDefinitionsToResolve; 29 | 30 | /// This is the set of opaque types in the destination modules who are 31 | /// getting a body from the source module. 32 | llvm::SmallPtrSet DstResolvedOpaqueTypes; 33 | 34 | public: 35 | TypeMapTy(llvm::IRMover::IdentifiedStructTypeSet &DstStructTypesSet) 36 | : DstStructTypesSet(DstStructTypesSet) {} 37 | 38 | llvm::IRMover::IdentifiedStructTypeSet &DstStructTypesSet; 39 | /// Indicate that the specified type in the destination module is conceptually 40 | /// equivalent to the specified type in the source module. 41 | void addTypeMapping(llvm::Type *DstTy, llvm::Type *SrcTy); 42 | 43 | /// Produce a body for an opaque type in the dest module from a type 44 | /// definition in the source module. 45 | void linkDefinedTypeBodies(); 46 | 47 | /// Return the mapped type to use for the specified input type from the 48 | /// source module. 49 | llvm::Type *get(llvm::Type *SrcTy); 50 | llvm::Type *get(llvm::Type *SrcTy, 51 | llvm::SmallPtrSet &Visited); 52 | 53 | void finishType(llvm::StructType *DTy, llvm::StructType *STy, 54 | llvm::ArrayRef ETypes); 55 | 56 | llvm::FunctionType *get(llvm::FunctionType *T) { 57 | return llvm::cast(get((llvm::Type *)T)); 58 | } 59 | 60 | private: 61 | llvm::Type *remapType(llvm::Type *SrcTy) override { return get(SrcTy); } 62 | 63 | bool areTypesIsomorphic(llvm::Type *DstTy, llvm::Type *SrcTy); 64 | }; 65 | } //namespace polli 66 | #endif // POLLI_TYPEMAPPER_H 67 | -------------------------------------------------------------------------------- /include/polli/Utils.h: -------------------------------------------------------------------------------- 1 | //===-- Utils.h -------------------------------------------------*- C++ -*-===// 2 | // 3 | // The LLVM Compiler Infrastructure 4 | // 5 | // This file is distributed under the University of Illinois Open Source 6 | // License. See LICENSE.TXT for details. 7 | // 8 | //===----------------------------------------------------------------------===// 9 | // 10 | // 11 | //===----------------------------------------------------------------------===// 12 | #ifndef POLLI_UTILS_H 13 | #define POLLI_UTILS_H 14 | 15 | #include "polli/Options.h" 16 | 17 | #include "llvm/ADT/DenseMap.h" 18 | #include "llvm/ADT/SmallVector.h" 19 | #include "llvm/Analysis/PostDominators.h" 20 | #include "llvm/ExecutionEngine/ExecutionEngine.h" 21 | #include "llvm/IR/DataLayout.h" 22 | #include "llvm/IR/Module.h" 23 | #include "llvm/Support/FileSystem.h" 24 | #include "llvm/Support/FileUtilities.h" 25 | #include "llvm/Support/Path.h" 26 | #include "llvm/Support/ToolOutputFile.h" 27 | #include "llvm/Support/raw_ostream.h" 28 | 29 | #include 30 | #include 31 | 32 | using namespace llvm::sys::fs; 33 | 34 | namespace fs = llvm::sys::fs; 35 | namespace p = llvm::sys::path; 36 | 37 | typedef llvm::Module* ModulePtrT; 38 | typedef llvm::DenseMap ManagedModules; 39 | 40 | extern llvm::SmallVector *DefaultDir; 41 | /** 42 | * @brief Initialize the output directory to put all intermediate files into. 43 | */ 44 | void initializeOutputDir(); 45 | 46 | /** 47 | * @brief Store a module with a given name in the output directory. 48 | * 49 | * @param M the module to store 50 | * @param Name filename to store the module under. 51 | */ 52 | void StoreModule(llvm::Module &M, const llvm::Twine &Name); 53 | 54 | /** 55 | * @brief Store a set of modules in the output directory. 56 | * 57 | * @param Modules the modules to store 58 | */ 59 | void StoreModules(ManagedModules &Modules); 60 | 61 | /** 62 | * @brief Get a report output stream and indent it to the correct depth 63 | * 64 | * @param Indent Indentation level, we indent with spaces. 65 | * 66 | * @return the indented output stream. 67 | */ 68 | llvm::raw_ostream &report(const size_t Indent = 0); 69 | 70 | namespace polli { 71 | void removeFunctionFromDomTree(llvm::Function &F, llvm::DominatorTree &DT); 72 | } // namespace polli 73 | #endif // POLLI_UTILS_H 74 | -------------------------------------------------------------------------------- /include/polli/VariantFunction.h: -------------------------------------------------------------------------------- 1 | #ifndef POLLI_VARIANTFUNCTION_H 2 | #define POLLI_VARIANTFUNCTION_H 3 | 4 | #include "llvm/IR/Module.h" 5 | #include "polli/RunValues.h" 6 | 7 | using llvm::Module; 8 | 9 | namespace polli { 10 | // @brief Create a new function variant with they values included in the 11 | // key replaced. 12 | std::unique_ptr createVariant(const VariantRequest R, std::string &FnName); 13 | } // namespace polli 14 | #endif // POLLI_VARIANTFUNCTION_H 15 | -------------------------------------------------------------------------------- /include/polli/log.h: -------------------------------------------------------------------------------- 1 | #ifndef POLLI_LOG_H 2 | #define POLLI_LOG_H 3 | #include 4 | #include 5 | 6 | #include "polli/Options.h" 7 | #include "spdlog/spdlog.h" 8 | 9 | using spdlog::logger; 10 | using spdlog::level::level_enum; 11 | 12 | using polli::opt::LogLevel; 13 | 14 | 15 | namespace polli { 16 | std::shared_ptr 17 | register_log(const std::string &Name = "default", 18 | const level_enum = spdlog::level::off); 19 | 20 | struct WrappedLogger { 21 | WrappedLogger(const std::string &name) : Name(name) {} 22 | 23 | auto operator-> () const -> std::shared_ptr & { 24 | static std::shared_ptr Log = register_log(Name, LogLevel); 25 | return Log; 26 | } 27 | 28 | private: 29 | std::string Name; 30 | }; 31 | 32 | #define REGISTER_LOG(VARNAME, NAME) \ 33 | static polli::WrappedLogger VARNAME(NAME) 34 | } // namespace polli 35 | #endif // POLLI_LOG_H 36 | -------------------------------------------------------------------------------- /include/pprof/CMakeLists.txt: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PolyJIT/polli/832ccdbcd43608695a78409b89294e9053dbce78/include/pprof/CMakeLists.txt -------------------------------------------------------------------------------- /include/pprof/Config.h.cmake: -------------------------------------------------------------------------------- 1 | //===- pprof/Config.h ------------ Configuration of pprof -------*- C++ -*-===// 2 | // 3 | // The LLVM Compiler Infrastructure 4 | // 5 | // This file is distributed under the University of Illinois Open Source 6 | // License. See LICENSE.TXT for details. 7 | // 8 | //===----------------------------------------------------------------------===// 9 | // 10 | // Configuration of libpprof. 11 | // 12 | //===----------------------------------------------------------------------===// 13 | #ifndef PPROF_CONFIG_H 14 | #define PPROF_CONFIG_H 15 | 16 | #cmakedefine POLLI_ENABLE_TRACING 17 | #cmakedefine POLLI_ENABLE_LIKWID 18 | #cmakedefine POLLI_ENABLE_PAPI 19 | 20 | #endif 21 | -------------------------------------------------------------------------------- /include/pprof/file.h: -------------------------------------------------------------------------------- 1 | #ifndef PPROF_FILE_H 2 | #define PPROF_FILE_H 3 | 4 | #include "pprof/pprof.h" 5 | #include 6 | #include 7 | 8 | namespace pprof { 9 | namespace file { 10 | void StoreRun(Run &Events, const Options &opts); 11 | bool ReadRun(Run &Events, 12 | std::map &Regions, const Options &opt); 13 | } 14 | } 15 | 16 | #endif//PPROF_FILE_H 17 | -------------------------------------------------------------------------------- /include/pprof/pgsql.h: -------------------------------------------------------------------------------- 1 | #ifndef PPROF_PGSQL_H 2 | #define PPROF_PGSQL_H 3 | 4 | #include "pprof/pprof.h" 5 | #include 6 | #include 7 | #include 8 | #include 9 | 10 | namespace pprof { 11 | struct DbOptions { 12 | std::string host; 13 | int port; 14 | std::string user; 15 | std::string pass; 16 | std::string name; 17 | uint64_t run_id; 18 | std::string uuid; 19 | std::string exp_uuid; 20 | }; 21 | 22 | DbOptions getDBOptionsFromEnv(); 23 | 24 | namespace pgsql { 25 | using IdVector = std::vector; 26 | using UuidSet = std::set; 27 | using Metrics = std::map; 28 | 29 | UuidSet ReadAvailableRunGroups(); 30 | IdVector ReadAvailableRunIDs(std::string run_group); 31 | Run ReadSimpleRun(uint32_t run_id); 32 | 33 | void StoreRun(const pthread_t tid, Run &Events, 34 | const pprof::Options &opts); 35 | void StoreRunMetrics(long run_id, const Metrics &M); 36 | } 37 | } 38 | 39 | #endif//PPROF_PGSQL_H 40 | -------------------------------------------------------------------------------- /lib/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | set(POLYJIT_COMPILETIME_SOURCES 2 | Analysis/NonAffineSCEVs.cpp 3 | Analysis/ScopDetection.cpp 4 | Extract/ModuleExtraction.cpp 5 | Persist/Schema.cpp 6 | PolyJIT.cpp 7 | RegisterCompilationPasses.cpp 8 | Support/FuncTools.cpp 9 | Support/Log.cpp 10 | Support/Options.cpp 11 | Support/Stats.cpp 12 | Support/Tasks.cpp 13 | Support/TypeMapper.cpp 14 | Support/Utils.cpp 15 | Transform/InstrumentRegions.cpp 16 | Transform/ProfileScops.cpp 17 | ) 18 | 19 | set(POLLI_LINK_LIBS 20 | likwid 21 | pthread 22 | pqxx 23 | pq 24 | ) 25 | 26 | add_polli_loadable_module(LLVMPolyJIT 27 | ${POLYJIT_COMPILETIME_SOURCES} 28 | ) 29 | 30 | target_link_libraries(LLVMPolyJIT INTERFACE LLVMPolly) 31 | target_link_libraries(LLVMPolyJIT PRIVATE absl::base absl::strings spdlog) 32 | target_compile_features(LLVMPolyJIT PUBLIC cxx_std_14) 33 | set_target_properties(LLVMPolyJIT 34 | PROPERTIES 35 | LINKER_LANGUAGE CXX 36 | PREFIX "") 37 | 38 | add_subdirectory(LibPJIT) 39 | add_subdirectory(LibPPROF) 40 | -------------------------------------------------------------------------------- /lib/LibPJIT/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | set(LLVM_LINK_COMPONENTS 2 | ${LLVM_TARGETS_TO_BUILD} 3 | Analysis 4 | AsmParser 5 | BitReader 6 | BitWriter 7 | CodeGen 8 | Core 9 | ExecutionEngine 10 | IRReader 11 | Interpreter 12 | InstCombine 13 | Instrumentation 14 | IPO 15 | Linker 16 | OrcJIT 17 | native 18 | objcarcopts 19 | RuntimeDyld 20 | ScalarOpts 21 | SelectionDAG 22 | Support 23 | Target 24 | TransformUtils 25 | Vectorize 26 | ) 27 | 28 | set(POLLI_LINK_LIBS 29 | Polly 30 | PollyISL 31 | dl 32 | likwid 33 | papi 34 | pthread 35 | pqxx 36 | absl::base 37 | absl::optional 38 | absl::strings 39 | absl::variant 40 | spdlog 41 | ) 42 | 43 | set(POLYJIT_RUNTIME_SOURCES 44 | libpjit.cpp 45 | Compiler.cpp 46 | #Db.cpp 47 | ExportMetrics.cpp 48 | Jit.cpp 49 | RunValues.cpp 50 | ../Runtime/LikwidMarker.cpp 51 | ../Runtime/RuntimeOptimizer.cpp 52 | ../Runtime/VariantFunction.cpp 53 | ../Support/FuncTools.cpp 54 | ../Support/Log.cpp 55 | ../Support/Options.cpp 56 | ../Support/Stats.cpp 57 | ../Support/Tasks.cpp 58 | ../Support/TypeMapper.cpp 59 | ../Support/Utils.cpp 60 | ) 61 | 62 | add_definitions( 63 | -DSPDLOG_NO_DATETIME 64 | -DSPDLOG_NO_THREAD_ID 65 | -DSPDLOG_NO_NAME 66 | -DSPDLOG_NO_ATOMIC_LEVELS 67 | ) 68 | add_polli_library(pjit SHARED 69 | ${POLYJIT_RUNTIME_SOURCES} 70 | ) 71 | target_compile_features(pjit PUBLIC cxx_std_14) 72 | -------------------------------------------------------------------------------- /lib/LibPPROF/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | set(POLYJIT_PPROF_SOURCES 2 | pprof.cpp 3 | libpprof.cpp 4 | libpprof-pgsql.cpp 5 | libpprof-file.cpp 6 | Tracing.cpp 7 | ../Support/Log.cpp 8 | ../Support/Options.cpp 9 | ) 10 | 11 | set(LLVM_LINK_COMPONENTS 12 | ${LLVM_TARGETS_TO_BUILD} 13 | Analysis 14 | AsmParser 15 | BitReader 16 | BitWriter 17 | CodeGen 18 | Core 19 | ExecutionEngine 20 | IRReader 21 | Interpreter 22 | InstCombine 23 | Instrumentation 24 | IPO 25 | Linker 26 | OrcJIT 27 | native 28 | objcarcopts 29 | RuntimeDyld 30 | ScalarOpts 31 | SelectionDAG 32 | Support 33 | Target 34 | TransformUtils 35 | Vectorize 36 | ) 37 | 38 | 39 | set(POLLI_LINK_LIBS 40 | papi 41 | pqxx 42 | pq 43 | ) 44 | 45 | add_polli_library(pprof SHARED 46 | ${POLYJIT_PPROF_SOURCES} 47 | ) 48 | target_compile_features(pprof PUBLIC cxx_std_14) 49 | target_link_libraries(pprof PUBLIC 50 | absl::base absl::strings spdlog) 51 | -------------------------------------------------------------------------------- /lib/LibPPROF/README.md: -------------------------------------------------------------------------------- 1 | # libpprof - Profiling library for use with libpjit # 2 | 3 | libpprof provides methods for tracking PAPI events from within an instrumented 4 | binary. It is used in conjunction with libpjit to provide PAPI measurements 5 | on arbitrary code-regions. 6 | 7 | In order to measure whole code regions, instrumentation calls are placed at 8 | the beginning and the end of each code region. 9 | 10 | A profiling events currently takes 24bytes and consists of these 3 fields: 11 | EventID, EventType, Value. 12 | 13 | libpprof tries to minimize the measurement overhead as much as possible and 14 | therefore starts storing measurement data on disk / in db only during 15 | processing of the atexit() handler. 16 | 17 | ## Features ## 18 | 19 | libpprof supports different output backends for a tracked run: 20 | 21 | * File backend: plain simple file output, no special formatting. 22 | * CSV file backend: csv output with header, values are separated by ',' 23 | * PostgreSQL backend: store runs in a database. 24 | 25 | 26 | ## Configuration ## 27 | 28 | libpprof is configured via environment variables. The following variables 29 | are available: 30 | 31 | ### General options ### 32 | 33 | Name | Type | Description 34 | ---- | ---- | ----------- 35 | PPROF_EXPERIMENT | text | Which experiment does this run belong to. 36 | PPROF_PROJECT | text | Which project does this run belong to. 37 | PPROF_CMD | text | Command line that has been executed. 38 | PPROF_USE_DATABASE | bool | Use the Postgres backend. 39 | PPROF_USE_CSV | bool | Use the CSV file backend. 40 | PPROF_USE_FILE | bool | Use the RAW file backend. 41 | 42 | ### PostgreSQL options ### 43 | 44 | libpq automatically derives missing connection parameters from the 45 | $HOME/.pgpass file. 46 | 47 | Name | Type | Description 48 | ---- | ---- | ----------- 49 | PPROF_DB_HOST | text | Database Host 50 | PPROF_DB_PORT | text | Database Port 51 | PPROF_DB_USER | text | Username to connect with (optional) 52 | PPROF_DB_PASS | text | Password to connect with (optional) 53 | PPROF_DB_NAME | text | Which DB should we select 54 | PPROF_DB_RUN_GROUP | uuid | UUID that identifies a set of runs (required) 55 | 56 | ### CSV file options ### 57 | 58 | Name | Type | Description 59 | ---- | ---- | ----------- 60 | PPROF_CSV_FILE | text | Path to store the csv file in. 61 | 62 | ### RAW file options ### 63 | 64 | Name | Type | Description 65 | ---- | ---- | ----------- 66 | PPROF_FILE_PROFILE | text | Path to store the profile in. 67 | PPROF_FILE_CALLS | text | Path to store the library calls count in. 68 | -------------------------------------------------------------------------------- /lib/LibPPROF/Tracing.cpp: -------------------------------------------------------------------------------- 1 | #include "pprof/Tracing.h" 2 | #include "polli/Options.h" 3 | 4 | #ifdef POLLI_ENABLE_TRACING 5 | namespace polli { 6 | static TracerTy createTracer() { 7 | if (opt::havePapi()) 8 | return TracerTy(new PapiTracer()); 9 | else if (opt::haveLikwid()) 10 | return TracerTy(new LikwidTracer()); 11 | 12 | return TracerTy(new Tracer()); 13 | } 14 | 15 | TracerTy getOrCreateActiveTracer() { 16 | static std::unique_ptr ActiveTracer = createTracer(); 17 | } 18 | } 19 | 20 | #ifdef __cplusplus 21 | extern "C" { 22 | #endif 23 | void polliTracingInit() { polli::getOrCreateActiveTracer()->init(); } 24 | 25 | void polliTracingFinalize() { polli::getOrCreateActiveTracer()->finalize(); } 26 | 27 | void polliTracingRegionStart(uint64_t Id, const char *Name) { 28 | polli::getOrCreateActiveTracer()->regionStart(Id, Name); 29 | } 30 | 31 | void polliTracingRegionStop(uint64_t Id, const char *Name) { 32 | polli::getOrCreateActiveTracer()->regionStop(Id, Name); 33 | } 34 | 35 | void polliTracingScopStart(uint64_t Id, const char *Name) { 36 | polli::getOrCreateActiveTracer()->scopStart(Id, Name); 37 | } 38 | 39 | void polliTracingScopStop(uint64_t Id, const char *Name) { 40 | polli::getOrCreateActiveTracer()->scopStop(Id, Name); 41 | } 42 | #ifdef __cplusplus 43 | } 44 | #endif 45 | #endif // POLLI_ENABLE_TRACING 46 | -------------------------------------------------------------------------------- /lib/Persist/Schema.cpp: -------------------------------------------------------------------------------- 1 | #include "polli/Schema.h" 2 | 3 | namespace polli { 4 | namespace db { 5 | 6 | const std::string RegressionTest::str() const { 7 | return fmt::format(">", runID(), name()); 8 | } 9 | 10 | const std::string RegressionTest::formulate(pqxx::work &W) const { 11 | std::string ModuleStr = W.esc(module()); 12 | std::string NameStr = W.esc(name()); 13 | std::string ProjectNameStr = W.esc(projectName()); 14 | /* Attention: name is not the primary key of this relation. However, by 15 | * checking for name & project_name first, we: 16 | * - avoid duplicated SCoPs for the same project and 17 | * - preserve the original run, where we captured this SCoP. 18 | */ 19 | return fmt::format( 20 | "INSERT INTO {:s} (run_id, project_name, name, module) " 21 | "SELECT {:d}, '{:s}', '{:s}', '{:s}'" 22 | "WHERE NOT EXISTS (SELECT name FROM {:s} WHERE name = '{:s}'" 23 | "AND project_name = '{:s}');", 24 | RegressionTest::TableName, runID(), ProjectNameStr, NameStr, ModuleStr, 25 | RegressionTest::TableName, NameStr, ProjectNameStr); 26 | } 27 | 28 | void Session::commit() { 29 | pqxx::work W(*C); 30 | 31 | for (auto &I : Items) { 32 | I->setProjectName(Opts.project); 33 | I->setRunID(DbOpts.run_id); 34 | W.exec(I->formulate(W)); 35 | } 36 | 37 | W.commit(); 38 | Items.clear(); 39 | } 40 | const std::string RegressionTest::TableName = "regressions"; 41 | } // namespace db 42 | } // end of namespace polli 43 | -------------------------------------------------------------------------------- /lib/PolyJIT.cpp: -------------------------------------------------------------------------------- 1 | //===---------- PolyJIT.cpp - Initialize the PolyJIT Module ---------------===// 2 | // 3 | // The LLVM Compiler Infrastructure 4 | // 5 | // This file is distributed under the University of Illinois Open Source 6 | // License. See LICENSE.TXT for details. 7 | // 8 | //===----------------------------------------------------------------------===// 9 | // 10 | //===----------------------------------------------------------------------===// 11 | 12 | #include "polli/RegisterCompilationPasses.h" 13 | #include "polly/RegisterPasses.h" 14 | 15 | #include "llvm/Transforms/IPO/PassManagerBuilder.h" 16 | 17 | namespace { 18 | class StaticInitializer { 19 | public: 20 | StaticInitializer() { 21 | llvm::PassRegistry &Registry = *llvm::PassRegistry::getPassRegistry(); 22 | polly::initializePollyPasses(Registry); 23 | polli::initializePolliPasses(Registry); 24 | } 25 | }; 26 | static StaticInitializer InitializeEverything; 27 | } // end of anonymous namespace 28 | -------------------------------------------------------------------------------- /lib/Support/FuncTools.cpp: -------------------------------------------------------------------------------- 1 | #include "polli/FuncTools.h" 2 | #include "llvm/IR/Instruction.h" 3 | #include "llvm/IR/Instructions.h" 4 | #include "llvm/IR/IntrinsicInst.h" 5 | #include "llvm/Support/Casting.h" 6 | #include "llvm/Support/raw_ostream.h" 7 | 8 | using namespace llvm; 9 | using ExprList = SetVector; 10 | 11 | namespace polli { 12 | 13 | /** 14 | * @brief Collect all global variables used within this Instruction. 15 | * 16 | * We need to keep track of global vars, when extracting prototypes. 17 | * This is used in conjunction with the apply function. 18 | * 19 | * @param I The Instruction we collect globals from. 20 | * @param Globals A list of globals we collected so far. 21 | * @return void 22 | */ 23 | void selectGV(Instruction &I, GlobalList &Globals) { 24 | if (isa(&I)) 25 | return; 26 | 27 | for (unsigned i = 0; i < I.getNumOperands(); i++) { 28 | Value *V = I.getOperand(i); 29 | 30 | if (V) { 31 | // RemapCalls can take care of this. 32 | if (!isa(V)) 33 | if (GlobalValue *GV = dyn_cast(V)) { 34 | Globals.insert(GV); 35 | } 36 | 37 | if (ConstantExpr *C = dyn_cast(V)) { 38 | Instruction *Inst = C->getAsInstruction(); 39 | selectGV(*Inst, Globals); 40 | } 41 | } 42 | } 43 | } 44 | 45 | using InstrList = SmallVector; 46 | /** 47 | * @brief Convert a ConstantExpr pointer operand to an Instruction Value. 48 | * 49 | * This is used in conjunction with the apply function. 50 | * 51 | * @param I The Instruction we want to convert the operand in. 52 | * @param Converted A list of Instructions where we keep track of all found 53 | * Instructions so far. 54 | * @return void 55 | */ 56 | void constantExprToInstruction(Instruction &I, InstrList &Converted, 57 | ValueToValueMapTy &VMap) { 58 | ValueToValueMapTy OperandMap; 59 | for (auto &Op : I.operands()) { 60 | Value *V = Op.get(); 61 | if (ConstantExpr *C = dyn_cast(V)) { 62 | Instruction *Inst = C->getAsInstruction(); 63 | Inst->insertBefore(&I); 64 | OperandMap[V] = Inst; 65 | constantExprToInstruction(*Inst, Converted, VMap); 66 | Converted.push_back(&I); 67 | } 68 | } 69 | 70 | for (unsigned i = 0; i < I.getNumOperands(); ++i) { 71 | Value *OldOp = I.getOperand(i); 72 | if (OperandMap.count(OldOp)) { 73 | I.setOperand(i, OperandMap[OldOp]); 74 | } 75 | } 76 | } 77 | } // namespace polli 78 | -------------------------------------------------------------------------------- /lib/Support/Log.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | #include "polli/Options.h" 4 | #include "polli/log.h" 5 | #include "spdlog/spdlog.h" 6 | 7 | #include 8 | #include 9 | #include 10 | 11 | namespace { 12 | static std::string &getLogOutFile() { 13 | static __pid_t Pid = getpid(); 14 | static std::string LogFile = fmt::format("./polyjit.{:d}.log", Pid); 15 | return LogFile; 16 | } 17 | 18 | static inline std::vector &global_init() { 19 | static bool Init = false; 20 | static std::vector Sinks; 21 | 22 | if (Init) 23 | return Sinks; 24 | 25 | Init = true; 26 | spdlog::set_pattern("%L: %v"); 27 | 28 | if (polli::opt::EnableLogFile && 29 | (polli::opt::LogLevel != spdlog::level::off)) { 30 | spdlog::set_async_mode(1048576); 31 | 32 | auto Sink = std::make_shared( 33 | getLogOutFile(), true); 34 | Sink->set_force_flush(true); 35 | Sinks.push_back(Sink); 36 | } else { 37 | Sinks.push_back(std::make_shared()); 38 | } 39 | 40 | return Sinks; 41 | } 42 | 43 | static inline void setup(const std::string &Name, const spdlog::level::level_enum Level) { 44 | if (!spdlog::get(Name)) { 45 | auto &Sinks = global_init(); 46 | auto Logger = 47 | std::make_shared(Name, Sinks.begin(), Sinks.end()); 48 | spdlog::register_logger(Logger); 49 | Logger->set_level(Level); 50 | } 51 | } 52 | } // namespace 53 | 54 | namespace polli { 55 | std::shared_ptr register_log(const std::string &Name, 56 | const spdlog::level::level_enum Level) { 57 | setup(Name, Level); 58 | return spdlog::get(Name); 59 | } 60 | } // namespace polli 61 | -------------------------------------------------------------------------------- /lib/Support/Stats.cpp: -------------------------------------------------------------------------------- 1 | #include "polli/Stats.h" 2 | #include "polli/log.h" 3 | 4 | #include "llvm/IR/Function.h" 5 | #include "llvm/IR/IRBuilder.h" 6 | #include "llvm/IR/TypeBuilder.h" 7 | 8 | #include "polli/Jit.h" 9 | #include "pprof/pprof.h" 10 | 11 | using namespace llvm; 12 | 13 | REGISTER_LOG(console, "stats"); 14 | 15 | namespace llvm { 16 | template class TypeBuilder { 17 | public: 18 | static StructType *get(LLVMContext &Context) { 19 | return StructType::get(TypeBuilder, xcompile>::get(Context), 20 | TypeBuilder, xcompile>::get(Context), 21 | TypeBuilder, xcompile>::get(Context), 22 | TypeBuilder, xcompile>::get(Context), 23 | TypeBuilder, xcompile>::get(Context), 24 | TypeBuilder, xcompile>::get(Context)); 25 | } 26 | 27 | enum Fields { 28 | NUM_CALLS, 29 | LOOKUP_TIME, 30 | LAST_RUNTIME, 31 | JUMP_INTO_JIT, 32 | REGION_ENTER, 33 | REGION_EXIT 34 | }; 35 | }; 36 | } // namespace llvm 37 | 38 | namespace polli { 39 | Value *registerStatStruct(Function &F, const Twine &NameSuffix) { 40 | Type *Ty = TypeBuilder::get(F.getContext()); 41 | Constant *Init = Constant::getNullValue(Ty); 42 | GlobalVariable *GV = new GlobalVariable(*(F.getParent()), Ty, false, 43 | GlobalValue::PrivateLinkage, Init, 44 | "polyjit.stats." + NameSuffix); 45 | F.setPrefixData(GV); 46 | return GV; 47 | } 48 | 49 | uint64_t GetCandidateId(const Function &F) { 50 | uint64_t N = 0; 51 | std::string NameTag = "polyjit-id"; 52 | if (F.hasFnAttribute(NameTag)) { 53 | auto FnAttr = F.getFnAttribute(NameTag); 54 | FnAttr.getValueAsString().getAsInteger(10, N); 55 | } 56 | 57 | assert(N && "Could not find the polyjit-id!"); 58 | if (N == 0) 59 | console->critical("Could not find the polyjit-id!"); 60 | return N; 61 | } 62 | 63 | #if 0 64 | static inline void printStats(const llvm::Function &F, const Stats &S) { 65 | SPDLOG_DEBUG("stats", 66 | "F: {:s} ID: {:x} N: {:d} LT: {:d} RT: {:d} Overhead: {:3.2f}%", 67 | F.getName().str(), (uint64_t)(&S), S.NumCalls, S.LookupTime, 68 | S.LastRuntime, (S.LookupTime * 100 / (double)S.LastRuntime)); 69 | } 70 | #endif 71 | } // namespace polli 72 | -------------------------------------------------------------------------------- /lib/Support/Tasks.cpp: -------------------------------------------------------------------------------- 1 | #include "polli/Tasks.h" 2 | #include "polli/log.h" 3 | #include "pprof/pprof.h" 4 | 5 | namespace { 6 | REGISTER_LOG(console, "tasks"); 7 | } // namespace 8 | 9 | namespace polli { 10 | TaskSystem::TaskSystem() { 11 | for (unsigned N = 0; N < Count; ++N) { 12 | Threads.emplace_back([&, N] { run(N); }); 13 | } 14 | } 15 | 16 | void TaskSystem::run(unsigned i) { 17 | pthread_setname_np(pthread_self(), 18 | fmt::format("pjit_worker_{:d}", i).c_str()); 19 | while (true) { 20 | std::function F; 21 | 22 | for (unsigned N = 0; N != Count * 32; ++N) { 23 | if (JobQs[(i + N) % Count].try_pop(F)) 24 | break; 25 | } 26 | 27 | if (!F && !JobQs[i].pop(F)) 28 | break; 29 | 30 | F(); 31 | } 32 | } 33 | } // namespace polli 34 | -------------------------------------------------------------------------------- /test/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | add_subdirectory(Catch) 2 | add_subdirectory(Unit) 3 | 4 | set(POLLI_TEST_DIRECTORIES 5 | "JitScops" 6 | "Globals" 7 | "Run" 8 | "pprof" 9 | "BasePointers" 10 | ) 11 | 12 | set(POLLI_SOURCE_DIR "${CMAKE_CURRENT_SOURCE_DIR}/..") 13 | set(LLVM_SHLIBEXT "${CMAKE_SHARED_MODULE_SUFFIX}") 14 | 15 | set(POLLI_TEST_DEPENDS LLVMPolyJIT) 16 | 17 | # We don't have another one available, maybe ask llvm-config? 18 | set(LLVM_SOURCE_DIR "${LLVM_INSTALL_ROOT}") 19 | set(LLVM_BINARY_DIR "${LLVM_INSTALL_ROOT}") 20 | set(LLVM_TOOLS_DIR "${LLVM_INSTALL_ROOT}/bin") 21 | set(LLVM_LIBS_DIR "${LLVM_INSTALL_ROOT}/lib") 22 | set(POLLI_LIB_DIR "${POLLI_BINARY_DIR}/lib") 23 | set(POLLI_BINARY_DIR "${POLLI_BINARY_DIR}/bin") 24 | set(POLLI_OBJ_ROOT "${POLLI_BINARY_DIR}") 25 | 26 | # We are building polli out of tree, adjust the settings. 27 | # FIXME: FileCheck is not available in llvm install directory at the moment. 28 | if(NOT LLVM_OBJ_ROOT) 29 | exec_program(${LLVM_INSTALL_ROOT}/bin/llvm-config 30 | ARGS --obj-root 31 | OUTPUT_VARIABLE LLVM_OBJ_ROOT) 32 | endif(NOT LLVM_OBJ_ROOT) 33 | set(LLVM_LIT ${LLVM_OBJ_ROOT}/bin/llvm-lit) 34 | 35 | include(FindPythonInterp) 36 | if(PYTHONINTERP_FOUND) 37 | option(POLLI_TEST_DISABLE_BAR "Run Polli tests with --no-progress-bar" OFF) 38 | set(POLLI_TEST_EXTRA_ARGS) 39 | if (MSVC OR XCODE OR POLLI_TEST_DISABLE_BAR) 40 | set(POLLI_TEST_EXTRA_ARGS "--no-progress-bar") 41 | endif() 42 | 43 | option(POLLI_TEST_USE_VG "Run Polli tests under Valgrind" OFF) 44 | if(POLLI_TEST_USE_VG) 45 | set(POLLI_TEST_EXTRA_ARGS ${POLLI_TEST_EXTRA_ARGS} "--vg") 46 | endif () 47 | 48 | foreach(testdir ${POLLI_TEST_DIRECTORIES}) 49 | add_custom_target(polli-test-${testdir} 50 | COMMAND ${LLVM_LIT} 51 | --param polli_site_config=${CMAKE_CURRENT_BINARY_DIR}/lit.site.cfg 52 | --param build_config=${CMAKE_CFG_INTDIR} 53 | -sv ${POLLI_TEST_EXTRA_ARGS} 54 | ${CMAKE_CURRENT_BINARY_DIR}/${testdir} 55 | DEPENDS ${POLLI_TEST_DEPENDS} 56 | COMMENT "Running Polli regression tests in ${testdir}") 57 | endforeach() 58 | 59 | add_custom_target(check-polli 60 | COMMAND ${LLVM_LIT} 61 | --param polli_site_config=${CMAKE_CURRENT_BINARY_DIR}/lit.site.cfg 62 | --param build_config=${CMAKE_CFG_INTDIR} 63 | -sv ${POLLI_TEST_EXTRA_ARGS} 64 | ${CMAKE_CURRENT_BINARY_DIR} 65 | DEPENDS ${POLLI_TEST_DEPENDS} 66 | COMMENT "Running Polli regression tests") 67 | endif() 68 | 69 | configure_file( 70 | ${CMAKE_CURRENT_SOURCE_DIR}/lit.site.cfg.in 71 | ${CMAKE_CURRENT_BINARY_DIR}/lit.site.cfg 72 | ) 73 | -------------------------------------------------------------------------------- /test/Catch/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | set(POLLI_LINK_LIBS 2 | papi 3 | pjit 4 | likwid 5 | LLVMCore 6 | LLVMSupport 7 | ) 8 | 9 | remove_definitions(-DPOLLI_ENABLE_TRACING) 10 | add_polli_executable(test-polyjit 11 | CatchTests.cpp 12 | # test_RunValues.cpp 13 | # test_RuntimeValues.cpp 14 | ) 15 | 16 | set(EXTRA_CATCH_FLAGS "-fexceptions") 17 | 18 | get_target_property(FLAGS test-polyjit COMPILE_FLAGS) 19 | if (FLAGS STREQUAL "FLAGS-NOTFOUND") 20 | set(FLAGS "") 21 | else() 22 | set(FLAGS "${FLAGS} ") 23 | endif() 24 | set (FLAGS "${FLAGS} ${EXTRA_CATCH_FLAGS}") 25 | 26 | set_target_properties(test-polyjit 27 | PROPERTIES 28 | COMPILE_FLAGS 29 | ${FLAGS} 30 | ) 31 | -------------------------------------------------------------------------------- /test/Catch/CatchTests.cpp: -------------------------------------------------------------------------------- 1 | #define CATCH_CONFIG_MAIN 2 | #include "catch.hpp" 3 | -------------------------------------------------------------------------------- /test/Catch/test_RuntimeValues.cpp: -------------------------------------------------------------------------------- 1 | #include "catch.hpp" 2 | #include "llvm/ADT/SmallVector.h" 3 | #include "llvm/IR/Function.h" 4 | #include "llvm/IR/GlobalValue.h" 5 | #include "llvm/IR/LLVMContext.h" 6 | #include "llvm/IR/Module.h" 7 | #include "llvm/IR/Type.h" 8 | 9 | #include "polli/RunValues.h" 10 | #include "llvm/Support/raw_ostream.h" 11 | 12 | #include 13 | 14 | using llvm::Attribute; 15 | using llvm::AttrBuilder; 16 | using llvm::Module; 17 | using llvm::Function; 18 | using llvm::LLVMContext; 19 | using llvm::FunctionType; 20 | using llvm::Type; 21 | using llvm::GlobalValue; 22 | using llvm::SmallVector; 23 | 24 | using polli::SpecializerRequest; 25 | using polli::RunValueList; 26 | using polli::runValues; 27 | 28 | SCENARIO("String-Attribute attached to function arguments", "[unit]") { 29 | LLVMContext Ctx; 30 | auto M = std::make_shared("test_RunValues", Ctx); 31 | 32 | GIVEN("An llvm function that has one argument.") { 33 | SmallVector Args; 34 | Args.push_back(Type::getInt64Ty(Ctx)); 35 | Function *F = Function::Create( 36 | FunctionType::get(Type::getVoidTy(Ctx), Args, false), 37 | GlobalValue::ExternalLinkage, "test_attributes", M.get()); 38 | 39 | WHEN("The attribute 'polli.specialize' is attached to the first argument") { 40 | Attribute ParamAttr = llvm::Attribute::get(Ctx, "polli.specialize"); 41 | AttrBuilder Builder(ParamAttr); 42 | F->addParamAttrs(0, Builder); 43 | THEN("The first Fn attribute has string value 'polli.specialize'") { 44 | Attribute FnArgAttr = F->getAttribute(1, "polli.specialize"); 45 | REQUIRE(FnArgAttr.getAsString() == "\"polli.specialize\""); 46 | REQUIRE(ParamAttr.getAsString() == "\"polli.specialize\""); 47 | } 48 | } 49 | } 50 | } 51 | -------------------------------------------------------------------------------- /test/Globals/global-int-var.c: -------------------------------------------------------------------------------- 1 | // RUN: %clang_cc1 -emit-llvm -O2 -load LLVMPolly.so -load LLVMPolyJIT.so -mllvm -polli -mllvm -polli-process-unprofitable -o /dev/stderr %s -mllvm -polli-analyze -mllvm -stats 2>&1 | FileCheck %s 2 | // Check that we can handle a single global variable during compilation. 3 | 4 | static int A[10240]; 5 | 6 | void test(int n) { 7 | #pragma nounroll 8 | for (int i = 0; i < 1024; i++) { 9 | A[i*n] = A[i] + n; 10 | } 11 | } 12 | 13 | int main(int argc, char **argv) { 14 | test(10); 15 | 16 | return A[0]; 17 | } 18 | // CHECK: @A_POLYJIT_GLOBAL_{{[0-9]+}} = local_unnamed_addr global [10240 x i32] zeroinitializer, align 16 19 | 20 | // CHECK: polyjit.entry: 21 | // CHECK-NEXT: %params = alloca [2 x i8*], align 8 22 | // CHECK-NEXT: %pjit.stack.param = alloca i32, align 4 23 | // CHECK-NEXT: store i32 %n, i32* %pjit.stack.param, align 4 24 | // CHECK-NEXT: %1 = bitcast [2 x i8*]* %params to i32** 25 | // CHECK-NEXT: store i32* %pjit.stack.param, i32** %1, align 8 26 | // CHECK-NEXT: %pjit.stack.param1 = alloca i64, align 8 27 | // CHECK-NEXT: store i64 %0, i64* %pjit.stack.param1, align 8 28 | // CHECK-NEXT: %2 = getelementptr inbounds [2 x i8*], [2 x i8*]* %params, i64 0, i64 1 29 | // CHECK-NEXT: %3 = bitcast i8** %2 to i64** 30 | // CHECK-NEXT: store i64* %pjit.stack.param1, i64** %3, align 8 31 | // CHECK-NEXT: %4 = bitcast [2 x i8*]* %params to i8* 32 | // CHECK-NEXT: %5 = call i1 @pjit_main(i8* getelementptr inbounds ([{{[0-9]+}} x i8], [{{[0-9]+}} x i8]* @test_0.pjit.scop.prototype, i64 0, i64 0), i64* getelementptr inbounds ({ i64, i64, i64, i1, i64, i64 }, { i64, i64, i64, i1, i64, i64 }* @polyjit.stats.test_0.pjit.scop.1, i64 0, i32 0), i32 2, i8* nonnull %4) #3 33 | -------------------------------------------------------------------------------- /test/Globals/global-multiple-structs.c: -------------------------------------------------------------------------------- 1 | // RUN: %clang_cc1 -emit-llvm -O2 -load LLVMPolly.so -load LLVMPolyJIT.so -mllvm -polli -mllvm -polli-process-unprofitable -o /dev/stderr %s -mllvm -polli-analyze -mllvm -stats 2>&1 | FileCheck %s 2 | 3 | // Check that we can handle a single global variable during compilation. 4 | 5 | typedef struct { 6 | int A[10240]; 7 | } TestA; 8 | TestA StructA; 9 | TestA StructB; 10 | 11 | void test(int n) { 12 | #pragma nounroll 13 | for (int i = 0; i < 1024; i++) { 14 | StructA.A[i*n] = StructA.A[i] + n; 15 | StructB.A[i*n] = StructA.A[i] + n; 16 | } 17 | } 18 | 19 | int main(int argc, char **argv) { 20 | test(10); 21 | 22 | return StructB.A[0]; 23 | } 24 | // CHECK: @StructA = common local_unnamed_addr global %struct.TestA zeroinitializer, align 4 25 | // CHECK: @StructB = common local_unnamed_addr global %struct.TestA zeroinitializer, align 4 26 | 27 | // CHECK: polyjit.entry: 28 | // CHECK-NEXT: %params = alloca [3 x i8*], align 8 29 | // CHECK-NEXT: %pjit.stack.param = alloca i32, align 4 30 | // CHECK-NEXT: store i32 %n, i32* %pjit.stack.param, align 4 31 | // CHECK-NEXT: %2 = bitcast [3 x i8*]* %params to i32** 32 | // CHECK-NEXT: store i32* %pjit.stack.param, i32** %2, align 8 33 | // CHECK-NEXT: %pjit.stack.param1 = alloca i64, align 8 34 | // CHECK-NEXT: store i64 %0, i64* %pjit.stack.param1, align 8 35 | // CHECK-NEXT: %3 = getelementptr inbounds [3 x i8*], [3 x i8*]* %params, i64 0, i64 1 36 | // CHECK-NEXT: %4 = bitcast i8** %3 to i64** 37 | // CHECK-NEXT: store i64* %pjit.stack.param1, i64** %4, align 8 38 | // CHECK-NEXT: %pjit.stack.param2 = alloca i64, align 8 39 | // CHECK-NEXT: store i64 %1, i64* %pjit.stack.param2, align 8 40 | // CHECK-NEXT: %5 = getelementptr inbounds [3 x i8*], [3 x i8*]* %params, i64 0, i64 2 41 | // CHECK-NEXT: %6 = bitcast i8** %5 to i64** 42 | // CHECK-NEXT: store i64* %pjit.stack.param2, i64** %6, align 8 43 | // CHECK-NEXT: %7 = bitcast [3 x i8*]* %params to i8* 44 | // CHECK-NEXT: %8 = call i1 @pjit_main(i8* getelementptr inbounds ([{{[0-9]+}} x i8], [{{[0-9]+}} x i8]* @test_0.pjit.scop.prototype, i64 0, i64 0), i64* getelementptr inbounds ({ i64, i64, i64, i1, i64, i64 }, { i64, i64, i64, i1, i64, i64 }* @polyjit.stats.test_0.pjit.scop.1, i64 0, i32 0), i32 3, i8* nonnull %7) #3 45 | -------------------------------------------------------------------------------- /test/Globals/global-struct-var.c: -------------------------------------------------------------------------------- 1 | // RUN: %clang_cc1 -emit-llvm -O2 -load LLVMPolly.so -load LLVMPolyJIT.so -mllvm -polli -mllvm -polli-process-unprofitable -o /dev/stderr %s -mllvm -polli-analyze -mllvm -stats 2>&1 | FileCheck %s 2 | 3 | // Check that we can handle a single global variable during compilation. 4 | 5 | typedef struct { 6 | int A[10240]; 7 | } TestA; 8 | static TestA StructA; 9 | 10 | void test(int n) { 11 | #pragma nounroll 12 | for (int i = 0; i < 1024; i++) { 13 | StructA.A[i*n] = StructA.A[i] + n; 14 | } 15 | } 16 | 17 | int main(int argc, char **argv) { 18 | test(10); 19 | 20 | return StructA.A[0]; 21 | } 22 | // CHECK: @StructA_POLYJIT_GLOBAL_{{[0-9]+}} = local_unnamed_addr global %struct.TestA zeroinitializer, align 4 23 | 24 | // CHECK: polyjit.entry: 25 | // CHECK-NEXT: %params = alloca [2 x i8*], align 8 26 | // CHECK-NEXT: %pjit.stack.param = alloca i32, align 4 27 | // CHECK-NEXT: store i32 %n, i32* %pjit.stack.param, align 4 28 | // CHECK-NEXT: %1 = bitcast [2 x i8*]* %params to i32** 29 | // CHECK-NEXT: store i32* %pjit.stack.param, i32** %1, align 8 30 | // CHECK-NEXT: %pjit.stack.param1 = alloca i64, align 8 31 | // CHECK-NEXT: store i64 %0, i64* %pjit.stack.param1, align 8 32 | // CHECK-NEXT: %2 = getelementptr inbounds [2 x i8*], [2 x i8*]* %params, i64 0, i64 1 33 | // CHECK-NEXT: %3 = bitcast i8** %2 to i64** 34 | // CHECK-NEXT: store i64* %pjit.stack.param1, i64** %3, align 8 35 | // CHECK-NEXT: %4 = bitcast [2 x i8*]* %params to i8* 36 | // CHECK-NEXT: %5 = call i1 @pjit_main(i8* getelementptr inbounds ([{{[0-9]+}} x i8], [{{[0-9]+}} x i8]* @test_0.pjit.scop.prototype, i64 0, i64 0), i64* getelementptr inbounds ({ i64, i64, i64, i1, i64, i64 }, { i64, i64, i64, i1, i64, i64 }* @polyjit.stats.test_0.pjit.scop.1, i64 0, i32 0), i32 2, i8* nonnull %4) #3 37 | -------------------------------------------------------------------------------- /test/JitScops/linpack_daxpy_r_for.body.scop0.ll: -------------------------------------------------------------------------------- 1 | ; RUN: opt -S -load LLVMPolly.so -load LLVMPolyJIT.so -polli-process-unprofitable -polli-detect-scops -polli -analyze < %s 2>&1 | FileCheck %s 2 | 3 | ; CHECK: 1 regions require runtime support: 4 | ; CHECK: 0 region {{.*}} => {{.*}} requires 8 params 5 | 6 | target datalayout = "e-m:e-i64:64-f80:128-n8:16:32:64-S128" 7 | target triple = "x86_64-unknown-linux-gnu" 8 | 9 | define void @daxpy_r_for.body.scop0(i64, i64, double* %dy, i64, i64, double* %dx, double %da, i64) { 10 | newFuncRoot: 11 | br label %for.body 12 | 13 | for.cond.for.end41.loopexit2_crit_edge.exitStub: ; preds = %for.body 14 | ret void 15 | 16 | for.body: ; preds = %for.body, %newFuncRoot 17 | %indvar9 = phi i64 [ 0, %newFuncRoot ], [ %indvar.next10, %for.body ] 18 | %5 = mul i64 %0, %indvar9 19 | %6 = add i64 %1, %5 20 | %arrayidx24 = getelementptr double, double* %dy, i64 %6 21 | %7 = mul i64 %2, %indvar9 22 | %8 = add i64 %3, %7 23 | %arrayidx20 = getelementptr double, double* %dx, i64 %8 24 | %9 = load double, double* %arrayidx24, align 8 25 | %10 = load double, double* %arrayidx20, align 8 26 | %mul21 = fmul double %10, %da 27 | %add22 = fadd double %9, %mul21 28 | store double %add22, double* %arrayidx24, align 8 29 | %indvar.next10 = add i64 %indvar9, 1 30 | %exitcond11 = icmp ne i64 %indvar.next10, %4 31 | br i1 %exitcond11, label %for.body, label %for.cond.for.end41.loopexit2_crit_edge.exitStub 32 | } 33 | -------------------------------------------------------------------------------- /test/JitScops/linpack_daxpy_r_for.cond28.preheader.scop1.ll: -------------------------------------------------------------------------------- 1 | ; RUN: opt -S -load LLVMPolly.so -load LLVMPolyJIT.so -polli-process-unprofitable -polly-use-runtime-alias-checks=false -polli-detect-scops -polli -analyze < %s 2>&1 | FileCheck %s 2 | 3 | ;CHECK: 1 regions require runtime support: 4 | 5 | target datalayout = "e-m:e-i64:64-f80:128-n8:16:32:64-S128" 6 | target triple = "x86_64-unknown-linux-gnu" 7 | 8 | define void @daxpy_r_for.cond28.preheader.scop1(i32 %n, double* %dy, double* %dx, double %da) { 9 | newFuncRoot: 10 | br label %for.cond28.preheader 11 | 12 | for.end41.exitStub: ; preds = %for.end41.loopexit 13 | ret void 14 | 15 | for.cond28.preheader: ; preds = %newFuncRoot 16 | %cmp293 = icmp sgt i32 %n, 0 17 | br i1 %cmp293, label %for.body30.lr.ph, label %for.end41.loopexit 18 | 19 | for.body30.lr.ph: ; preds = %for.cond28.preheader 20 | br label %for.body30 21 | 22 | for.body30: ; preds = %for.body30, %for.body30.lr.ph 23 | %indvar = phi i64 [ 0, %for.body30.lr.ph ], [ %indvar.next, %for.body30 ] 24 | %.moved.to.for.body30 = zext i32 %n to i64 25 | %arrayidx38 = getelementptr double, double* %dy, i64 %indvar 26 | %arrayidx34 = getelementptr double, double* %dx, i64 %indvar 27 | %0 = load double, double* %arrayidx38, align 8 28 | %1 = load double, double* %arrayidx34, align 8 29 | %mul35 = fmul double %1, %da 30 | %add36 = fadd double %0, %mul35 31 | store double %add36, double* %arrayidx38, align 8 32 | %indvar.next = add i64 %indvar, 1 33 | %exitcond = icmp ne i64 %indvar.next, %.moved.to.for.body30 34 | br i1 %exitcond, label %for.body30, label %for.cond28.for.end41.loopexit_crit_edge 35 | 36 | for.cond28.for.end41.loopexit_crit_edge: ; preds = %for.body30 37 | br label %for.end41.loopexit 38 | 39 | for.end41.loopexit: ; preds = %for.cond28.for.end41.loopexit_crit_edge, %for.cond28.preheader 40 | br label %for.end41.exitStub 41 | } 42 | -------------------------------------------------------------------------------- /test/JitScops/linpack_daxpy_ur_for.body.scop1.ll: -------------------------------------------------------------------------------- 1 | ; RUN: opt -S -load LLVMPolly.so -load LLVMPolyJIT.so -polli-process-unprofitable -polli-detect-scops -polli -analyze < %s 2>&1 | FileCheck %s 2 | 3 | ; CHECK: 1 regions require runtime support: 4 | ; CHECK: 0 region {{.*}} => {{.*}} requires 8 params 5 | 6 | target datalayout = "e-m:e-i64:64-f80:128-n8:16:32:64-S128" 7 | target triple = "x86_64-unknown-linux-gnu" 8 | 9 | define void @daxpy_ur_for.body.scop1(i64, i64, double* %dy, i64, i64, double* %dx, double %da, i64) { 10 | newFuncRoot: 11 | br label %for.body 12 | 13 | for.cond.for.end94.loopexit2_crit_edge.exitStub: ; preds = %for.body 14 | ret void 15 | 16 | for.body: ; preds = %for.body, %newFuncRoot 17 | %indvar13 = phi i64 [ 0, %newFuncRoot ], [ %indvar.next14, %for.body ] 18 | %5 = mul i64 %0, %indvar13 19 | %6 = add i64 %1, %5 20 | %arrayidx24 = getelementptr double, double* %dy, i64 %6 21 | %7 = mul i64 %2, %indvar13 22 | %8 = add i64 %3, %7 23 | %arrayidx20 = getelementptr double, double* %dx, i64 %8 24 | %9 = load double, double* %arrayidx24, align 8 25 | %10 = load double, double* %arrayidx20, align 8 26 | %mul21 = fmul double %10, %da 27 | %add22 = fadd double %9, %mul21 28 | store double %add22, double* %arrayidx24, align 8 29 | %indvar.next14 = add i64 %indvar13, 1 30 | %exitcond15 = icmp ne i64 %indvar.next14, %4 31 | br i1 %exitcond15, label %for.body, label %for.cond.for.end94.loopexit2_crit_edge.exitStub 32 | } 33 | -------------------------------------------------------------------------------- /test/JitScops/linpack_daxpy_ur_for.cond30.preheader.scop0.ll: -------------------------------------------------------------------------------- 1 | ; RUN: opt -S -load LLVMPolly.so -load LLVMPolyJIT.so -polli-process-unprofitable -polly-use-runtime-alias-checks=false -polli-detect-scops -polli -analyze < %s 2>&1 | FileCheck %s 2 | 3 | ; CHECK: 1 regions require runtime support: 4 | 5 | target datalayout = "e-m:e-i64:64-f80:128-n8:16:32:64-S128" 6 | target triple = "x86_64-unknown-linux-gnu" 7 | 8 | define void @daxpy_ur_for.cond30.preheader.scop0(i32 %rem, double* %dy, double* %dx, double %da) { 9 | newFuncRoot: 10 | br label %for.cond30.preheader 11 | 12 | for.end43.exitStub: ; preds = %for.cond30.for.end43_crit_edge, %for.cond30.preheader 13 | ret void 14 | 15 | for.cond30.preheader: ; preds = %newFuncRoot 16 | %cmp315 = icmp sgt i32 %rem, 0 17 | br i1 %cmp315, label %for.body32.lr.ph, label %for.end43.exitStub 18 | 19 | for.body32.lr.ph: ; preds = %for.cond30.preheader 20 | br label %for.body32 21 | 22 | for.body32: ; preds = %for.body32, %for.body32.lr.ph 23 | %indvar11 = phi i64 [ 0, %for.body32.lr.ph ], [ %indvar.next12, %for.body32 ] 24 | %.moved.to.for.body32 = zext i32 %rem to i64 25 | %arrayidx40 = getelementptr double, double* %dy, i64 %indvar11 26 | %arrayidx36 = getelementptr double, double* %dx, i64 %indvar11 27 | %0 = load double, double* %arrayidx40, align 8 28 | %1 = load double, double* %arrayidx36, align 8 29 | %mul37 = fmul double %1, %da 30 | %add38 = fadd double %0, %mul37 31 | store double %add38, double* %arrayidx40, align 8 32 | %indvar.next12 = add i64 %indvar11, 1 33 | %exitcond = icmp ne i64 %indvar.next12, %.moved.to.for.body32 34 | br i1 %exitcond, label %for.body32, label %for.cond30.for.end43_crit_edge 35 | 36 | for.cond30.for.end43_crit_edge: ; preds = %for.body32 37 | br label %for.end43.exitStub 38 | } 39 | -------------------------------------------------------------------------------- /test/JitScops/linpack_ddot_r_for.cond21.preheader.scop1.ll: -------------------------------------------------------------------------------- 1 | ; RUN: opt -S -load LLVMPolly.so -load LLVMPolyJIT.so -polli-process-unprofitable -polly-use-runtime-alias-checks=false -polli-detect-scops -polli -analyze < %s 2>&1 | FileCheck %s 2 | 3 | ; CHECK: 1 regions require runtime support: 4 | 5 | target datalayout = "e-m:e-i64:64-f80:128-n8:16:32:64-S128" 6 | target triple = "x86_64-unknown-linux-gnu" 7 | 8 | define void @ddot_r_for.cond21.preheader.scop1(i32 %n, double* %dtemp.1.lcssa.reg2mem, double* %dtemp.13.reg2mem, double* %dx, double* %dy, double* %retval.0.reg2mem) { 9 | newFuncRoot: 10 | br label %for.cond21.preheader 11 | 12 | return.exitStub: ; preds = %return.loopexit 13 | ret void 14 | 15 | for.cond21.preheader: ; preds = %newFuncRoot 16 | %cmp222 = icmp sgt i32 %n, 0 17 | store double 0.000000e+00, double* %dtemp.1.lcssa.reg2mem 18 | br i1 %cmp222, label %for.inc30.lr.ph, label %return.loopexit 19 | 20 | for.inc30.lr.ph: ; preds = %for.cond21.preheader 21 | store double 0.000000e+00, double* %dtemp.13.reg2mem 22 | br label %for.inc30 23 | 24 | for.inc30: ; preds = %for.inc30, %for.inc30.lr.ph 25 | %indvar = phi i64 [ 0, %for.inc30.lr.ph ], [ %indvar.next, %for.inc30 ] 26 | %.moved.to.for.inc30 = zext i32 %n to i64 27 | %dtemp.13.reload = load double, double* %dtemp.13.reg2mem 28 | %arrayidx25 = getelementptr double, double* %dx, i64 %indvar 29 | %arrayidx27 = getelementptr double, double* %dy, i64 %indvar 30 | %0 = load double, double* %arrayidx25, align 8 31 | %1 = load double, double* %arrayidx27, align 8 32 | %mul28 = fmul double %0, %1 33 | %add29 = fadd double %dtemp.13.reload, %mul28 34 | %indvar.next = add i64 %indvar, 1 35 | %exitcond = icmp ne i64 %indvar.next, %.moved.to.for.inc30 36 | store double %add29, double* %dtemp.13.reg2mem 37 | br i1 %exitcond, label %for.inc30, label %for.cond21.return.loopexit_crit_edge 38 | 39 | for.cond21.return.loopexit_crit_edge: ; preds = %for.inc30 40 | %2 = load double, double* %dtemp.13.reg2mem 41 | store double %2, double* %dtemp.1.lcssa.reg2mem 42 | br label %return.loopexit 43 | 44 | return.loopexit: ; preds = %for.cond21.return.loopexit_crit_edge, %for.cond21.preheader 45 | %dtemp.1.lcssa.reload = load double, double* %dtemp.1.lcssa.reg2mem 46 | store double %dtemp.1.lcssa.reload, double* %retval.0.reg2mem 47 | br label %return.exitStub 48 | } 49 | -------------------------------------------------------------------------------- /test/JitScops/linpack_ddot_r_for.inc.scop0.ll: -------------------------------------------------------------------------------- 1 | ; RUN: opt -S -load LLVMPolly.so -load LLVMPolyJIT.so -polli-process-unprofitable -polli-detect-scops -polli -analyze < %s 2>&1 | FileCheck %s 2 | 3 | ; CHECK: 1 regions require runtime support: 4 | ; CHECK: 0 region {{.*}} => {{.*}} requires 6 params 5 | 6 | target datalayout = "e-m:e-i64:64-f80:128-n8:16:32:64-S128" 7 | target triple = "x86_64-unknown-linux-gnu" 8 | 9 | define void @ddot_r_for.inc.scop0(double* %dtemp.06.reg2mem, i64, i64, double* %dy, i64, i64, double* %dx, i64) { 10 | newFuncRoot: 11 | br label %for.inc 12 | 13 | for.cond.return.loopexit1_crit_edge.exitStub: ; preds = %for.inc 14 | ret void 15 | 16 | for.inc: ; preds = %for.inc, %newFuncRoot 17 | %indvar11 = phi i64 [ 0, %newFuncRoot ], [ %indvar.next12, %for.inc ] 18 | %dtemp.06.reload = load double, double* %dtemp.06.reg2mem 19 | %5 = mul i64 %0, %indvar11 20 | %6 = add i64 %1, %5 21 | %arrayidx15 = getelementptr double, double* %dy, i64 %6 22 | %7 = mul i64 %2, %indvar11 23 | %8 = add i64 %3, %7 24 | %arrayidx = getelementptr double, double* %dx, i64 %8 25 | %9 = load double, double* %arrayidx, align 8 26 | %10 = load double, double* %arrayidx15, align 8 27 | %mul16 = fmul double %9, %10 28 | %add17 = fadd double %dtemp.06.reload, %mul16 29 | %indvar.next12 = add i64 %indvar11, 1 30 | %exitcond13 = icmp ne i64 %indvar.next12, %4 31 | store double %add17, double* %dtemp.06.reg2mem 32 | br i1 %exitcond13, label %for.inc, label %for.cond.return.loopexit1_crit_edge.exitStub 33 | } 34 | -------------------------------------------------------------------------------- /test/JitScops/linpack_ddot_ur_for.cond23.preheader.scop0.ll: -------------------------------------------------------------------------------- 1 | ; RUN: opt -S -load LLVMPolly.so -load LLVMPolyJIT.so -polli-process-unprofitable -polly-use-runtime-alias-checks=false -polli-detect-scops -polli -analyze < %s 2>&1 | FileCheck %s 2 | 3 | ; CHECK: 1 regions require runtime support: 4 | ; CHECK: 0 region for.cond23.preheader => for.end34.exitStub requires 3 params 5 | 6 | target datalayout = "e-m:e-i64:64-f80:128-n8:16:32:64-S128" 7 | target triple = "x86_64-unknown-linux-gnu" 8 | 9 | define void @ddot_ur_for.cond23.preheader.scop0(i32 %rem, double* %dtemp.1.lcssa.reg2mem, double* %dtemp.16.reg2mem, double* %dx, double* %dy) { 10 | newFuncRoot: 11 | br label %for.cond23.preheader 12 | 13 | for.end34.exitStub: ; preds = %for.cond23.for.end34_crit_edge, %for.cond23.preheader 14 | ret void 15 | 16 | for.cond23.preheader: ; preds = %newFuncRoot 17 | %cmp245 = icmp sgt i32 %rem, 0 18 | store double 0.000000e+00, double* %dtemp.1.lcssa.reg2mem 19 | br i1 %cmp245, label %for.inc32.lr.ph, label %for.end34.exitStub 20 | 21 | for.inc32.lr.ph: ; preds = %for.cond23.preheader 22 | store double 0.000000e+00, double* %dtemp.16.reg2mem 23 | br label %for.inc32 24 | 25 | for.inc32: ; preds = %for.inc32, %for.inc32.lr.ph 26 | %indvar15 = phi i64 [ 0, %for.inc32.lr.ph ], [ %indvar.next16, %for.inc32 ] 27 | %.moved.to.for.inc32 = zext i32 %rem to i64 28 | %dtemp.16.reload = load double, double* %dtemp.16.reg2mem 29 | %arrayidx27 = getelementptr double, double* %dx, i64 %indvar15 30 | %arrayidx29 = getelementptr double, double* %dy, i64 %indvar15 31 | %0 = load double, double* %arrayidx27, align 8 32 | %1 = load double, double* %arrayidx29, align 8 33 | %mul30 = fmul double %0, %1 34 | %add31 = fadd double %dtemp.16.reload, %mul30 35 | %indvar.next16 = add i64 %indvar15, 1 36 | %exitcond = icmp ne i64 %indvar.next16, %.moved.to.for.inc32 37 | store double %add31, double* %dtemp.16.reg2mem 38 | br i1 %exitcond, label %for.inc32, label %for.cond23.for.end34_crit_edge 39 | 40 | for.cond23.for.end34_crit_edge: ; preds = %for.inc32 41 | %2 = load double, double* %dtemp.16.reg2mem 42 | store double %2, double* %dtemp.1.lcssa.reg2mem 43 | br label %for.end34.exitStub 44 | } 45 | -------------------------------------------------------------------------------- /test/JitScops/linpack_ddot_ur_for.inc.scop1.ll: -------------------------------------------------------------------------------- 1 | ; RUN: opt -S -load LLVMPolly.so -load LLVMPolyJIT.so -polli-process-unprofitable -polli-detect-scops -polli -analyze < %s 2>&1 | FileCheck %s 2 | 3 | ; CHECK: 1 regions require runtime support: 4 | ; CHECK: 0 region for.inc => for.cond.return.loopexit1_crit_edge.exitStub requires 6 params 5 | 6 | target datalayout = "e-m:e-i64:64-f80:128-n8:16:32:64-S128" 7 | target triple = "x86_64-unknown-linux-gnu" 8 | 9 | define void @ddot_ur_for.inc.scop1(double* %dtemp.010.reg2mem, i64, i64, double* %dy, i64, i64, double* %dx, i64) { 10 | newFuncRoot: 11 | br label %for.inc 12 | 13 | for.cond.return.loopexit1_crit_edge.exitStub: ; preds = %for.inc 14 | ret void 15 | 16 | for.inc: ; preds = %for.inc, %newFuncRoot 17 | %indvar17 = phi i64 [ 0, %newFuncRoot ], [ %indvar.next18, %for.inc ] 18 | %dtemp.010.reload = load double, double* %dtemp.010.reg2mem 19 | %5 = mul i64 %0, %indvar17 20 | %6 = add i64 %1, %5 21 | %arrayidx15 = getelementptr double, double* %dy, i64 %6 22 | %7 = mul i64 %2, %indvar17 23 | %8 = add i64 %3, %7 24 | %arrayidx = getelementptr double, double* %dx, i64 %8 25 | %9 = load double, double* %arrayidx, align 8 26 | %10 = load double, double* %arrayidx15, align 8 27 | %mul16 = fmul double %9, %10 28 | %add17 = fadd double %dtemp.010.reload, %mul16 29 | %indvar.next18 = add i64 %indvar17, 1 30 | %exitcond19 = icmp ne i64 %indvar.next18, %4 31 | store double %add17, double* %dtemp.010.reg2mem 32 | br i1 %exitcond19, label %for.inc, label %for.cond.return.loopexit1_crit_edge.exitStub 33 | } 34 | -------------------------------------------------------------------------------- /test/JitScops/linpack_matgen_for.body36.scop0.ll: -------------------------------------------------------------------------------- 1 | ; RUN: opt -S -load LLVMPolly.so -load LLVMPolyJIT.so -polli-process-unprofitable -polly-use-runtime-alias-checks=false -polli-detect-scops -polli -analyze < %s 2>&1 | FileCheck %s 2 | 3 | ; CHECK: 1 regions require runtime support: 4 | 5 | target datalayout = "e-m:e-i64:64-f80:128-n8:16:32:64-S128" 6 | target triple = "x86_64-unknown-linux-gnu" 7 | 8 | define void @matgen_for.body36.scop0(i64, double* %b, double* %a, i64) { 9 | newFuncRoot: 10 | br label %for.body36 11 | 12 | for.inc49.exitStub: ; preds = %for.cond33.for.inc49_crit_edge 13 | ret void 14 | 15 | for.body36: ; preds = %for.body36, %newFuncRoot 16 | %indvar = phi i64 [ 0, %newFuncRoot ], [ %indvar.next, %for.body36 ] 17 | %2 = add i64 %0, %indvar 18 | %add40 = trunc i64 %2 to i32 19 | %arrayidx45 = getelementptr double, double* %b, i64 %indvar 20 | %3 = load double, double* %arrayidx45, align 8 21 | %idxprom41 = sext i32 %add40 to i64 22 | %arrayidx42 = getelementptr inbounds double, double* %a, i64 %idxprom41 23 | %4 = load double, double* %arrayidx42, align 8 24 | %add43 = fadd double %3, %4 25 | store double %add43, double* %arrayidx45, align 8 26 | %indvar.next = add i64 %indvar, 1 27 | %exitcond = icmp ne i64 %indvar.next, %1 28 | br i1 %exitcond, label %for.body36, label %for.cond33.for.inc49_crit_edge 29 | 30 | for.cond33.for.inc49_crit_edge: ; preds = %for.body36 31 | br label %for.inc49.exitStub 32 | } 33 | -------------------------------------------------------------------------------- /test/Run/1-param.c: -------------------------------------------------------------------------------- 1 | // RUN: %clang -rdynamic -O2 -Xclang -load -Xclang LLVMPolly.so -Xclang -load -Xclang LLVMPolyJIT.so -mllvm -polli-process-unprofitable -mllvm -polli %s -o %t %pjit 2 | // RUN: env BB_USE_DATABASE=0 %t 2>&1 | FileCheck %s 3 | #include 4 | 5 | static int A[10]; 6 | 7 | void test(int n) { 8 | #pragma nounroll 9 | for (int i = 0; i < 5; i++) { 10 | A[i*n] = A[i] + n; 11 | } 12 | } 13 | 14 | void printA() { 15 | for (int i = 0; i < 10; i++) { 16 | printf("%d ", A[i]); 17 | } 18 | printf("\n"); 19 | } 20 | 21 | int main(int argc, char **argv) { 22 | test(1); 23 | printA(); 24 | test(2); 25 | printA(); 26 | } 27 | // CHECK: 1 1 1 1 1 0 0 0 0 0 28 | // CHECK: 3 1 3 1 5 0 3 0 7 0 29 | -------------------------------------------------------------------------------- /test/Run/1-struct-param.c: -------------------------------------------------------------------------------- 1 | // RUN: %clang -rdynamic -O2 -Xclang -load -Xclang LLVMPolly.so -Xclang -load -Xclang LLVMPolyJIT.so -mllvm -polli-process-unprofitable -mllvm -polli %s -mllvm -polli-analyze -o %t %pjit 2>&1 | FileCheck %s -check-prefix=STATIC 2 | // RUN: env BB_USE_DATABASE=0 %t 2>&1 | FileCheck %s 3 | #include 4 | 5 | struct { 6 | int A[10]; 7 | } StrA; 8 | 9 | void test(int n) { 10 | #pragma nounroll 11 | for (int i = 0; i < 5; i++) { 12 | StrA.A[i*n] = StrA.A[i] + n; 13 | } 14 | } 15 | 16 | void printA() { 17 | for (int i = 0; i < 10; i++) { 18 | printf("%d ", StrA.A[i]); 19 | } 20 | printf("\n"); 21 | } 22 | 23 | int main(int argc, char **argv) { 24 | test(1); 25 | printA(); 26 | test(2); 27 | printA(); 28 | } 29 | 30 | // STATIC: 1 regions require runtime support: 31 | // STATIC: 0 region {{.*}} => {{.*}} requires 1 params 32 | // STATIC: 0 - {{.*}} 33 | 34 | // CHECK: 1 1 1 1 1 0 0 0 0 0 35 | // CHECK: 3 1 3 1 5 0 3 0 7 0 36 | -------------------------------------------------------------------------------- /test/Run/2-struct-param.c: -------------------------------------------------------------------------------- 1 | // RUN: %clang -rdynamic -O2 -Xclang -load -Xclang LLVMPolly.so -Xclang -load -Xclang LLVMPolyJIT.so -mllvm -polli-process-unprofitable -mllvm -polli %s -mllvm -polli-analyze -o %t %pjit 2>&1 | FileCheck %s -check-prefix=STATIC 2 | // RUN: env BB_USE_DATABASE=0 %t 2>&1 | FileCheck %s 3 | #include 4 | 5 | typedef struct { 6 | int bar; 7 | int A[10]; 8 | } SA; 9 | 10 | SA sA; 11 | 12 | typedef struct { 13 | int foo; 14 | int B[10]; 15 | } SB; 16 | 17 | SB sB; 18 | 19 | void test(int n) { 20 | #pragma nounroll 21 | for (int i = 0; i < 5; i++) { 22 | sA.A[i*n] = sA.A[i] + n; 23 | sB.B[i*n] = sB.B[i] + n; 24 | } 25 | } 26 | 27 | void print() { 28 | printf("A: "); 29 | for (int i = 0; i < 10; i++) { 30 | printf("%d ", sA.A[i]); 31 | } 32 | 33 | printf("\n"); 34 | 35 | printf("B: "); 36 | for (int i = 0; i < 10; i++) { 37 | printf("%d ", sB.B[i]); 38 | } 39 | 40 | printf("\n"); 41 | } 42 | 43 | int main(int argc, char **argv) { 44 | test(1); 45 | print(); 46 | test(2); 47 | print(); 48 | } 49 | 50 | // STATIC: 1 regions require runtime support: 51 | // STATIC: 0 region {{.*}} => {{.*}} requires 2 params 52 | // STATIC: 0 - {{.*}} 53 | 54 | // CHECK: A: 1 1 1 1 1 0 0 0 0 0 55 | // CHECK: B: 1 1 1 1 1 0 0 0 0 0 56 | // CHECK: A: 3 1 3 1 5 0 3 0 7 0 57 | // CHECK: B: 3 1 3 1 5 0 3 0 7 0 58 | -------------------------------------------------------------------------------- /test/Run/ptr-param.c: -------------------------------------------------------------------------------- 1 | // RUN: %clang -rdynamic -O2 -Xclang -load -Xclang LLVMPolly.so -Xclang -load -Xclang LLVMPolyJIT.so -mllvm -polli-process-unprofitable -mllvm -polli %s -mllvm -polli-analyze -o %t %pjit 2>&1 | FileCheck %s -check-prefix=STATIC 2 | // RUN: env BB_USE_DATABASE=0 %t 2>&1 | FileCheck %s 3 | #include 4 | 5 | void test(int n, int *A) { 6 | #pragma nounroll 7 | for (int i = 0; i < 5; i++) { 8 | A[i*n] = A[i] + n; 9 | } 10 | } 11 | 12 | void print(int *A) { 13 | printf("A: "); 14 | for (int i = 0; i < 10; i++) { 15 | printf("%d ", A[i]); 16 | } 17 | 18 | printf("\n"); 19 | } 20 | 21 | int A[10]; 22 | int main(int argc, char **argv) { 23 | test(1, A); 24 | print(A); 25 | test(2, A); 26 | print(A); 27 | } 28 | 29 | // STATIC: 1 regions require runtime support: 30 | // STATIC: 0 region {{.*}} => {{.*}} requires 1 params 31 | // STATIC: 0 - {{.*}} 32 | 33 | // CHECK: A: 1 1 1 1 1 0 0 0 0 0 34 | // CHECK: A: 3 1 3 1 5 0 3 0 7 0 35 | -------------------------------------------------------------------------------- /test/Unit/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | add_custom_target(PolliUnitTests) 2 | set_target_properties(PolliUnitTests PROPERTIES FOLDER "Tests") 3 | set(CMAKE_INSTALL_RPATH "\$ORIGIN/../../../../../../lib${LLVM_LIBDIR_SUFFIX}") 4 | 5 | set(LLVM_LINK_COMPONENTS 6 | Core 7 | Support 8 | ) 9 | 10 | function(add_polli_unittest test_dirname) 11 | add_unittest(PolliUnitTests ${test_dirname} ${ARGN}) 12 | endfunction() 13 | 14 | add_polli_unittest(PolyJIT_SchemaTest 15 | Schema.cpp 16 | ) 17 | target_link_libraries(PolyJIT_SchemaTest 18 | PolyJIT_Persist 19 | ) 20 | -------------------------------------------------------------------------------- /test/Unit/Schema.cpp: -------------------------------------------------------------------------------- 1 | #include "polli/Schema.h" 2 | #include "llvm/IR/LLVMContext.h" 3 | #include "llvm/IR/Module.h" 4 | 5 | #include 6 | 7 | using namespace polli::db; 8 | using namespace llvm; 9 | 10 | TEST(RegressionTest, TestConstructDestroy) { RegressionTest T; } 11 | 12 | TEST(RegressionTest, TestGetRunID) { 13 | RegressionTest T; 14 | EXPECT_EQ((uint64_t)0, T.runID()); 15 | } 16 | 17 | TEST(RegressionTest, TestGetSetRunID) { 18 | RegressionTest T; 19 | T.setRunID(1); 20 | EXPECT_EQ((uint64_t)1, T.runID()); 21 | } 22 | 23 | TEST(RegressionTest, TestGetEmptyModule) { 24 | RegressionTest T; 25 | EXPECT_EQ("", T.module()); 26 | } 27 | 28 | TEST(RegressionTest, TestSetName) { 29 | RegressionTest T; 30 | T.setName("test.module"); 31 | EXPECT_EQ(T.str(), ">"); 32 | } 33 | 34 | TEST(RegressionTest, TestFormulate) { 35 | pqxx::connection C(""); 36 | pqxx::work W(C); 37 | RegressionTest T; 38 | T.setName("test.module"); 39 | T.setModule("test.module.foo"); 40 | EXPECT_EQ(T.formulate(W), "INSERT INTO regressions (run_id, name, module) " 41 | "VALUES (0, 'test.module', 'test.module.foo');"); 42 | } 43 | -------------------------------------------------------------------------------- /test/lit.site.cfg.in: -------------------------------------------------------------------------------- 1 | import subprocess 2 | import lit.formats 3 | ## Autogenerated by LLVM/Polli configuration. 4 | # Do not edit! 5 | llvm_config = os.path.join("@LLVM_TOOLS_DIR@", "llvm-config") 6 | 7 | config.llvm_src_root = "@LLVM_SOURCE_DIR@" 8 | config.llvm_obj_root = "@LLVM_BINARY_DIR@" 9 | config.llvm_tools_dir ="@LLVM_TOOLS_DIR@" 10 | config.llvm_libs_dir = "@LLVM_LIBS_DIR@" 11 | config.llvm_tools_install_dir = "@LLVM_TOOLS_INSTALL_DIR@" 12 | config.llvm_binary_dir = "@LLVM_BINARY_DIR@" 13 | config.llvm_install_prefix = "@LLVM_INSTALL_PREFIX@" 14 | config.polli_obj_root = "@POLLI_OBJ_ROOT@" 15 | config.polli_lib_dir = "@POLLI_LIB_DIR@" 16 | config.target_triple = "@TARGET_TRIPLE@" 17 | 18 | ## Check the current platform with regex 19 | import re 20 | EAT_ERR_ON_X86 = ' ' 21 | if (re.match(r'^x86_64*', '@TARGET_TRIPLE@') == None) : 22 | EAT_ERR_ON_X86 = '|| echo \"error is eaten\"' 23 | 24 | # Let the main config do the real work. 25 | lit_config.load_config(config, "@POLLI_SOURCE_DIR@/test/lit.cfg") 26 | -------------------------------------------------------------------------------- /test/pprof/2mm/main_for.body.15.i.pjit.scop.ll: -------------------------------------------------------------------------------- 1 | ; RUN: opt -load LLVMPolly.so -load LLVMPolyJIT.so -O3 -polli -polli-no-recompilation -polli-analyze -disable-output -stats < %s 2>&1 | FileCheck %s 2 | 3 | ; CHECK: 1 regions require runtime support: 4 | 5 | ; ModuleID = '2mm.dir/2mm.c.main_for.body.15.i.pjit.scop.prototype' 6 | target datalayout = "e-m:e-i64:64-f80:128-n8:16:32:64-S128" 7 | target triple = "x86_64-unknown-linux-gnu" 8 | 9 | ; Function Attrs: nounwind 10 | define weak void @main_for.body.15.i.pjit.scop(double* %arrayidx.i.172, double* %arrayidx23.i, double*) { 11 | newFuncRoot: 12 | br label %for.body.15.i 13 | 14 | for.inc.38.i.176.exitStub: ; preds = %for.inc.35.i 15 | ret void 16 | 17 | for.body.15.i: ; preds = %for.inc.35.i, %newFuncRoot 18 | %indvars.iv16.i = phi i64 [ 0, %newFuncRoot ], [ %indvars.iv.next17.i, %for.inc.35.i ] 19 | %arrayidx17.i = getelementptr inbounds double, double* %arrayidx.i.172, i64 %indvars.iv16.i 20 | store double 0.000000e+00, double* %arrayidx17.i, align 8, !tbaa !0 21 | br label %for.body.20.i 22 | 23 | for.body.20.i: ; preds = %for.body.20.i, %for.body.15.i 24 | %indvars.iv13.i = phi i64 [ 0, %for.body.15.i ], [ %indvars.iv.next14.i, %for.body.20.i ] 25 | %arrayidx24.i = getelementptr inbounds double, double* %arrayidx23.i, i64 %indvars.iv13.i 26 | %1 = load double, double* %arrayidx24.i, align 8, !tbaa !0 27 | %mul.i = fmul double %1, 1.500000e+00 28 | %2 = mul nuw nsw i64 %indvars.iv13.i, 900 29 | %arrayidx27.i = getelementptr inbounds double, double* %0, i64 %2 30 | %arrayidx28.i = getelementptr inbounds double, double* %arrayidx27.i, i64 %indvars.iv16.i 31 | %3 = load double, double* %arrayidx28.i, align 8, !tbaa !0 32 | %mul29.i = fmul double %mul.i, %3 33 | %4 = load double, double* %arrayidx17.i, align 8, !tbaa !0 34 | %add34.i = fadd double %4, %mul29.i 35 | store double %add34.i, double* %arrayidx17.i, align 8, !tbaa !0 36 | %indvars.iv.next14.i = add nuw nsw i64 %indvars.iv13.i, 1 37 | %exitcond15.i = icmp eq i64 %indvars.iv.next14.i, 1100 38 | br i1 %exitcond15.i, label %for.inc.35.i, label %for.body.20.i 39 | 40 | for.inc.35.i: ; preds = %for.body.20.i 41 | %indvars.iv.next17.i = add nuw nsw i64 %indvars.iv16.i, 1 42 | %exitcond18.i.173 = icmp eq i64 %indvars.iv.next17.i, 900 43 | br i1 %exitcond18.i.173, label %for.inc.38.i.176.exitStub, label %for.body.15.i 44 | } 45 | 46 | attributes #0 = { nounwind "polyjit-global-count"="0" "polyjit-jit-candidate" } 47 | 48 | !0 = !{!1, !1, i64 0} 49 | !1 = !{!"double", !2, i64 0} 50 | !2 = !{!"omnipotent char", !3, i64 0} 51 | !3 = !{!"Simple C/C++ TBAA"} 52 | -------------------------------------------------------------------------------- /test/pprof/3mm/main_for.body.16.i.pjit.scop.ll: -------------------------------------------------------------------------------- 1 | 2 | ; RUN: opt -load LLVMPolly.so -load LLVMPolyJIT.so -O3 -polli -polli-no-recompilation -polli-analyze -disable-output -stats < %s 2>&1 | FileCheck %s 3 | 4 | ; CHECK: 1 regions require runtime support: 5 | 6 | ; ModuleID = '3mm.dir/3mm.c.main_for.body.16.i.pjit.scop.prototype' 7 | target datalayout = "e-m:e-i64:64-f80:128-n8:16:32:64-S128" 8 | target triple = "x86_64-unknown-linux-gnu" 9 | 10 | ; Function Attrs: nounwind 11 | define weak void @main_for.body.16.i.pjit.scop(double* %arrayidx.i.200, double* %arrayidx24.i, double*) { 12 | newFuncRoot: 13 | br label %for.body.16.i 14 | 15 | for.inc.38.i.exitStub: ; preds = %for.inc.35.i 16 | ret void 17 | 18 | for.body.16.i: ; preds = %for.inc.35.i, %newFuncRoot 19 | %indvars.iv28.i = phi i64 [ 0, %newFuncRoot ], [ %indvars.iv.next29.i, %for.inc.35.i ] 20 | %arrayidx18.i = getelementptr inbounds double, double* %arrayidx.i.200, i64 %indvars.iv28.i 21 | store double 0.000000e+00, double* %arrayidx18.i, align 8, !tbaa !0 22 | br label %for.body.21.i 23 | 24 | for.body.21.i: ; preds = %for.body.21.i, %for.body.16.i 25 | %indvars.iv25.i = phi i64 [ 0, %for.body.16.i ], [ %indvars.iv.next26.i, %for.body.21.i ] 26 | %arrayidx25.i = getelementptr inbounds double, double* %arrayidx24.i, i64 %indvars.iv25.i 27 | %1 = load double, double* %arrayidx25.i, align 8, !tbaa !0 28 | %2 = mul nuw nsw i64 %indvars.iv25.i, 900 29 | %arrayidx28.i = getelementptr inbounds double, double* %0, i64 %2 30 | %arrayidx29.i = getelementptr inbounds double, double* %arrayidx28.i, i64 %indvars.iv28.i 31 | %3 = load double, double* %arrayidx29.i, align 8, !tbaa !0 32 | %mul.i = fmul double %1, %3 33 | %4 = load double, double* %arrayidx18.i, align 8, !tbaa !0 34 | %add34.i = fadd double %4, %mul.i 35 | store double %add34.i, double* %arrayidx18.i, align 8, !tbaa !0 36 | %indvars.iv.next26.i = add nuw nsw i64 %indvars.iv25.i, 1 37 | %exitcond27.i = icmp eq i64 %indvars.iv.next26.i, 1000 38 | br i1 %exitcond27.i, label %for.inc.35.i, label %for.body.21.i 39 | 40 | for.inc.35.i: ; preds = %for.body.21.i 41 | %indvars.iv.next29.i = add nuw nsw i64 %indvars.iv28.i, 1 42 | %exitcond30.i = icmp eq i64 %indvars.iv.next29.i, 900 43 | br i1 %exitcond30.i, label %for.inc.38.i.exitStub, label %for.body.16.i 44 | } 45 | 46 | attributes #0 = { nounwind "polyjit-global-count"="0" "polyjit-jit-candidate" } 47 | 48 | !0 = !{!1, !1, i64 0} 49 | !1 = !{!"double", !2, i64 0} 50 | !2 = !{!"omnipotent char", !3, i64 0} 51 | !3 = !{!"Simple C/C++ TBAA"} 52 | -------------------------------------------------------------------------------- /test/pprof/7z/_ZNK8NArchive3N7z7CFolder14CheckStructureEj_for.cond.130.preheader.pjit.scop.ll: -------------------------------------------------------------------------------- 1 | 2 | ; RUN: opt -load LLVMPolly.so -load LLVMPolyJIT.so -O3 -polli -polli-no-recompilation -polli-analyze -disable-output -stats < %s 2>&1 | FileCheck %s 3 | 4 | ; CHECK: 1 regions require runtime support: 5 | 6 | ; ModuleID = '../../../../CPP/7zip/Archive/7z/7zIn.cpp._ZNK8NArchive3N7z7CFolder14CheckStructureEj_for.cond.130.preheader.pjit.scop.prototype' 7 | target datalayout = "e-m:e-i64:64-f80:128-n8:16:32:64-S128" 8 | target triple = "x86_64-unknown-linux-gnu" 9 | 10 | define weak void @_ZNK8NArchive3N7z7CFolder14CheckStructureEj_for.cond.130.preheader.pjit.scop([32 x i32]* %mask) { 11 | newFuncRoot: 12 | br label %for.cond.130.preheader 13 | 14 | for.body.153.exitStub: ; preds = %for.body.153.preheader 15 | ret void 16 | 17 | for.cond.130.preheader: ; preds = %for.cond.cleanup, %newFuncRoot 18 | %indvars.iv428 = phi i64 [ %indvars.iv.next429, %for.cond.cleanup ], [ 0, %newFuncRoot ] 19 | %arrayidx135 = getelementptr inbounds [32 x i32], [32 x i32]* %mask, i64 0, i64 %indvars.iv428 20 | br label %for.body.132 21 | 22 | for.body.132: ; preds = %for.inc.144, %for.cond.130.preheader 23 | %indvars.iv = phi i64 [ 0, %for.cond.130.preheader ], [ %indvars.iv.next, %for.inc.144 ] 24 | %0 = trunc i64 %indvars.iv to i32 25 | %shl133 = shl i32 1, %0 26 | %1 = load i32, i32* %arrayidx135, align 4, !tbaa !0 27 | %and = and i32 %shl133, %1 28 | %cmp136 = icmp eq i32 %and, 0 29 | br i1 %cmp136, label %for.inc.144, label %if.then.137 30 | 31 | for.inc.144: ; preds = %if.then.137, %for.body.132 32 | %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1 33 | %exitcond = icmp eq i64 %indvars.iv.next, 32 34 | br i1 %exitcond, label %for.cond.cleanup, label %for.body.132 35 | 36 | for.cond.cleanup: ; preds = %for.inc.144 37 | %indvars.iv.next429 = add nuw nsw i64 %indvars.iv428, 1 38 | %exitcond430 = icmp eq i64 %indvars.iv.next429, 32 39 | br i1 %exitcond430, label %for.body.153.preheader, label %for.cond.130.preheader 40 | 41 | for.body.153.preheader: ; preds = %for.cond.cleanup 42 | br label %for.body.153.exitStub 43 | 44 | if.then.137: ; preds = %for.body.132 45 | %arrayidx139 = getelementptr inbounds [32 x i32], [32 x i32]* %mask, i64 0, i64 %indvars.iv 46 | %2 = load i32, i32* %arrayidx139, align 4, !tbaa !0 47 | %or142 = or i32 %2, %1 48 | store i32 %or142, i32* %arrayidx135, align 4, !tbaa !0 49 | br label %for.inc.144 50 | } 51 | 52 | attributes #0 = { "polyjit-global-count"="0" "polyjit-jit-candidate" } 53 | 54 | !0 = !{!1, !1, i64 0} 55 | !1 = !{!"int", !2, i64 0} 56 | !2 = !{!"omnipotent char", !3, i64 0} 57 | !3 = !{!"Simple C/C++ TBAA"} 58 | -------------------------------------------------------------------------------- /test/pprof/MultiSourceBenchmarks/MSalignmm_rec_for.body.31.i.pjit.scop.ll: -------------------------------------------------------------------------------- 1 | 2 | ; RUN: opt -load LLVMPolly.so -load LLVMPolyJIT.so -O3 -polli -polli-no-recompilation -polli-analyze -disable-output -stats < %s 2>&1 | FileCheck %s 3 | 4 | ; CHECK: 1 regions require runtime support: 5 | 6 | ; ModuleID = '/local/hdd/pjtest/pj-collect/MultiSourceBenchmarks/test-suite/MultiSource/Benchmarks/mafft/MSalignmm.c.MSalignmm_rec_for.body.31.i.pjit.scop.prototype' 7 | target datalayout = "e-m:e-i64:64-f80:128-n8:16:32:64-S128" 8 | target triple = "x86_64-unknown-linux-gnu" 9 | 10 | ; Function Attrs: nounwind 11 | define weak void @MSalignmm_rec_for.body.31.i.pjit.scop([26 x float]* %scarr.i.i, float*, [26 x [26 x i32]]* nonnull %n_dis) { 12 | newFuncRoot: 13 | br label %for.body.31.i 14 | 15 | while.cond.preheader.i.exitStub: ; preds = %for.inc.50.i 16 | ret void 17 | 18 | for.body.31.i: ; preds = %for.inc.50.i, %newFuncRoot 19 | %indvars.iv131.i = phi i64 [ 0, %newFuncRoot ], [ %indvars.iv.next132.i, %for.inc.50.i ] 20 | %arrayidx33.i = getelementptr inbounds [26 x float], [26 x float]* %scarr.i.i, i64 0, i64 %indvars.iv131.i 21 | store float 0.000000e+00, float* %arrayidx33.i, align 4, !tbaa !0 22 | br label %for.body.36.i 23 | 24 | for.body.36.i: ; preds = %for.body.36.i, %for.body.31.i 25 | %indvars.iv129.i = phi i64 [ 0, %for.body.31.i ], [ %indvars.iv.next130.i, %for.body.36.i ] 26 | %1 = phi float [ 0.000000e+00, %for.body.31.i ], [ %add.i.3, %for.body.36.i ] 27 | %arrayidx40.i = getelementptr inbounds [26 x [26 x i32]], [26 x [26 x i32]]* %n_dis, i64 0, i64 %indvars.iv129.i, i64 %indvars.iv131.i 28 | %2 = load i32, i32* %arrayidx40.i, align 4, !tbaa !4 29 | %conv.i = sitofp i32 %2 to float 30 | %arrayidx44.i = getelementptr inbounds float, float* %0, i64 %indvars.iv129.i 31 | %3 = load float, float* %arrayidx44.i, align 4, !tbaa !0 32 | %mul.i = fmul float %conv.i, %3 33 | %add.i.3 = fadd float %1, %mul.i 34 | %indvars.iv.next130.i = add nuw nsw i64 %indvars.iv129.i, 1 35 | %exitcond.i.4 = icmp eq i64 %indvars.iv.next130.i, 26 36 | br i1 %exitcond.i.4, label %for.inc.50.i, label %for.body.36.i 37 | 38 | for.inc.50.i: ; preds = %for.body.36.i 39 | %add.i.3.lcssa = phi float [ %add.i.3, %for.body.36.i ] 40 | store float %add.i.3.lcssa, float* %arrayidx33.i, align 4, !tbaa !0 41 | %indvars.iv.next132.i = add nuw nsw i64 %indvars.iv131.i, 1 42 | %exitcond133.i = icmp eq i64 %indvars.iv.next132.i, 26 43 | br i1 %exitcond133.i, label %while.cond.preheader.i.exitStub, label %for.body.31.i 44 | } 45 | 46 | attributes #0 = { nounwind "polyjit-global-count"="1" "polyjit-jit-candidate" } 47 | 48 | !0 = !{!1, !1, i64 0} 49 | !1 = !{!"float", !2, i64 0} 50 | !2 = !{!"omnipotent char", !3, i64 0} 51 | !3 = !{!"Simple C/C++ TBAA"} 52 | !4 = !{!5, !5, i64 0} 53 | !5 = !{!"int", !2, i64 0} 54 | -------------------------------------------------------------------------------- /test/pprof/MultiSourceBenchmarks/_ZNK8NArchive3N7z7CFolder14CheckStructureEv_for.cond.123.preheader.pjit.scop.ll: -------------------------------------------------------------------------------- 1 | 2 | ; RUN: opt -load LLVMPolly.so -load LLVMPolyJIT.so -O3 -polli -polli-no-recompilation -polli-analyze -disable-output -stats < %s 2>&1 | FileCheck %s 3 | 4 | ; CHECK: 1 regions require runtime support: 5 | 6 | ; ModuleID = '/local/hdd/pjtest/pj-collect/MultiSourceBenchmarks/test-suite/MultiSource/Benchmarks/7zip/CPP/7zip/Archive/7z/7zIn.cpp._ZNK8NArchive3N7z7CFolder14CheckStructureEv_for.cond.123.preheader.pjit.scop.prototype' 7 | target datalayout = "e-m:e-i64:64-f80:128-n8:16:32:64-S128" 8 | target triple = "x86_64-unknown-linux-gnu" 9 | 10 | define weak void @_ZNK8NArchive3N7z7CFolder14CheckStructureEv_for.cond.123.preheader.pjit.scop([32 x i32]* %mask) { 11 | newFuncRoot: 12 | br label %for.cond.123.preheader 13 | 14 | for.body.146.exitStub: ; preds = %for.body.146.preheader 15 | ret void 16 | 17 | for.cond.123.preheader: ; preds = %for.cond.cleanup, %newFuncRoot 18 | %indvars.iv323 = phi i64 [ 0, %newFuncRoot ], [ %indvars.iv.next324, %for.cond.cleanup ] 19 | %arrayidx128 = getelementptr inbounds [32 x i32], [32 x i32]* %mask, i64 0, i64 %indvars.iv323 20 | br label %for.body.125 21 | 22 | for.body.125: ; preds = %for.inc.137, %for.cond.123.preheader 23 | %indvars.iv321 = phi i64 [ 0, %for.cond.123.preheader ], [ %indvars.iv.next322, %for.inc.137 ] 24 | %0 = trunc i64 %indvars.iv321 to i32 25 | %shl126 = shl i32 1, %0 26 | %1 = load i32, i32* %arrayidx128, align 4, !tbaa !0 27 | %and = and i32 %shl126, %1 28 | %cmp129 = icmp eq i32 %and, 0 29 | br i1 %cmp129, label %for.inc.137, label %if.then.130 30 | 31 | for.inc.137: ; preds = %if.then.130, %for.body.125 32 | %indvars.iv.next322 = add nuw nsw i64 %indvars.iv321, 1 33 | %exitcond = icmp eq i64 %indvars.iv.next322, 32 34 | br i1 %exitcond, label %for.cond.cleanup, label %for.body.125 35 | 36 | for.cond.cleanup: ; preds = %for.inc.137 37 | %indvars.iv.next324 = add nuw nsw i64 %indvars.iv323, 1 38 | %exitcond325 = icmp eq i64 %indvars.iv.next324, 32 39 | br i1 %exitcond325, label %for.body.146.preheader, label %for.cond.123.preheader 40 | 41 | for.body.146.preheader: ; preds = %for.cond.cleanup 42 | br label %for.body.146.exitStub 43 | 44 | if.then.130: ; preds = %for.body.125 45 | %arrayidx132 = getelementptr inbounds [32 x i32], [32 x i32]* %mask, i64 0, i64 %indvars.iv321 46 | %2 = load i32, i32* %arrayidx132, align 4, !tbaa !0 47 | %or135 = or i32 %2, %1 48 | store i32 %or135, i32* %arrayidx128, align 4, !tbaa !0 49 | br label %for.inc.137 50 | } 51 | 52 | attributes #0 = { "polyjit-global-count"="0" "polyjit-jit-candidate" } 53 | 54 | !0 = !{!1, !1, i64 0} 55 | !1 = !{!"int", !2, i64 0} 56 | !2 = !{!"omnipotent char", !3, i64 0} 57 | !3 = !{!"Simple C/C++ TBAA"} 58 | -------------------------------------------------------------------------------- /test/pprof/MultiSourceBenchmarks/hypre_StructScale_for.body.184.lr.ph.us.us.pjit.scop.ll: -------------------------------------------------------------------------------- 1 | 2 | ; RUN: opt -load LLVMPolly.so -load LLVMPolyJIT.so -O3 -polli -polli-no-recompilation -polli-analyze -disable-output -stats < %s 2>&1 | FileCheck %s 3 | 4 | ; CHECK: 1 regions require runtime support: 5 | 6 | ; ModuleID = '/local/hdd/pjtest/pj-collect/MultiSourceBenchmarks/test-suite/MultiSource/Benchmarks/ASCI_Purple/SMG2000/struct_scale.c.hypre_StructScale_for.body.184.lr.ph.us.us.pjit.scop.prototype' 7 | target datalayout = "e-m:e-i64:64-f80:128-n8:16:32:64-S128" 8 | target triple = "x86_64-unknown-linux-gnu" 9 | 10 | ; Function Attrs: nounwind 11 | define weak void @hypre_StructScale_for.body.184.lr.ph.us.us.pjit.scop(i32 %yi.0344.us, double* %add.ptr, double %alpha, i32, i32 %cond51, i32, i32* %add191.us.us.out) { 12 | newFuncRoot: 13 | br label %for.body.184.lr.ph.us.us 14 | 15 | for.cond.179.for.end.194_crit_edge.us.loopexit.exitStub: ; preds = %for.cond.182.for.end_crit_edge.us.us 16 | store i32 %add191.us.us, i32* %add191.us.us.out 17 | ret void 18 | 19 | for.body.184.lr.ph.us.us: ; preds = %for.cond.182.for.end_crit_edge.us.us, %newFuncRoot 20 | %yi.1340.us.us = phi i32 [ %add191.us.us, %for.cond.182.for.end_crit_edge.us.us ], [ %yi.0344.us, %newFuncRoot ] 21 | %loopj.1339.us.us = phi i32 [ %inc193.us.us, %for.cond.182.for.end_crit_edge.us.us ], [ 0, %newFuncRoot ] 22 | %2 = sext i32 %yi.1340.us.us to i64 23 | br label %for.body.184.us.us 24 | 25 | for.body.184.us.us: ; preds = %for.body.184.us.us, %for.body.184.lr.ph.us.us 26 | %indvars.iv = phi i64 [ %indvars.iv.next, %for.body.184.us.us ], [ %2, %for.body.184.lr.ph.us.us ] 27 | %loopi.1336.us.us = phi i32 [ %inc.us.us, %for.body.184.us.us ], [ 0, %for.body.184.lr.ph.us.us ] 28 | %arrayidx186.us.us = getelementptr inbounds double, double* %add.ptr, i64 %indvars.iv 29 | %3 = load double, double* %arrayidx186.us.us, align 8, !tbaa !0 30 | %mul187.us.us = fmul double %3, %alpha 31 | store double %mul187.us.us, double* %arrayidx186.us.us, align 8, !tbaa !0 32 | %inc.us.us = add nuw nsw i32 %loopi.1336.us.us, 1 33 | %indvars.iv.next = add nsw i64 %indvars.iv, 1 34 | %exitcond435 = icmp eq i32 %inc.us.us, %0 35 | br i1 %exitcond435, label %for.cond.182.for.end_crit_edge.us.us, label %for.body.184.us.us 36 | 37 | for.cond.182.for.end_crit_edge.us.us: ; preds = %for.body.184.us.us 38 | %add191.us.us = add i32 %yi.1340.us.us, %cond51 39 | %inc193.us.us = add nuw nsw i32 %loopj.1339.us.us, 1 40 | %exitcond437 = icmp eq i32 %inc193.us.us, %1 41 | br i1 %exitcond437, label %for.cond.179.for.end.194_crit_edge.us.loopexit.exitStub, label %for.body.184.lr.ph.us.us 42 | } 43 | 44 | attributes #0 = { nounwind "polyjit-global-count"="0" "polyjit-jit-candidate" } 45 | 46 | !0 = !{!1, !1, i64 0} 47 | !1 = !{!"double", !2, i64 0} 48 | !2 = !{!"omnipotent char", !3, i64 0} 49 | !3 = !{!"Simple C/C++ TBAA"} 50 | -------------------------------------------------------------------------------- /test/pprof/MultiSourceBenchmarks/match_calc_for.body.31.pjit.scop.ll: -------------------------------------------------------------------------------- 1 | 2 | ; RUN: opt -load LLVMPolly.so -load LLVMPolyJIT.so -O3 -polli -polli-no-recompilation -polli-analyze -disable-output -stats < %s 2>&1 | FileCheck %s 3 | 4 | ; CHECK: 1 regions require runtime support: 5 | 6 | ; ModuleID = '/local/hdd/pjtest/pj-collect/MultiSourceBenchmarks/test-suite/MultiSource/Benchmarks/mafft/Lalignmm.c.match_calc_for.body.31.pjit.scop.prototype' 7 | target datalayout = "e-m:e-i64:64-f80:128-n8:16:32:64-S128" 8 | target triple = "x86_64-unknown-linux-gnu" 9 | 10 | ; Function Attrs: nounwind 11 | define weak void @match_calc_for.body.31.pjit.scop([26 x float]* %scarr, i32, float*, [26 x [26 x i32]]* nonnull %n_dis) { 12 | newFuncRoot: 13 | br label %for.body.31 14 | 15 | while.cond.preheader.exitStub: ; preds = %for.inc.50 16 | ret void 17 | 18 | for.body.31: ; preds = %for.inc.50, %newFuncRoot 19 | %indvars.iv131 = phi i64 [ 0, %newFuncRoot ], [ %indvars.iv.next132, %for.inc.50 ] 20 | %arrayidx33 = getelementptr inbounds [26 x float], [26 x float]* %scarr, i64 0, i64 %indvars.iv131 21 | store float 0.000000e+00, float* %arrayidx33, align 4, !tbaa !0 22 | br label %for.body.36 23 | 24 | for.body.36: ; preds = %for.body.36, %for.body.31 25 | %indvars.iv129 = phi i64 [ 0, %for.body.31 ], [ %indvars.iv.next130, %for.body.36 ] 26 | %2 = phi float [ 0.000000e+00, %for.body.31 ], [ %add, %for.body.36 ] 27 | %arrayidx40 = getelementptr inbounds [26 x [26 x i32]], [26 x [26 x i32]]* %n_dis, i64 0, i64 %indvars.iv129, i64 %indvars.iv131 28 | %3 = load i32, i32* %arrayidx40, align 4, !tbaa !4 29 | %sub = sub nsw i32 %3, %0 30 | %conv = sitofp i32 %sub to float 31 | %arrayidx44 = getelementptr inbounds float, float* %1, i64 %indvars.iv129 32 | %4 = load float, float* %arrayidx44, align 4, !tbaa !0 33 | %mul = fmul float %4, %conv 34 | %add = fadd float %2, %mul 35 | %indvars.iv.next130 = add nuw nsw i64 %indvars.iv129, 1 36 | %exitcond = icmp eq i64 %indvars.iv.next130, 26 37 | br i1 %exitcond, label %for.inc.50, label %for.body.36 38 | 39 | for.inc.50: ; preds = %for.body.36 40 | %add.lcssa = phi float [ %add, %for.body.36 ] 41 | store float %add.lcssa, float* %arrayidx33, align 4, !tbaa !0 42 | %indvars.iv.next132 = add nuw nsw i64 %indvars.iv131, 1 43 | %exitcond133 = icmp eq i64 %indvars.iv.next132, 26 44 | br i1 %exitcond133, label %while.cond.preheader.exitStub, label %for.body.31 45 | } 46 | 47 | attributes #0 = { nounwind "polyjit-global-count"="1" "polyjit-jit-candidate" } 48 | 49 | !0 = !{!1, !1, i64 0} 50 | !1 = !{!"float", !2, i64 0} 51 | !2 = !{!"omnipotent char", !3, i64 0} 52 | !3 = !{!"Simple C/C++ TBAA"} 53 | !4 = !{!5, !5, i64 0} 54 | !5 = !{!"int", !2, i64 0} 55 | -------------------------------------------------------------------------------- /test/pprof/Rasdaman/_ZN14DTEDRasterBand10IReadBlockEiiPv_for.body.22.pjit.scop.ll: -------------------------------------------------------------------------------- 1 | 2 | ; RUN: opt -load LLVMPolly.so -load LLVMPolyJIT.so -O3 -polli -polli-no-recompilation -polli-analyze -disable-output -stats < %s 2>&1 | FileCheck %s 3 | 4 | ; CHECK: 1 regions require runtime support: 5 | 6 | ; ModuleID = 'dteddataset.cpp._ZN14DTEDRasterBand10IReadBlockEiiPv_for.body.22.pjit.scop.prototype' 7 | target datalayout = "e-m:e-i64:64-f80:128-n8:16:32:64-S128" 8 | target triple = "x86_64-unknown-linux-gnu" 9 | 10 | define weak void @_ZN14DTEDRasterBand10IReadBlockEiiPv_for.body.22.pjit.scop(i32 %sub25, i32, i16* %add.ptr24, i16*, i1 %cmp35.143, i64, i64, i64) { 11 | newFuncRoot: 12 | br label %for.body.22 13 | 14 | for.inc.51.loopexit.exitStub: ; preds = %for.cond.cleanup.36 15 | ret void 16 | 17 | for.body.22: ; preds = %for.cond.cleanup.36, %newFuncRoot 18 | %indvars.iv157 = phi i64 [ 0, %newFuncRoot ], [ %indvars.iv.next158, %for.cond.cleanup.36 ] 19 | %5 = trunc i64 %indvars.iv157 to i32 20 | %sub26 = sub i32 %sub25, %5 21 | %mul28 = mul nsw i32 %sub26, %0 22 | %idx.ext29 = sext i32 %mul28 to i64 23 | %add.ptr30 = getelementptr inbounds i16, i16* %add.ptr24, i64 %idx.ext29 24 | %add.ptr32 = getelementptr inbounds i16, i16* %1, i64 %indvars.iv157 25 | br i1 %cmp35.143, label %for.body.37.preheader, label %for.cond.cleanup.36 26 | 27 | for.body.37.preheader: ; preds = %for.body.22 28 | br label %for.body.37 29 | 30 | for.body.37: ; preds = %for.body.37, %for.body.37.preheader 31 | %indvars.iv154 = phi i64 [ %indvars.iv.next155, %for.body.37 ], [ 0, %for.body.37.preheader ] 32 | %6 = mul nsw i64 %indvars.iv154, %2 33 | %arrayidx = getelementptr inbounds i16, i16* %add.ptr32, i64 %6 34 | %7 = load i16, i16* %arrayidx, align 2, !tbaa !0 35 | %arrayidx40 = getelementptr inbounds i16, i16* %add.ptr30, i64 %indvars.iv154 36 | store i16 %7, i16* %arrayidx40, align 2, !tbaa !0 37 | %indvars.iv.next155 = add nuw nsw i64 %indvars.iv154, 1 38 | %cmp35 = icmp slt i64 %indvars.iv.next155, %3 39 | br i1 %cmp35, label %for.body.37, label %for.cond.cleanup.36.loopexit 40 | 41 | for.cond.cleanup.36.loopexit: ; preds = %for.body.37 42 | br label %for.cond.cleanup.36 43 | 44 | for.cond.cleanup.36: ; preds = %for.cond.cleanup.36.loopexit, %for.body.22 45 | %indvars.iv.next158 = add nuw nsw i64 %indvars.iv157, 1 46 | %cmp20 = icmp slt i64 %indvars.iv.next158, %4 47 | br i1 %cmp20, label %for.body.22, label %for.inc.51.loopexit.exitStub 48 | } 49 | 50 | attributes #0 = { "polyjit-global-count"="0" "polyjit-jit-candidate" } 51 | 52 | !0 = !{!1, !1, i64 0} 53 | !1 = !{!"short", !2, i64 0} 54 | !2 = !{!"omnipotent char", !3, i64 0} 55 | !3 = !{!"Simple C/C++ TBAA"} 56 | -------------------------------------------------------------------------------- /test/pprof/Rasdaman/_ZN14OGRWarpedLayer17ReprojectEnvelopeEP11OGREnvelopeP27OGRCoordinateTransformation_for.cond.9.preheader.pjit.scop.ll: -------------------------------------------------------------------------------- 1 | 2 | ; RUN: opt -load LLVMPolly.so -load LLVMPolyJIT.so -O3 -polli -polli-no-recompilation -polli-analyze -disable-output -stats < %s 2>&1 | FileCheck %s 3 | 4 | ; CHECK: 1 regions require runtime support: 5 | 6 | ; ModuleID = 'ogrwarpedlayer.cpp._ZN14OGRWarpedLayer17ReprojectEnvelopeEP11OGREnvelopeP27OGRCoordinateTransformation_for.cond.9.preheader.pjit.scop.prototype' 7 | target datalayout = "e-m:e-i64:64-f80:128-n8:16:32:64-S128" 8 | target triple = "x86_64-unknown-linux-gnu" 9 | 10 | define weak void @_ZN14OGRWarpedLayer17ReprojectEnvelopeEP11OGREnvelopeP27OGRCoordinateTransformation_for.cond.9.preheader.pjit.scop(double %div2, double* %MinX, double %div, double*, double* %MinY, double*) { 11 | newFuncRoot: 12 | br label %for.cond.9.preheader 13 | 14 | for.end.25.exitStub: ; preds = %for.inc.23 15 | ret void 16 | 17 | for.cond.9.preheader: ; preds = %for.inc.23, %newFuncRoot 18 | %indvars.iv207 = phi i64 [ %indvars.iv.next208, %for.inc.23 ], [ 0, %newFuncRoot ] 19 | %2 = mul nuw nsw i64 %indvars.iv207, 21 20 | %3 = trunc i64 %indvars.iv207 to i32 21 | %conv16 = sitofp i32 %3 to double 22 | %mul17 = fmul double %div2, %conv16 23 | br label %for.body.11 24 | 25 | for.body.11: ; preds = %for.body.11, %for.cond.9.preheader 26 | %indvars.iv203 = phi i64 [ 0, %for.cond.9.preheader ], [ %indvars.iv.next204, %for.body.11 ] 27 | %4 = load double, double* %MinX, align 8, !tbaa !0 28 | %5 = trunc i64 %indvars.iv203 to i32 29 | %conv = sitofp i32 %5 to double 30 | %mul = fmul double %div, %conv 31 | %add = fadd double %4, %mul 32 | %6 = add nuw nsw i64 %indvars.iv203, %2 33 | %arrayidx = getelementptr inbounds double, double* %0, i64 %6 34 | store double %add, double* %arrayidx, align 8, !tbaa !5 35 | %7 = load double, double* %MinY, align 8, !tbaa !6 36 | %add18 = fadd double %mul17, %7 37 | %arrayidx22 = getelementptr inbounds double, double* %1, i64 %6 38 | store double %add18, double* %arrayidx22, align 8, !tbaa !5 39 | %indvars.iv.next204 = add nuw nsw i64 %indvars.iv203, 1 40 | %exitcond206 = icmp eq i64 %indvars.iv.next204, 21 41 | br i1 %exitcond206, label %for.inc.23, label %for.body.11 42 | 43 | for.inc.23: ; preds = %for.body.11 44 | %indvars.iv.next208 = add nuw nsw i64 %indvars.iv207, 1 45 | %exitcond210 = icmp eq i64 %indvars.iv.next208, 21 46 | br i1 %exitcond210, label %for.end.25.exitStub, label %for.cond.9.preheader 47 | } 48 | 49 | attributes #0 = { "polyjit-global-count"="0" "polyjit-jit-candidate" } 50 | 51 | !0 = !{!1, !2, i64 0} 52 | !1 = !{!"_ZTS11OGREnvelope", !2, i64 0, !2, i64 8, !2, i64 16, !2, i64 24} 53 | !2 = !{!"double", !3, i64 0} 54 | !3 = !{!"omnipotent char", !4, i64 0} 55 | !4 = !{!"Simple C/C++ TBAA"} 56 | !5 = !{!2, !2, i64 0} 57 | !6 = !{!1, !2, i64 16} 58 | -------------------------------------------------------------------------------- /test/pprof/Rasdaman/calccoef_for.body.101.lr.ph.i.pjit.scop.ll: -------------------------------------------------------------------------------- 1 | 2 | ; RUN: opt -load LLVMPolly.so -load LLVMPolyJIT.so -O3 -polli -polli-no-recompilation -polli-analyze -disable-output -stats < %s 2>&1 | FileCheck %s 3 | 4 | ; CHECK: 1 regions require runtime support: 5 | 6 | ; ModuleID = 'gdal_crs.c.calccoef_for.body.101.lr.ph.i.pjit.scop.prototype' 7 | target datalayout = "e-m:e-i64:64-f80:128-n8:16:32:64-S128" 8 | target triple = "x86_64-unknown-linux-gnu" 9 | 10 | ; Function Attrs: nounwind 11 | define weak void @calccoef_for.body.101.lr.ph.i.pjit.scop(i32, i64, double*, i32) { 12 | newFuncRoot: 13 | br label %for.body.101.lr.ph.i 14 | 15 | for.end.123.i.loopexit.exitStub: ; preds = %for.inc.121.i 16 | ret void 17 | 18 | for.body.101.lr.ph.i: ; preds = %for.inc.121.i, %newFuncRoot 19 | %indvars.iv117 = phi i32 [ %indvars.iv.next118, %for.inc.121.i ], [ 2, %newFuncRoot ] 20 | %add105.i = add nsw i32 %indvars.iv117, -1 21 | %mul112.i = mul nsw i32 %add105.i, %0 22 | br label %for.body.101.i 23 | 24 | for.body.101.i: ; preds = %for.body.101.i, %for.body.101.lr.ph.i 25 | %indvars.iv.i.101 = phi i64 [ 1, %for.body.101.lr.ph.i ], [ %indvars.iv.next.i.102, %for.body.101.i ] 26 | %4 = add nsw i64 %indvars.iv.i.101, -1 27 | %5 = mul nsw i64 %4, %1 28 | %6 = trunc i64 %5 to i32 29 | %sub106.i = add i32 %6, %add105.i 30 | %idxprom107.i = sext i32 %sub106.i to i64 31 | %arrayidx109.i = getelementptr inbounds double, double* %2, i64 %idxprom107.i 32 | %7 = bitcast double* %arrayidx109.i to i64* 33 | %8 = load i64, i64* %7, align 8, !tbaa !0 34 | %9 = add nuw nsw i64 %indvars.iv.i.101, 4294967295 35 | %10 = trunc i64 %9 to i32 36 | %sub114.i = add i32 %10, %mul112.i 37 | %idxprom115.i = sext i32 %sub114.i to i64 38 | %arrayidx117.i = getelementptr inbounds double, double* %2, i64 %idxprom115.i 39 | %11 = bitcast double* %arrayidx117.i to i64* 40 | store i64 %8, i64* %11, align 8, !tbaa !0 41 | %indvars.iv.next.i.102 = add nuw nsw i64 %indvars.iv.i.101, 1 42 | %lftr.wideiv119 = trunc i64 %indvars.iv.next.i.102 to i32 43 | %exitcond120 = icmp eq i32 %lftr.wideiv119, %indvars.iv117 44 | br i1 %exitcond120, label %for.inc.121.i, label %for.body.101.i 45 | 46 | for.inc.121.i: ; preds = %for.body.101.i 47 | %indvars.iv.next118 = add nuw nsw i32 %indvars.iv117, 1 48 | %exitcond110 = icmp eq i32 %indvars.iv117, %3 49 | br i1 %exitcond110, label %for.end.123.i.loopexit.exitStub, label %for.body.101.lr.ph.i 50 | } 51 | 52 | attributes #0 = { nounwind "polyjit-global-count"="0" "polyjit-jit-candidate" } 53 | 54 | !0 = !{!1, !1, i64 0} 55 | !1 = !{!"double", !2, i64 0} 56 | !2 = !{!"omnipotent char", !3, i64 0} 57 | !3 = !{!"Simple C/C++ TBAA"} 58 | -------------------------------------------------------------------------------- /test/pprof/SingleSourceBenchmarks/Bubble_while.body.3.preheader.pjit.scop.ll: -------------------------------------------------------------------------------- 1 | 2 | ; RUN: opt -load LLVMPolly.so -load LLVMPolyJIT.so -O3 -polli-process-unprofitable -polli -polli-no-recompilation -polli-analyze -disable-output -stats < %s 2>&1 | FileCheck %s 3 | 4 | ; CHECK: 1 regions require runtime support: 5 | 6 | ; ModuleID = '/local/hdd/pjtest/pj-collect/SingleSourceBenchmarks/test-suite/SingleSource/Benchmarks/Stanford/Bubblesort.c.Bubble_while.body.3.preheader.pjit.scop.prototype' 7 | target datalayout = "e-m:e-i64:64-f80:128-n8:16:32:64-S128" 8 | target triple = "x86_64-unknown-linux-gnu" 9 | 10 | ; Function Attrs: nounwind 11 | define weak void @Bubble_while.body.3.preheader.pjit.scop([5001 x i32]* nonnull %sortlist) { 12 | newFuncRoot: 13 | br label %while.body.3.preheader 14 | 15 | while.end.18.exitStub: ; preds = %while.end 16 | ret void 17 | 18 | while.body.3.preheader: ; preds = %while.end, %newFuncRoot 19 | %indvars.iv40 = phi i32 [ %indvars.iv.next41, %while.end ], [ 500, %newFuncRoot ] 20 | br label %while.body.3 21 | 22 | while.body.3: ; preds = %while.cond.1.backedge, %while.body.3.preheader 23 | %indvars.iv = phi i64 [ 1, %while.body.3.preheader ], [ %indvars.iv.next, %while.cond.1.backedge ] 24 | %arrayidx = getelementptr inbounds [5001 x i32], [5001 x i32]* %sortlist, i64 0, i64 %indvars.iv 25 | %0 = load i32, i32* %arrayidx, align 4, !tbaa !0 26 | %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1 27 | %arrayidx5 = getelementptr inbounds [5001 x i32], [5001 x i32]* %sortlist, i64 0, i64 %indvars.iv.next 28 | %1 = load i32, i32* %arrayidx5, align 4, !tbaa !0 29 | %cmp6 = icmp sgt i32 %0, %1 30 | br i1 %cmp6, label %if.then, label %while.cond.1.backedge 31 | 32 | if.then: ; preds = %while.body.3 33 | store i32 %1, i32* %arrayidx, align 4, !tbaa !0 34 | store i32 %0, i32* %arrayidx5, align 4, !tbaa !0 35 | br label %while.cond.1.backedge 36 | 37 | while.cond.1.backedge: ; preds = %if.then, %while.body.3 38 | %lftr.wideiv42 = trunc i64 %indvars.iv.next to i32 39 | %exitcond43 = icmp eq i32 %lftr.wideiv42, %indvars.iv40 40 | br i1 %exitcond43, label %while.end, label %while.body.3 41 | 42 | while.end: ; preds = %while.cond.1.backedge 43 | %indvars.iv.next41 = add nsw i32 %indvars.iv40, -1 44 | %cmp = icmp sgt i32 %indvars.iv.next41, 1 45 | br i1 %cmp, label %while.body.3.preheader, label %while.end.18.exitStub 46 | } 47 | 48 | attributes #0 = { nounwind "polyjit-global-count"="1" "polyjit-jit-candidate" } 49 | 50 | !0 = !{!1, !1, i64 0} 51 | !1 = !{!"int", !2, i64 0} 52 | !2 = !{!"omnipotent char", !3, i64 0} 53 | !3 = !{!"Simple C/C++ TBAA"} 54 | -------------------------------------------------------------------------------- /test/pprof/SingleSourceBenchmarks/main_for.body.3.i.44.pjit.scop.ll: -------------------------------------------------------------------------------- 1 | 2 | ; RUN: opt -load LLVMPolly.so -load LLVMPolyJIT.so -O3 -polli -polli-no-recompilation -polli-analyze -disable-output -stats < %s 2>&1 | FileCheck %s 3 | 4 | ; CHECK: 1 regions require runtime support: 5 | 6 | ; ModuleID = '/local/hdd/pjtest/pj-collect/SingleSourceBenchmarks/test-suite/SingleSource/Benchmarks/Polybench/linear-algebra/kernels/gemm/gemm.c.main_for.body.3.i.44.pjit.scop.prototype' 7 | target datalayout = "e-m:e-i64:64-f80:128-n8:16:32:64-S128" 8 | target triple = "x86_64-unknown-linux-gnu" 9 | 10 | ; Function Attrs: nounwind 11 | define weak void @main_for.body.3.i.44.pjit.scop([1024 x double]* %arraydecay, i64 %indvars.iv7.i.41, [1024 x double]* %arraydecay3, [1024 x double]* %arraydecay4) { 12 | newFuncRoot: 13 | br label %for.body.3.i.44 14 | 15 | for.inc.26.i.exitStub: ; preds = %for.inc.23.i 16 | ret void 17 | 18 | for.body.3.i.44: ; preds = %for.inc.23.i, %newFuncRoot 19 | %indvars.iv4.i = phi i64 [ 0, %newFuncRoot ], [ %indvars.iv.next5.i, %for.inc.23.i ] 20 | %arrayidx5.i = getelementptr inbounds [1024 x double], [1024 x double]* %arraydecay, i64 %indvars.iv7.i.41, i64 %indvars.iv4.i 21 | %0 = load double, double* %arrayidx5.i, align 8, !tbaa !0 22 | %mul.i.43 = fmul double %0, 2.123000e+03 23 | store double %mul.i.43, double* %arrayidx5.i, align 8, !tbaa !0 24 | br label %for.body.8.i 25 | 26 | for.body.8.i: ; preds = %for.body.8.i, %for.body.3.i.44 27 | %indvars.iv.i.45 = phi i64 [ 0, %for.body.3.i.44 ], [ %indvars.iv.next.i.46, %for.body.8.i ] 28 | %arrayidx12.i = getelementptr inbounds [1024 x double], [1024 x double]* %arraydecay3, i64 %indvars.iv7.i.41, i64 %indvars.iv.i.45 29 | %1 = load double, double* %arrayidx12.i, align 8, !tbaa !0 30 | %mul13.i = fmul double %1, 3.241200e+04 31 | %arrayidx17.i = getelementptr inbounds [1024 x double], [1024 x double]* %arraydecay4, i64 %indvars.iv.i.45, i64 %indvars.iv4.i 32 | %2 = load double, double* %arrayidx17.i, align 8, !tbaa !0 33 | %mul18.i = fmul double %mul13.i, %2 34 | %3 = load double, double* %arrayidx5.i, align 8, !tbaa !0 35 | %add.i = fadd double %3, %mul18.i 36 | store double %add.i, double* %arrayidx5.i, align 8, !tbaa !0 37 | %indvars.iv.next.i.46 = add nuw nsw i64 %indvars.iv.i.45, 1 38 | %exitcond.i.47 = icmp eq i64 %indvars.iv.next.i.46, 1024 39 | br i1 %exitcond.i.47, label %for.inc.23.i, label %for.body.8.i 40 | 41 | for.inc.23.i: ; preds = %for.body.8.i 42 | %indvars.iv.next5.i = add nuw nsw i64 %indvars.iv4.i, 1 43 | %exitcond6.i = icmp eq i64 %indvars.iv.next5.i, 1024 44 | br i1 %exitcond6.i, label %for.inc.26.i.exitStub, label %for.body.3.i.44 45 | } 46 | 47 | attributes #0 = { nounwind "polyjit-global-count"="0" "polyjit-jit-candidate" } 48 | 49 | !0 = !{!1, !1, i64 0} 50 | !1 = !{!"double", !2, i64 0} 51 | !2 = !{!"omnipotent char", !3, i64 0} 52 | !3 = !{!"Simple C/C++ TBAA"} 53 | -------------------------------------------------------------------------------- /test/pprof/SingleSourceBenchmarks/main_for.body.3.i.92.pjit.scop.ll: -------------------------------------------------------------------------------- 1 | 2 | ; RUN: opt -load LLVMPolly.so -load LLVMPolyJIT.so -O3 -polli -polli-no-recompilation -polli-analyze -disable-output -stats < %s 2>&1 | FileCheck %s 3 | 4 | ; CHECK: 1 regions require runtime support: 5 | 6 | ; ModuleID = '/local/hdd/pjtest/pj-collect/SingleSourceBenchmarks/test-suite/SingleSource/Benchmarks/Polybench/linear-algebra/kernels/3mm/3mm.c.main_for.body.3.i.92.pjit.scop.prototype' 7 | target datalayout = "e-m:e-i64:64-f80:128-n8:16:32:64-S128" 8 | target triple = "x86_64-unknown-linux-gnu" 9 | 10 | ; Function Attrs: nounwind 11 | define weak void @main_for.body.3.i.92.pjit.scop([1024 x double]* %arraydecay10, i64 %indvars.iv31.i, [1024 x double]* %arraydecay, [1024 x double]* %arraydecay7) { 12 | newFuncRoot: 13 | br label %for.body.3.i.92 14 | 15 | for.inc.24.i.exitStub: ; preds = %for.inc.21.i 16 | ret void 17 | 18 | for.body.3.i.92: ; preds = %for.inc.21.i, %newFuncRoot 19 | %indvars.iv28.i = phi i64 [ 0, %newFuncRoot ], [ %indvars.iv.next29.i, %for.inc.21.i ] 20 | %arrayidx5.i = getelementptr inbounds [1024 x double], [1024 x double]* %arraydecay10, i64 %indvars.iv31.i, i64 %indvars.iv28.i 21 | store double 0.000000e+00, double* %arrayidx5.i, align 8, !tbaa !0 22 | br label %for.body.8.i 23 | 24 | for.body.8.i: ; preds = %for.body.8.i, %for.body.3.i.92 25 | %indvars.iv25.i = phi i64 [ 0, %for.body.3.i.92 ], [ %indvars.iv.next26.i, %for.body.8.i ] 26 | %arrayidx12.i = getelementptr inbounds [1024 x double], [1024 x double]* %arraydecay, i64 %indvars.iv31.i, i64 %indvars.iv25.i 27 | %0 = load double, double* %arrayidx12.i, align 8, !tbaa !0 28 | %arrayidx16.i = getelementptr inbounds [1024 x double], [1024 x double]* %arraydecay7, i64 %indvars.iv25.i, i64 %indvars.iv28.i 29 | %1 = load double, double* %arrayidx16.i, align 8, !tbaa !0 30 | %mul.i.93 = fmul double %0, %1 31 | %2 = load double, double* %arrayidx5.i, align 8, !tbaa !0 32 | %add.i = fadd double %2, %mul.i.93 33 | store double %add.i, double* %arrayidx5.i, align 8, !tbaa !0 34 | %indvars.iv.next26.i = add nuw nsw i64 %indvars.iv25.i, 1 35 | %exitcond27.i = icmp eq i64 %indvars.iv.next26.i, 1024 36 | br i1 %exitcond27.i, label %for.inc.21.i, label %for.body.8.i 37 | 38 | for.inc.21.i: ; preds = %for.body.8.i 39 | %indvars.iv.next29.i = add nuw nsw i64 %indvars.iv28.i, 1 40 | %exitcond30.i = icmp eq i64 %indvars.iv.next29.i, 1024 41 | br i1 %exitcond30.i, label %for.inc.24.i.exitStub, label %for.body.3.i.92 42 | } 43 | 44 | attributes #0 = { nounwind "polyjit-global-count"="0" "polyjit-jit-candidate" } 45 | 46 | !0 = !{!1, !1, i64 0} 47 | !1 = !{!"double", !2, i64 0} 48 | !2 = !{!"omnipotent char", !3, i64 0} 49 | !3 = !{!"Simple C/C++ TBAA"} 50 | -------------------------------------------------------------------------------- /test/pprof/SingleSourceBenchmarks/main_for.body.35.lr.ph.us.i.pjit.scop.ll: -------------------------------------------------------------------------------- 1 | 2 | ; RUN: opt -load LLVMPolly.so -load LLVMPolyJIT.so -O3 -polli -polli-no-recompilation -polli-analyze -disable-output -stats < %s 2>&1 | FileCheck %s 3 | 4 | ; CHECK: 1 regions require runtime support: 5 | 6 | ; ModuleID = '/local/hdd/pjtest/pj-collect/SingleSourceBenchmarks/test-suite/SingleSource/Benchmarks/Linpack/linpack-pc.c.main_for.body.35.lr.ph.us.i.pjit.scop.prototype' 7 | target datalayout = "e-m:e-i64:64-f80:128-n8:16:32:64-S128" 8 | target triple = "x86_64-unknown-linux-gnu" 9 | 10 | ; Function Attrs: nounwind 11 | define weak void @main_for.body.35.lr.ph.us.i.pjit.scop([200 x float]* nonnull %main.b, [40200 x float]* nonnull %main.a) { 12 | newFuncRoot: 13 | br label %for.body.35.lr.ph.us.i 14 | 15 | matgen.exit.exitStub: ; preds = %for.cond.32.for.inc.48_crit_edge.us.i 16 | ret void 17 | 18 | for.body.35.lr.ph.us.i: ; preds = %for.cond.32.for.inc.48_crit_edge.us.i, %newFuncRoot 19 | %indvars.iv106.i = phi i64 [ 0, %newFuncRoot ], [ %indvars.iv.next107.i, %for.cond.32.for.inc.48_crit_edge.us.i ] 20 | %0 = mul nuw nsw i64 %indvars.iv106.i, 201 21 | br label %for.body.35.us.i 22 | 23 | for.body.35.us.i: ; preds = %for.body.35.us.i, %for.body.35.lr.ph.us.i 24 | %indvars.iv.i = phi i64 [ 0, %for.body.35.lr.ph.us.i ], [ %indvars.iv.next.i, %for.body.35.us.i ] 25 | %arrayidx37.us.i = getelementptr inbounds [200 x float], [200 x float]* %main.b, i64 0, i64 %indvars.iv.i 26 | %1 = load float, float* %arrayidx37.us.i, align 4, !tbaa !0 27 | %2 = add nuw nsw i64 %indvars.iv.i, %0 28 | %arrayidx41.us.i = getelementptr inbounds [40200 x float], [40200 x float]* %main.a, i64 0, i64 %2 29 | %3 = load float, float* %arrayidx41.us.i, align 4, !tbaa !0 30 | %add42.us.i = fadd float %1, %3 31 | store float %add42.us.i, float* %arrayidx37.us.i, align 4, !tbaa !0 32 | %indvars.iv.next.i = add nuw nsw i64 %indvars.iv.i, 1 33 | %exitcond842 = icmp eq i64 %indvars.iv.next.i, 100 34 | br i1 %exitcond842, label %for.cond.32.for.inc.48_crit_edge.us.i, label %for.body.35.us.i 35 | 36 | for.cond.32.for.inc.48_crit_edge.us.i: ; preds = %for.body.35.us.i 37 | %indvars.iv.next107.i = add nuw nsw i64 %indvars.iv106.i, 1 38 | %exitcond843 = icmp eq i64 %indvars.iv.next107.i, 100 39 | br i1 %exitcond843, label %matgen.exit.exitStub, label %for.body.35.lr.ph.us.i 40 | } 41 | 42 | attributes #0 = { nounwind "polyjit-global-count"="2" "polyjit-jit-candidate" } 43 | 44 | !0 = !{!1, !1, i64 0} 45 | !1 = !{!"float", !2, i64 0} 46 | !2 = !{!"omnipotent char", !3, i64 0} 47 | !3 = !{!"Simple C/C++ TBAA"} 48 | -------------------------------------------------------------------------------- /test/pprof/SingleSourceBenchmarks/main_for.body.36.i.pjit.scop.ll: -------------------------------------------------------------------------------- 1 | 2 | ; RUN: opt -load LLVMPolly.so -load LLVMPolyJIT.so -O3 -polli -polli-no-recompilation -polli-analyze -disable-output -stats < %s 2>&1 | FileCheck %s 3 | 4 | ; CHECK: 1 regions require runtime support: 5 | 6 | ; ModuleID = '/local/hdd/pjtest/pj-collect/SingleSourceBenchmarks/test-suite/SingleSource/Benchmarks/Polybench/linear-algebra/kernels/2mm/2mm.c.main_for.body.36.i.pjit.scop.prototype' 7 | target datalayout = "e-m:e-i64:64-f80:128-n8:16:32:64-S128" 8 | target triple = "x86_64-unknown-linux-gnu" 9 | 10 | ; Function Attrs: nounwind 11 | define weak void @main_for.body.36.i.pjit.scop([1024 x double]* %arraydecay11, i64 %indvars.iv10.i.74, [1024 x double]* %arraydecay12, [1024 x double]* %arraydecay10) { 12 | newFuncRoot: 13 | br label %for.body.36.i 14 | 15 | for.inc.65.i.exitStub: ; preds = %for.inc.62.i 16 | ret void 17 | 18 | for.body.36.i: ; preds = %for.inc.62.i, %newFuncRoot 19 | %indvars.iv7.i = phi i64 [ 0, %newFuncRoot ], [ %indvars.iv.next8.i, %for.inc.62.i ] 20 | %arrayidx40.i = getelementptr inbounds [1024 x double], [1024 x double]* %arraydecay11, i64 %indvars.iv10.i.74, i64 %indvars.iv7.i 21 | %0 = load double, double* %arrayidx40.i, align 8, !tbaa !0 22 | %mul41.i = fmul double %0, 2.123000e+03 23 | store double %mul41.i, double* %arrayidx40.i, align 8, !tbaa !0 24 | br label %for.body.44.i 25 | 26 | for.body.44.i: ; preds = %for.body.44.i, %for.body.36.i 27 | %indvars.iv.i.75 = phi i64 [ 0, %for.body.36.i ], [ %indvars.iv.next.i.76, %for.body.44.i ] 28 | %arrayidx48.i = getelementptr inbounds [1024 x double], [1024 x double]* %arraydecay12, i64 %indvars.iv10.i.74, i64 %indvars.iv.i.75 29 | %1 = load double, double* %arrayidx48.i, align 8, !tbaa !0 30 | %arrayidx52.i = getelementptr inbounds [1024 x double], [1024 x double]* %arraydecay10, i64 %indvars.iv.i.75, i64 %indvars.iv7.i 31 | %2 = load double, double* %arrayidx52.i, align 8, !tbaa !0 32 | %mul53.i = fmul double %1, %2 33 | %3 = load double, double* %arrayidx40.i, align 8, !tbaa !0 34 | %add58.i = fadd double %3, %mul53.i 35 | store double %add58.i, double* %arrayidx40.i, align 8, !tbaa !0 36 | %indvars.iv.next.i.76 = add nuw nsw i64 %indvars.iv.i.75, 1 37 | %exitcond.i.77 = icmp eq i64 %indvars.iv.next.i.76, 1024 38 | br i1 %exitcond.i.77, label %for.inc.62.i, label %for.body.44.i 39 | 40 | for.inc.62.i: ; preds = %for.body.44.i 41 | %indvars.iv.next8.i = add nuw nsw i64 %indvars.iv7.i, 1 42 | %exitcond9.i = icmp eq i64 %indvars.iv.next8.i, 1024 43 | br i1 %exitcond9.i, label %for.inc.65.i.exitStub, label %for.body.36.i 44 | } 45 | 46 | attributes #0 = { nounwind "polyjit-global-count"="0" "polyjit-jit-candidate" } 47 | 48 | !0 = !{!1, !1, i64 0} 49 | !1 = !{!"double", !2, i64 0} 50 | !2 = !{!"omnipotent char", !3, i64 0} 51 | !3 = !{!"Simple C/C++ TBAA"} 52 | -------------------------------------------------------------------------------- /test/pprof/SingleSourceBenchmarks/main_for.cond.12.preheader.pjit.scop.ll: -------------------------------------------------------------------------------- 1 | 2 | ; RUN: opt -load LLVMPolly.so -load LLVMPolyJIT.so -O3 -polli -polli-no-recompilation -polli-analyze -disable-output -stats < %s 2>&1 | FileCheck %s 3 | 4 | ; CHECK: 1 regions require runtime support: 5 | 6 | ; ModuleID = '/local/hdd/pjtest/pj-collect/SingleSourceBenchmarks/test-suite/SingleSource/Benchmarks/Shootout-C++/ary3.cpp.main_for.cond.12.preheader.pjit.scop.prototype' 7 | target datalayout = "e-m:e-i64:64-f80:128-n8:16:32:64-S128" 8 | target triple = "x86_64-unknown-linux-gnu" 9 | 10 | define weak void @main_for.cond.12.preheader.pjit.scop(i32 %cond, i32* %x.sroa.0.0145, i32*) { 11 | newFuncRoot: 12 | br label %for.cond.12.preheader 13 | 14 | for.end.30.exitStub: ; preds = %for.end.30.loopexit, %for.cond.12.preheader 15 | ret void 16 | 17 | for.cond.12.preheader: ; preds = %newFuncRoot 18 | %cmp17.151 = icmp sgt i32 %cond, 0 19 | br i1 %cmp17.151, label %for.body.18.lr.ph.us.preheader, label %for.end.30.exitStub 20 | 21 | for.body.18.lr.ph.us.preheader: ; preds = %for.cond.12.preheader 22 | %1 = sext i32 %cond to i64 23 | br label %for.body.18.lr.ph.us 24 | 25 | for.body.18.lr.ph.us: ; preds = %for.cond.16.for.cond.cleanup_crit_edge.us, %for.body.18.lr.ph.us.preheader 26 | %k.0153.us = phi i32 [ %inc29.us, %for.cond.16.for.cond.cleanup_crit_edge.us ], [ 0, %for.body.18.lr.ph.us.preheader ] 27 | br label %for.body.18.us 28 | 29 | for.body.18.us: ; preds = %for.body.18.us, %for.body.18.lr.ph.us 30 | %indvars.iv = phi i64 [ %1, %for.body.18.lr.ph.us ], [ %indvars.iv.next, %for.body.18.us ] 31 | %indvars.iv.next = add nsw i64 %indvars.iv, -1 32 | %add.ptr.i.112.us = getelementptr inbounds i32, i32* %x.sroa.0.0145, i64 %indvars.iv.next 33 | %2 = load i32, i32* %add.ptr.i.112.us, align 4, !tbaa !0 34 | %add.ptr.i.114.us = getelementptr inbounds i32, i32* %0, i64 %indvars.iv.next 35 | %3 = load i32, i32* %add.ptr.i.114.us, align 4, !tbaa !0 36 | %add25.us = add nsw i32 %3, %2 37 | store i32 %add25.us, i32* %add.ptr.i.114.us, align 4, !tbaa !0 38 | %cmp17.us = icmp sgt i64 %indvars.iv, 1 39 | br i1 %cmp17.us, label %for.body.18.us, label %for.cond.16.for.cond.cleanup_crit_edge.us 40 | 41 | for.cond.16.for.cond.cleanup_crit_edge.us: ; preds = %for.body.18.us 42 | %inc29.us = add nuw nsw i32 %k.0153.us, 1 43 | %exitcond = icmp eq i32 %inc29.us, 1000 44 | br i1 %exitcond, label %for.end.30.loopexit, label %for.body.18.lr.ph.us 45 | 46 | for.end.30.loopexit: ; preds = %for.cond.16.for.cond.cleanup_crit_edge.us 47 | br label %for.end.30.exitStub 48 | } 49 | 50 | attributes #0 = { "polyjit-global-count"="0" "polyjit-jit-candidate" } 51 | 52 | !0 = !{!1, !1, i64 0} 53 | !1 = !{!"int", !2, i64 0} 54 | !2 = !{!"omnipotent char", !3, i64 0} 55 | !3 = !{!"Simple C/C++ TBAA"} 56 | -------------------------------------------------------------------------------- /test/pprof/SingleSourceBenchmarks/main_for.cond.7.preheader.pjit.scop.ll: -------------------------------------------------------------------------------- 1 | 2 | ; RUN: opt -load LLVMPolly.so -load LLVMPolyJIT.so -O3 -polli -polli-no-recompilation -polli-analyze -disable-output -stats < %s 2>&1 | FileCheck %s 3 | 4 | ; CHECK: 1 regions require runtime support: 5 | 6 | ; ModuleID = '/local/hdd/pjtest/pj-collect/SingleSourceBenchmarks/test-suite/SingleSource/Benchmarks/Shootout/ary3.c.main_for.cond.7.preheader.pjit.scop.prototype' 7 | target datalayout = "e-m:e-i64:64-f80:128-n8:16:32:64-S128" 8 | target triple = "x86_64-unknown-linux-gnu" 9 | 10 | ; Function Attrs: nounwind 11 | define weak void @main_for.cond.7.preheader.pjit.scop(i32 %cond, i32*, i32*) { 12 | newFuncRoot: 13 | br label %for.cond.7.preheader 14 | 15 | for.end.24.exitStub: ; preds = %for.end.24.loopexit, %for.cond.7.preheader 16 | ret void 17 | 18 | for.cond.7.preheader: ; preds = %newFuncRoot 19 | %cmp12.53 = icmp sgt i32 %cond, 0 20 | br i1 %cmp12.53, label %for.body.14.lr.ph.us.preheader, label %for.end.24.exitStub 21 | 22 | for.body.14.lr.ph.us.preheader: ; preds = %for.cond.7.preheader 23 | %2 = sext i32 %cond to i64 24 | br label %for.body.14.lr.ph.us 25 | 26 | for.body.14.lr.ph.us: ; preds = %for.cond.11.for.inc.22_crit_edge.us, %for.body.14.lr.ph.us.preheader 27 | %k.055.us = phi i32 [ %inc23.us, %for.cond.11.for.inc.22_crit_edge.us ], [ 0, %for.body.14.lr.ph.us.preheader ] 28 | br label %for.body.14.us 29 | 30 | for.body.14.us: ; preds = %for.body.14.us, %for.body.14.lr.ph.us 31 | %indvars.iv = phi i64 [ %2, %for.body.14.lr.ph.us ], [ %indvars.iv.next, %for.body.14.us ] 32 | %indvars.iv.next = add nsw i64 %indvars.iv, -1 33 | %arrayidx16.us = getelementptr inbounds i32, i32* %0, i64 %indvars.iv.next 34 | %3 = load i32, i32* %arrayidx16.us, align 4, !tbaa !0 35 | %arrayidx18.us = getelementptr inbounds i32, i32* %1, i64 %indvars.iv.next 36 | %4 = load i32, i32* %arrayidx18.us, align 4, !tbaa !0 37 | %add19.us = add nsw i32 %4, %3 38 | store i32 %add19.us, i32* %arrayidx18.us, align 4, !tbaa !0 39 | %cmp12.us = icmp sgt i64 %indvars.iv, 1 40 | br i1 %cmp12.us, label %for.body.14.us, label %for.cond.11.for.inc.22_crit_edge.us 41 | 42 | for.cond.11.for.inc.22_crit_edge.us: ; preds = %for.body.14.us 43 | %inc23.us = add nuw nsw i32 %k.055.us, 1 44 | %exitcond = icmp eq i32 %inc23.us, 1000 45 | br i1 %exitcond, label %for.end.24.loopexit, label %for.body.14.lr.ph.us 46 | 47 | for.end.24.loopexit: ; preds = %for.cond.11.for.inc.22_crit_edge.us 48 | br label %for.end.24.exitStub 49 | } 50 | 51 | attributes #0 = { nounwind "polyjit-global-count"="0" "polyjit-jit-candidate" } 52 | 53 | !0 = !{!1, !1, i64 0} 54 | !1 = !{!"int", !2, i64 0} 55 | !2 = !{!"omnipotent char", !3, i64 0} 56 | !3 = !{!"Simple C/C++ TBAA"} 57 | -------------------------------------------------------------------------------- /test/pprof/crafty/InitializeKingSafety_for.cond.1.preheader.pjit.scop.ll: -------------------------------------------------------------------------------- 1 | 2 | ; RUN: opt -load LLVMPolly.so -load LLVMPolyJIT.so -O3 -polli -polli-no-recompilation -polli-analyze -disable-output -stats < %s 2>&1 | FileCheck %s 3 | 4 | ; CHECK: 1 regions require runtime support: 5 | 6 | ; ModuleID = 'crafty.c.InitializeKingSafety_for.cond.1.preheader.pjit.scop.prototype' 7 | target datalayout = "e-m:e-i64:64-f80:128-n8:16:32:64-S128" 8 | target triple = "x86_64-unknown-linux-gnu" 9 | 10 | ; Function Attrs: nounwind 11 | define weak void @InitializeKingSafety_for.cond.1.preheader.pjit.scop([16 x i32]* nonnull %safety_vector, [16 x i32]* nonnull %tropism_vector, [16 x [16 x i32]]* nonnull %king_safety) { 12 | newFuncRoot: 13 | br label %for.cond.1.preheader 14 | 15 | for.end.15.exitStub: ; preds = %for.inc.13 16 | ret void 17 | 18 | for.cond.1.preheader: ; preds = %for.inc.13, %newFuncRoot 19 | %indvars.iv25 = phi i64 [ 0, %newFuncRoot ], [ %indvars.iv.next26, %for.inc.13 ] 20 | %arrayidx = getelementptr inbounds [16 x i32], [16 x i32]* %safety_vector, i64 0, i64 %indvars.iv25 21 | %0 = load i32, i32* %arrayidx, align 4, !tbaa !0 22 | %add = add nsw i32 %0, 100 23 | br label %for.body.3 24 | 25 | for.body.3: ; preds = %for.body.3, %for.cond.1.preheader 26 | %indvars.iv = phi i64 [ 0, %for.cond.1.preheader ], [ %indvars.iv.next, %for.body.3 ] 27 | %arrayidx5 = getelementptr inbounds [16 x i32], [16 x i32]* %tropism_vector, i64 0, i64 %indvars.iv 28 | %1 = load i32, i32* %arrayidx5, align 4, !tbaa !0 29 | %add6 = add nsw i32 %1, 100 30 | %mul = mul nsw i32 %add6, %add 31 | %div = sdiv i32 %mul, 100 32 | %2 = mul i32 %div, 180 33 | %mul7 = add i32 %2, -18000 34 | %div8 = sdiv i32 %mul7, 100 35 | %arrayidx12 = getelementptr inbounds [16 x [16 x i32]], [16 x [16 x i32]]* %king_safety, i64 0, i64 %indvars.iv25, i64 %indvars.iv 36 | store i32 %div8, i32* %arrayidx12, align 4, !tbaa !0 37 | %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1 38 | %exitcond = icmp eq i64 %indvars.iv.next, 16 39 | br i1 %exitcond, label %for.inc.13, label %for.body.3 40 | 41 | for.inc.13: ; preds = %for.body.3 42 | %indvars.iv.next26 = add nuw nsw i64 %indvars.iv25, 1 43 | %exitcond27 = icmp eq i64 %indvars.iv.next26, 16 44 | br i1 %exitcond27, label %for.end.15.exitStub, label %for.cond.1.preheader 45 | } 46 | 47 | attributes #0 = { nounwind "polyjit-global-count"="3" "polyjit-jit-candidate" } 48 | 49 | !0 = !{!1, !1, i64 0} 50 | !1 = !{!"int", !2, i64 0} 51 | !2 = !{!"omnipotent char", !3, i64 0} 52 | !3 = !{!"Simple C/C++ TBAA"} 53 | -------------------------------------------------------------------------------- /test/pprof/deriche/main_for.cond.100.preheader.i.pjit.scop.ll: -------------------------------------------------------------------------------- 1 | 2 | ; RUN: opt -load LLVMPolly.so -load LLVMPolyJIT.so -O3 -polli -polli-no-recompilation -polli-analyze -disable-output -stats < %s 2>&1 | FileCheck %s 3 | 4 | ; CHECK: 1 regions require runtime support: 5 | 6 | ; ModuleID = 'deriche.dir/deriche.c.main_for.cond.100.preheader.i.pjit.scop.prototype' 7 | target datalayout = "e-m:e-i64:64-f80:128-n8:16:32:64-S128" 8 | target triple = "x86_64-unknown-linux-gnu" 9 | 10 | ; Function Attrs: nounwind 11 | define weak void @main_for.cond.100.preheader.i.pjit.scop(float*, float*, float*) { 12 | newFuncRoot: 13 | br label %for.cond.100.preheader.i 14 | 15 | for.cond.126.preheader.i.preheader.exitStub: ; preds = %for.inc.120.i 16 | ret void 17 | 18 | for.cond.100.preheader.i: ; preds = %for.inc.120.i, %newFuncRoot 19 | %indvars.iv44.i = phi i64 [ %indvars.iv.next45.i, %for.inc.120.i ], [ 0, %newFuncRoot ] 20 | %3 = mul nuw nsw i64 %indvars.iv44.i, 2160 21 | %arrayidx105.i = getelementptr inbounds float, float* %0, i64 %3 22 | %arrayidx109.i = getelementptr inbounds float, float* %1, i64 %3 23 | %arrayidx115.i = getelementptr inbounds float, float* %2, i64 %3 24 | br label %for.body.102.i 25 | 26 | for.body.102.i: ; preds = %for.body.102.i, %for.cond.100.preheader.i 27 | %indvars.iv41.i = phi i64 [ 0, %for.cond.100.preheader.i ], [ %indvars.iv.next42.i, %for.body.102.i ] 28 | %arrayidx106.i = getelementptr inbounds float, float* %arrayidx105.i, i64 %indvars.iv41.i 29 | %4 = load float, float* %arrayidx106.i, align 4, !tbaa !0 30 | %arrayidx110.i = getelementptr inbounds float, float* %arrayidx109.i, i64 %indvars.iv41.i 31 | %5 = load float, float* %arrayidx110.i, align 4, !tbaa !0 32 | %add111.i = fadd float %4, %5 33 | %arrayidx116.i = getelementptr inbounds float, float* %arrayidx115.i, i64 %indvars.iv41.i 34 | store float %add111.i, float* %arrayidx116.i, align 4, !tbaa !0 35 | %indvars.iv.next42.i = add nuw nsw i64 %indvars.iv41.i, 1 36 | %exitcond43.i = icmp eq i64 %indvars.iv.next42.i, 2160 37 | br i1 %exitcond43.i, label %for.inc.120.i, label %for.body.102.i 38 | 39 | for.inc.120.i: ; preds = %for.body.102.i 40 | %indvars.iv.next45.i = add nuw nsw i64 %indvars.iv44.i, 1 41 | %exitcond46.i = icmp eq i64 %indvars.iv.next45.i, 4096 42 | br i1 %exitcond46.i, label %for.cond.126.preheader.i.preheader.exitStub, label %for.cond.100.preheader.i 43 | } 44 | 45 | attributes #0 = { nounwind "polyjit-global-count"="0" "polyjit-jit-candidate" } 46 | 47 | !0 = !{!1, !1, i64 0} 48 | !1 = !{!"float", !2, i64 0} 49 | !2 = !{!"omnipotent char", !3, i64 0} 50 | !3 = !{!"Simple C/C++ TBAA"} 51 | -------------------------------------------------------------------------------- /test/pprof/lapack/dchk3__for.body.332.lr.ph.pjit.scop.ll: -------------------------------------------------------------------------------- 1 | 2 | ; RUN: opt -load LLVMPolly.so -load LLVMPolyJIT.so -O3 -polli -polli-no-recompilation -polli-analyze -disable-output -stats < %s 2>&1 | FileCheck %s 3 | 4 | ; CHECK: 1 regions require runtime support: 5 | 6 | ; ModuleID = 'dblat3.c.dchk3__for.body.332.lr.ph.pjit.scop.prototype' 7 | target datalayout = "e-m:e-i64:64-f80:128-n8:16:32:64-S128" 8 | target triple = "x86_64-unknown-linux-gnu" 9 | 10 | ; Function Attrs: nounwind 11 | define weak void @dchk3__for.body.332.lr.ph.pjit.scop(i64, i64, double* %incdec.ptr5, double* %add.ptr, double* %add.ptr8, double, i64, i64) { 12 | newFuncRoot: 13 | br label %for.body.332.lr.ph 14 | 15 | for.cond.325.for.end.353_crit_edge.loopexit.exitStub: ; preds = %for.inc.351 16 | ret void 17 | 18 | for.body.332.lr.ph: ; preds = %for.inc.351, %newFuncRoot 19 | %j.1648 = phi i64 [ %inc352, %for.inc.351 ], [ 1, %newFuncRoot ] 20 | %sub333 = add nsw i64 %j.1648, -1 21 | %mul334 = mul nsw i64 %sub333, %0 22 | %mul337 = mul nsw i64 %j.1648, %1 23 | %mul345 = mul nsw i64 %sub333, %0 24 | br label %for.body.332 25 | 26 | for.body.332: ; preds = %for.body.332, %for.body.332.lr.ph 27 | %inc349669 = phi i64 [ 1, %for.body.332.lr.ph ], [ %inc349, %for.body.332 ] 28 | %add335 = add nsw i64 %inc349669, %mul334 29 | %arrayidx336 = getelementptr inbounds double, double* %incdec.ptr5, i64 %add335 30 | %5 = bitcast double* %arrayidx336 to i64* 31 | %6 = load i64, i64* %5, align 8, !tbaa !0 32 | %add338 = add nsw i64 %inc349669, %mul337 33 | %arrayidx339 = getelementptr inbounds double, double* %add.ptr, i64 %add338 34 | %7 = bitcast double* %arrayidx339 to i64* 35 | store i64 %6, i64* %7, align 8, !tbaa !0 36 | %add341 = add nsw i64 %inc349669, %mul337 37 | %arrayidx342 = getelementptr inbounds double, double* %add.ptr8, i64 %add341 38 | %8 = load double, double* %arrayidx342, align 8, !tbaa !0 39 | %mul343 = fmul double %2, %8 40 | %add346 = add nsw i64 %inc349669, %mul345 41 | %arrayidx347 = getelementptr inbounds double, double* %incdec.ptr5, i64 %add346 42 | store double %mul343, double* %arrayidx347, align 8, !tbaa !0 43 | %inc349 = add nuw nsw i64 %inc349669, 1 44 | %exitcond = icmp eq i64 %inc349, %3 45 | br i1 %exitcond, label %for.inc.351, label %for.body.332 46 | 47 | for.inc.351: ; preds = %for.body.332 48 | %inc352 = add nuw nsw i64 %j.1648, 1 49 | %exitcond678 = icmp eq i64 %j.1648, %4 50 | br i1 %exitcond678, label %for.cond.325.for.end.353_crit_edge.loopexit.exitStub, label %for.body.332.lr.ph 51 | } 52 | 53 | attributes #0 = { nounwind "polyjit-global-count"="0" "polyjit-jit-candidate" } 54 | 55 | !0 = !{!1, !1, i64 0} 56 | !1 = !{!"double", !2, i64 0} 57 | !2 = !{!"omnipotent char", !3, i64 0} 58 | !3 = !{!"Simple C/C++ TBAA"} 59 | -------------------------------------------------------------------------------- /test/pprof/lapack/f2c_cgemm_for.body.113.lr.ph.pjit.scop.ll: -------------------------------------------------------------------------------- 1 | 2 | ; RUN: opt -load LLVMPolly.so -load LLVMPolyJIT.so -O3 -polli -polli-no-recompilation -polli-analyze -disable-output -stats < %s 2>&1 | FileCheck %s 3 | 4 | ; CHECK: 1 regions require runtime support: 5 | 6 | ; ModuleID = 'cgemm.c.f2c_cgemm_for.body.113.lr.ph.pjit.scop.prototype' 7 | target datalayout = "e-m:e-i64:64-f80:128-n8:16:32:64-S128" 8 | target triple = "x86_64-unknown-linux-gnu" 9 | 10 | %struct.complex = type { float, float } 11 | 12 | ; Function Attrs: nounwind 13 | define weak void @f2c_cgemm_for.body.113.lr.ph.pjit.scop(i64, float* %r90, %struct.complex* %add.ptr6, float* %i122, i64, i64) { 14 | newFuncRoot: 15 | br label %for.body.113.lr.ph 16 | 17 | cleanup.loopexit2648.exitStub: ; preds = %for.inc.146 18 | ret void 19 | 20 | for.body.113.lr.ph: ; preds = %for.inc.146, %newFuncRoot 21 | %j.12483 = phi i64 [ %inc147, %for.inc.146 ], [ 1, %newFuncRoot ] 22 | %mul114 = mul nsw i64 %j.12483, %0 23 | br label %for.body.113 24 | 25 | for.body.113: ; preds = %for.body.113, %for.body.113.lr.ph 26 | %i__.12481 = phi i64 [ 1, %for.body.113.lr.ph ], [ %inc144, %for.body.113 ] 27 | %add115 = add nsw i64 %i__.12481, %mul114 28 | %3 = load float, float* %r90, align 4, !tbaa !0 29 | %arrayidx119 = getelementptr inbounds %struct.complex, %struct.complex* %add.ptr6, i64 %add115 30 | %r120 = getelementptr inbounds %struct.complex, %struct.complex* %arrayidx119, i64 0, i32 0 31 | %4 = load float, float* %r120, align 4, !tbaa !0 32 | %mul121 = fmul float %3, %4 33 | %5 = load float, float* %i122, align 4, !tbaa !5 34 | %i124 = getelementptr inbounds %struct.complex, %struct.complex* %arrayidx119, i64 0, i32 1 35 | %6 = load float, float* %i124, align 4, !tbaa !5 36 | %mul125 = fmul float %5, %6 37 | %sub = fsub float %mul121, %mul125 38 | %mul130 = fmul float %3, %6 39 | %mul134 = fmul float %4, %5 40 | %add135 = fadd float %mul134, %mul130 41 | store float %sub, float* %r120, align 4, !tbaa !0 42 | store float %add135, float* %i124, align 4, !tbaa !5 43 | %inc144 = add nuw nsw i64 %i__.12481, 1 44 | %exitcond2613 = icmp eq i64 %i__.12481, %1 45 | br i1 %exitcond2613, label %for.inc.146, label %for.body.113 46 | 47 | for.inc.146: ; preds = %for.body.113 48 | %inc147 = add nuw nsw i64 %j.12483, 1 49 | %exitcond2614 = icmp eq i64 %j.12483, %2 50 | br i1 %exitcond2614, label %cleanup.loopexit2648.exitStub, label %for.body.113.lr.ph 51 | } 52 | 53 | attributes #0 = { nounwind "polyjit-global-count"="0" "polyjit-jit-candidate" } 54 | 55 | !0 = !{!1, !2, i64 0} 56 | !1 = !{!"", !2, i64 0, !2, i64 4} 57 | !2 = !{!"float", !3, i64 0} 58 | !3 = !{!"omnipotent char", !4, i64 0} 59 | !4 = !{!"Simple C/C++ TBAA"} 60 | !5 = !{!1, !2, i64 4} 61 | -------------------------------------------------------------------------------- /test/pprof/lapack/f2c_chemm_for.body.98.lr.ph.pjit.scop.ll: -------------------------------------------------------------------------------- 1 | 2 | ; RUN: opt -load LLVMPolly.so -load LLVMPolyJIT.so -O3 -polli -polli-no-recompilation -polli-analyze -disable-output -stats < %s 2>&1 | FileCheck %s 3 | 4 | ; CHECK: 1 regions require runtime support: 5 | 6 | ; ModuleID = 'chemm.c.f2c_chemm_for.body.98.lr.ph.pjit.scop.prototype' 7 | target datalayout = "e-m:e-i64:64-f80:128-n8:16:32:64-S128" 8 | target triple = "x86_64-unknown-linux-gnu" 9 | 10 | %struct.complex = type { float, float } 11 | 12 | ; Function Attrs: nounwind 13 | define weak void @f2c_chemm_for.body.98.lr.ph.pjit.scop(i64, float* %r75, %struct.complex* %add.ptr6, float* %i107, i64, i64) { 14 | newFuncRoot: 15 | br label %for.body.98.lr.ph 16 | 17 | cleanup.loopexit1704.exitStub: ; preds = %for.inc.131 18 | ret void 19 | 20 | for.body.98.lr.ph: ; preds = %for.inc.131, %newFuncRoot 21 | %j.11631 = phi i64 [ %inc132, %for.inc.131 ], [ 1, %newFuncRoot ] 22 | %mul99 = mul nsw i64 %j.11631, %0 23 | br label %for.body.98 24 | 25 | for.body.98: ; preds = %for.body.98, %for.body.98.lr.ph 26 | %i__.11629 = phi i64 [ 1, %for.body.98.lr.ph ], [ %inc129, %for.body.98 ] 27 | %add100 = add nsw i64 %i__.11629, %mul99 28 | %3 = load float, float* %r75, align 4, !tbaa !0 29 | %arrayidx104 = getelementptr inbounds %struct.complex, %struct.complex* %add.ptr6, i64 %add100 30 | %r105 = getelementptr inbounds %struct.complex, %struct.complex* %arrayidx104, i64 0, i32 0 31 | %4 = load float, float* %r105, align 4, !tbaa !0 32 | %mul106 = fmul float %3, %4 33 | %5 = load float, float* %i107, align 4, !tbaa !5 34 | %i109 = getelementptr inbounds %struct.complex, %struct.complex* %arrayidx104, i64 0, i32 1 35 | %6 = load float, float* %i109, align 4, !tbaa !5 36 | %mul110 = fmul float %5, %6 37 | %sub = fsub float %mul106, %mul110 38 | %mul115 = fmul float %3, %6 39 | %mul119 = fmul float %4, %5 40 | %add120 = fadd float %mul119, %mul115 41 | store float %sub, float* %r105, align 4, !tbaa !0 42 | store float %add120, float* %i109, align 4, !tbaa !5 43 | %inc129 = add nuw nsw i64 %i__.11629, 1 44 | %exitcond1684 = icmp eq i64 %i__.11629, %1 45 | br i1 %exitcond1684, label %for.inc.131, label %for.body.98 46 | 47 | for.inc.131: ; preds = %for.body.98 48 | %inc132 = add nuw nsw i64 %j.11631, 1 49 | %exitcond1685 = icmp eq i64 %j.11631, %2 50 | br i1 %exitcond1685, label %cleanup.loopexit1704.exitStub, label %for.body.98.lr.ph 51 | } 52 | 53 | attributes #0 = { nounwind "polyjit-global-count"="0" "polyjit-jit-candidate" } 54 | 55 | !0 = !{!1, !2, i64 0} 56 | !1 = !{!"", !2, i64 0, !2, i64 4} 57 | !2 = !{!"float", !3, i64 0} 58 | !3 = !{!"omnipotent char", !4, i64 0} 59 | !4 = !{!"Simple C/C++ TBAA"} 60 | !5 = !{!1, !2, i64 4} 61 | -------------------------------------------------------------------------------- /test/pprof/lapack/f2c_csymm_for.body.98.lr.ph.pjit.scop.ll: -------------------------------------------------------------------------------- 1 | 2 | ; RUN: opt -load LLVMPolly.so -load LLVMPolyJIT.so -O3 -polli -polli-no-recompilation -polli-analyze -disable-output -stats < %s 2>&1 | FileCheck %s 3 | 4 | ; CHECK: 1 regions require runtime support: 5 | 6 | ; ModuleID = 'csymm.c.f2c_csymm_for.body.98.lr.ph.pjit.scop.prototype' 7 | target datalayout = "e-m:e-i64:64-f80:128-n8:16:32:64-S128" 8 | target triple = "x86_64-unknown-linux-gnu" 9 | 10 | %struct.complex = type { float, float } 11 | 12 | ; Function Attrs: nounwind 13 | define weak void @f2c_csymm_for.body.98.lr.ph.pjit.scop(i64, float* %r75, %struct.complex* %add.ptr6, float* %i107, i64, i64) { 14 | newFuncRoot: 15 | br label %for.body.98.lr.ph 16 | 17 | cleanup.loopexit1866.exitStub: ; preds = %for.inc.131 18 | ret void 19 | 20 | for.body.98.lr.ph: ; preds = %for.inc.131, %newFuncRoot 21 | %j.11792 = phi i64 [ %inc132, %for.inc.131 ], [ 1, %newFuncRoot ] 22 | %mul99 = mul nsw i64 %j.11792, %0 23 | br label %for.body.98 24 | 25 | for.body.98: ; preds = %for.body.98, %for.body.98.lr.ph 26 | %i__.11790 = phi i64 [ 1, %for.body.98.lr.ph ], [ %inc129, %for.body.98 ] 27 | %add100 = add nsw i64 %i__.11790, %mul99 28 | %3 = load float, float* %r75, align 4, !tbaa !0 29 | %arrayidx104 = getelementptr inbounds %struct.complex, %struct.complex* %add.ptr6, i64 %add100 30 | %r105 = getelementptr inbounds %struct.complex, %struct.complex* %arrayidx104, i64 0, i32 0 31 | %4 = load float, float* %r105, align 4, !tbaa !0 32 | %mul106 = fmul float %3, %4 33 | %5 = load float, float* %i107, align 4, !tbaa !5 34 | %i109 = getelementptr inbounds %struct.complex, %struct.complex* %arrayidx104, i64 0, i32 1 35 | %6 = load float, float* %i109, align 4, !tbaa !5 36 | %mul110 = fmul float %5, %6 37 | %sub = fsub float %mul106, %mul110 38 | %mul115 = fmul float %3, %6 39 | %mul119 = fmul float %4, %5 40 | %add120 = fadd float %mul119, %mul115 41 | store float %sub, float* %r105, align 4, !tbaa !0 42 | store float %add120, float* %i109, align 4, !tbaa !5 43 | %inc129 = add nuw nsw i64 %i__.11790, 1 44 | %exitcond1846 = icmp eq i64 %i__.11790, %1 45 | br i1 %exitcond1846, label %for.inc.131, label %for.body.98 46 | 47 | for.inc.131: ; preds = %for.body.98 48 | %inc132 = add nuw nsw i64 %j.11792, 1 49 | %exitcond1847 = icmp eq i64 %j.11792, %2 50 | br i1 %exitcond1847, label %cleanup.loopexit1866.exitStub, label %for.body.98.lr.ph 51 | } 52 | 53 | attributes #0 = { nounwind "polyjit-global-count"="0" "polyjit-jit-candidate" } 54 | 55 | !0 = !{!1, !2, i64 0} 56 | !1 = !{!"", !2, i64 0, !2, i64 4} 57 | !2 = !{!"float", !3, i64 0} 58 | !3 = !{!"omnipotent char", !4, i64 0} 59 | !4 = !{!"Simple C/C++ TBAA"} 60 | !5 = !{!1, !2, i64 4} 61 | -------------------------------------------------------------------------------- /test/pprof/lapack/f2c_csyr2k_for.body.100.lr.ph.pjit.scop.ll: -------------------------------------------------------------------------------- 1 | 2 | ; RUN: opt -load LLVMPolly.so -load LLVMPolyJIT.so -O3 -polli -polli-no-recompilation -polli-analyze -disable-output -stats < %s 2>&1 | FileCheck %s 3 | 4 | ; CHECK: 1 regions require runtime support: 5 | 6 | ; ModuleID = 'csyr2k.c.f2c_csyr2k_for.body.100.lr.ph.pjit.scop.prototype' 7 | target datalayout = "e-m:e-i64:64-f80:128-n8:16:32:64-S128" 8 | target triple = "x86_64-unknown-linux-gnu" 9 | 10 | %struct.complex = type { float, float } 11 | 12 | ; Function Attrs: nounwind 13 | define weak void @f2c_csyr2k_for.body.100.lr.ph.pjit.scop(i64, float* %r77, %struct.complex* %add.ptr6, float* %i109, i64) { 14 | newFuncRoot: 15 | br label %for.body.100.lr.ph 16 | 17 | cleanup.loopexit2037.exitStub: ; preds = %for.inc.133 18 | ret void 19 | 20 | for.body.100.lr.ph: ; preds = %for.inc.133, %newFuncRoot 21 | %indvars.iv2000 = phi i64 [ %indvars.iv.next2001, %for.inc.133 ], [ 2, %newFuncRoot ] 22 | %j.11922 = phi i64 [ %inc134, %for.inc.133 ], [ 1, %newFuncRoot ] 23 | %mul101 = mul nsw i64 %j.11922, %0 24 | br label %for.body.100 25 | 26 | for.body.100: ; preds = %for.body.100, %for.body.100.lr.ph 27 | %i__.11920 = phi i64 [ 1, %for.body.100.lr.ph ], [ %inc131, %for.body.100 ] 28 | %add102 = add nsw i64 %i__.11920, %mul101 29 | %2 = load float, float* %r77, align 4, !tbaa !0 30 | %arrayidx106 = getelementptr inbounds %struct.complex, %struct.complex* %add.ptr6, i64 %add102 31 | %r107 = getelementptr inbounds %struct.complex, %struct.complex* %arrayidx106, i64 0, i32 0 32 | %3 = load float, float* %r107, align 4, !tbaa !0 33 | %mul108 = fmul float %2, %3 34 | %4 = load float, float* %i109, align 4, !tbaa !5 35 | %i111 = getelementptr inbounds %struct.complex, %struct.complex* %arrayidx106, i64 0, i32 1 36 | %5 = load float, float* %i111, align 4, !tbaa !5 37 | %mul112 = fmul float %4, %5 38 | %sub = fsub float %mul108, %mul112 39 | %mul117 = fmul float %2, %5 40 | %mul121 = fmul float %3, %4 41 | %add122 = fadd float %mul121, %mul117 42 | store float %sub, float* %r107, align 4, !tbaa !0 43 | store float %add122, float* %i111, align 4, !tbaa !5 44 | %inc131 = add nuw nsw i64 %i__.11920, 1 45 | %exitcond2002 = icmp eq i64 %inc131, %indvars.iv2000 46 | br i1 %exitcond2002, label %for.inc.133, label %for.body.100 47 | 48 | for.inc.133: ; preds = %for.body.100 49 | %inc134 = add nuw nsw i64 %j.11922, 1 50 | %indvars.iv.next2001 = add nuw i64 %indvars.iv2000, 1 51 | %exitcond2049 = icmp eq i64 %indvars.iv.next2001, %1 52 | br i1 %exitcond2049, label %cleanup.loopexit2037.exitStub, label %for.body.100.lr.ph 53 | } 54 | 55 | attributes #0 = { nounwind "polyjit-global-count"="0" "polyjit-jit-candidate" } 56 | 57 | !0 = !{!1, !2, i64 0} 58 | !1 = !{!"", !2, i64 0, !2, i64 4} 59 | !2 = !{!"float", !3, i64 0} 60 | !3 = !{!"omnipotent char", !4, i64 0} 61 | !4 = !{!"Simple C/C++ TBAA"} 62 | !5 = !{!1, !2, i64 4} 63 | -------------------------------------------------------------------------------- /test/pprof/lapack/f2c_dgemv_for.body.167.lr.ph.pjit.scop.ll: -------------------------------------------------------------------------------- 1 | 2 | ; RUN: opt -load LLVMPolly.so -load LLVMPolyJIT.so -O3 -polli -polli-no-recompilation -polli-analyze -disable-output -stats < %s 2>&1 | FileCheck %s 3 | 4 | ; CHECK: 1 regions require runtime support: 5 | 6 | ; ModuleID = 'dgemv.c.f2c_dgemv_for.body.167.lr.ph.pjit.scop.prototype' 7 | target datalayout = "e-m:e-i64:64-f80:128-n8:16:32:64-S128" 8 | target triple = "x86_64-unknown-linux-gnu" 9 | 10 | ; Function Attrs: nounwind 11 | define weak void @f2c_dgemv_for.body.167.lr.ph.pjit.scop(i64 %ky.0, i64, double* %add.ptr, double* %incdec.ptr, i64, double* %alpha, double* %incdec.ptr1, i64, i64) { 12 | newFuncRoot: 13 | br label %for.body.167.lr.ph 14 | 15 | cleanup.loopexit448.exitStub: ; preds = %for.end.176 16 | ret void 17 | 18 | for.body.167.lr.ph: ; preds = %for.end.176, %newFuncRoot 19 | %jy.0391 = phi i64 [ %add180, %for.end.176 ], [ %ky.0, %newFuncRoot ] 20 | %j.2389 = phi i64 [ %inc182, %for.end.176 ], [ 1, %newFuncRoot ] 21 | %mul168 = mul nsw i64 %j.2389, %0 22 | br label %for.body.167 23 | 24 | for.body.167: ; preds = %for.body.167, %for.body.167.lr.ph 25 | %temp.0387 = phi double [ 0.000000e+00, %for.body.167.lr.ph ], [ %add173, %for.body.167 ] 26 | %i__.6386 = phi i64 [ 1, %for.body.167.lr.ph ], [ %inc175, %for.body.167 ] 27 | %add169 = add nsw i64 %i__.6386, %mul168 28 | %arrayidx170 = getelementptr inbounds double, double* %add.ptr, i64 %add169 29 | %4 = load double, double* %arrayidx170, align 8, !tbaa !0 30 | %arrayidx171 = getelementptr inbounds double, double* %incdec.ptr, i64 %i__.6386 31 | %5 = load double, double* %arrayidx171, align 8, !tbaa !0 32 | %mul172 = fmul double %4, %5 33 | %add173 = fadd double %temp.0387, %mul172 34 | %inc175 = add nuw nsw i64 %i__.6386, 1 35 | %exitcond434 = icmp eq i64 %i__.6386, %1 36 | br i1 %exitcond434, label %for.end.176, label %for.body.167 37 | 38 | for.end.176: ; preds = %for.body.167 39 | %add173.lcssa = phi double [ %add173, %for.body.167 ] 40 | %6 = load double, double* %alpha, align 8, !tbaa !0 41 | %mul177 = fmul double %add173.lcssa, %6 42 | %arrayidx178 = getelementptr inbounds double, double* %incdec.ptr1, i64 %jy.0391 43 | %7 = load double, double* %arrayidx178, align 8, !tbaa !0 44 | %add179 = fadd double %7, %mul177 45 | store double %add179, double* %arrayidx178, align 8, !tbaa !0 46 | %add180 = add nsw i64 %jy.0391, %2 47 | %inc182 = add nuw nsw i64 %j.2389, 1 48 | %exitcond435 = icmp eq i64 %j.2389, %3 49 | br i1 %exitcond435, label %cleanup.loopexit448.exitStub, label %for.body.167.lr.ph 50 | } 51 | 52 | attributes #0 = { nounwind "polyjit-global-count"="0" "polyjit-jit-candidate" } 53 | 54 | !0 = !{!1, !1, i64 0} 55 | !1 = !{!"double", !2, i64 0} 56 | !2 = !{!"omnipotent char", !3, i64 0} 57 | !3 = !{!"Simple C/C++ TBAA"} 58 | -------------------------------------------------------------------------------- /test/pprof/lapack/f2c_dsymm_for.body.280.pjit.scop.ll: -------------------------------------------------------------------------------- 1 | 2 | ; RUN: opt -load LLVMPolly.so -load LLVMPolyJIT.so -O3 -polli -polli-no-recompilation -polli-analyze -disable-output -stats < %s 2>&1 | FileCheck %s 3 | 4 | ; CHECK: 1 regions require runtime support: 5 | 6 | ; ModuleID = 'dsymm.c.f2c_dsymm_for.body.280.pjit.scop.prototype' 7 | target datalayout = "e-m:e-i64:64-f80:128-n8:16:32:64-S128" 8 | target triple = "x86_64-unknown-linux-gnu" 9 | 10 | ; Function Attrs: nounwind 11 | define weak void @f2c_dsymm_for.body.280.pjit.scop(double* %alpha, i64 %mul238, double* %add.ptr, i64, double* %add.ptr3, i64 %mul300, double* %add.ptr6, i64, i64 %indvars.iv767) { 12 | newFuncRoot: 13 | br label %for.body.280 14 | 15 | for.end.309.loopexit784.exitStub: ; preds = %for.inc.307 16 | ret void 17 | 18 | for.body.280: ; preds = %for.inc.307, %newFuncRoot 19 | %k.2664 = phi i64 [ %inc308, %for.inc.307 ], [ 1, %newFuncRoot ] 20 | %2 = load double, double* %alpha, align 8, !tbaa !0 21 | %add284 = add nsw i64 %k.2664, %mul238 22 | %.pn.638.in = getelementptr inbounds double, double* %add.ptr, i64 %add284 23 | %.pn.638 = load double, double* %.pn.638.in, align 8, !tbaa !0 24 | %temp1.0 = fmul double %2, %.pn.638 25 | %mul296 = mul nsw i64 %k.2664, %0 26 | br label %for.body.295 27 | 28 | for.body.295: ; preds = %for.body.295, %for.body.280 29 | %i__.6662 = phi i64 [ 1, %for.body.280 ], [ %inc305, %for.body.295 ] 30 | %add297 = add nsw i64 %i__.6662, %mul296 31 | %arrayidx298 = getelementptr inbounds double, double* %add.ptr3, i64 %add297 32 | %3 = load double, double* %arrayidx298, align 8, !tbaa !0 33 | %mul299 = fmul double %temp1.0, %3 34 | %add301 = add nsw i64 %i__.6662, %mul300 35 | %arrayidx302 = getelementptr inbounds double, double* %add.ptr6, i64 %add301 36 | %4 = load double, double* %arrayidx302, align 8, !tbaa !0 37 | %add303 = fadd double %4, %mul299 38 | store double %add303, double* %arrayidx302, align 8, !tbaa !0 39 | %inc305 = add nuw nsw i64 %i__.6662, 1 40 | %exitcond761 = icmp eq i64 %i__.6662, %1 41 | br i1 %exitcond761, label %for.inc.307, label %for.body.295 42 | 43 | for.inc.307: ; preds = %for.body.295 44 | %inc308 = add nuw nsw i64 %k.2664, 1 45 | %exitcond762 = icmp eq i64 %inc308, %indvars.iv767 46 | br i1 %exitcond762, label %for.end.309.loopexit784.exitStub, label %for.body.280 47 | } 48 | 49 | attributes #0 = { nounwind "polyjit-global-count"="0" "polyjit-jit-candidate" } 50 | 51 | !0 = !{!1, !1, i64 0} 52 | !1 = !{!"double", !2, i64 0} 53 | !2 = !{!"omnipotent char", !3, i64 0} 54 | !3 = !{!"Simple C/C++ TBAA"} 55 | -------------------------------------------------------------------------------- /test/pprof/lapack/f2c_dsyr2k_for.cond.81.preheader.pjit.scop.ll: -------------------------------------------------------------------------------- 1 | 2 | ; RUN: opt -load LLVMPolly.so -load LLVMPolyJIT.so -O3 -polli -polli-no-recompilation -polli-analyze -disable-output -stats < %s 2>&1 | FileCheck %s 3 | 4 | ; CHECK: 1 regions require runtime support: 5 | 6 | ; ModuleID = 'dsyr2k.c.f2c_dsyr2k_for.cond.81.preheader.pjit.scop.prototype' 7 | target datalayout = "e-m:e-i64:64-f80:128-n8:16:32:64-S128" 8 | target triple = "x86_64-unknown-linux-gnu" 9 | 10 | ; Function Attrs: nounwind 11 | define weak void @f2c_dsyr2k_for.cond.81.preheader.pjit.scop(i1 %cmp72.788, i64, i64, double* %beta, double* %add.ptr6) { 12 | newFuncRoot: 13 | br label %for.cond.81.preheader 14 | 15 | cleanup.exitStub: ; preds = %cleanup.loopexit921, %for.cond.81.preheader 16 | ret void 17 | 18 | for.cond.81.preheader: ; preds = %newFuncRoot 19 | br i1 %cmp72.788, label %cleanup.exitStub, label %for.body.86.lr.ph.preheader 20 | 21 | for.body.86.lr.ph.preheader: ; preds = %for.cond.81.preheader 22 | %2 = add i64 %0, 2 23 | br label %for.body.86.lr.ph 24 | 25 | for.body.86.lr.ph: ; preds = %for.inc.97, %for.body.86.lr.ph.preheader 26 | %indvars.iv866 = phi i64 [ %indvars.iv.next867, %for.inc.97 ], [ 2, %for.body.86.lr.ph.preheader ] 27 | %j.1794 = phi i64 [ %inc98, %for.inc.97 ], [ 1, %for.body.86.lr.ph.preheader ] 28 | %mul87 = mul nsw i64 %j.1794, %1 29 | br label %for.body.86 30 | 31 | for.body.86: ; preds = %for.body.86, %for.body.86.lr.ph 32 | %i__.1792 = phi i64 [ 1, %for.body.86.lr.ph ], [ %inc95, %for.body.86 ] 33 | %3 = load double, double* %beta, align 8, !tbaa !0 34 | %add88 = add nsw i64 %i__.1792, %mul87 35 | %arrayidx89 = getelementptr inbounds double, double* %add.ptr6, i64 %add88 36 | %4 = load double, double* %arrayidx89, align 8, !tbaa !0 37 | %mul90 = fmul double %3, %4 38 | store double %mul90, double* %arrayidx89, align 8, !tbaa !0 39 | %inc95 = add nuw nsw i64 %i__.1792, 1 40 | %exitcond868 = icmp eq i64 %inc95, %indvars.iv866 41 | br i1 %exitcond868, label %for.inc.97, label %for.body.86 42 | 43 | for.inc.97: ; preds = %for.body.86 44 | %inc98 = add nuw nsw i64 %j.1794, 1 45 | %indvars.iv.next867 = add nuw i64 %indvars.iv866, 1 46 | %exitcond931 = icmp eq i64 %indvars.iv.next867, %2 47 | br i1 %exitcond931, label %cleanup.loopexit921, label %for.body.86.lr.ph 48 | 49 | cleanup.loopexit921: ; preds = %for.inc.97 50 | br label %cleanup.exitStub 51 | } 52 | 53 | attributes #0 = { nounwind "polyjit-global-count"="0" "polyjit-jit-candidate" } 54 | 55 | !0 = !{!1, !1, i64 0} 56 | !1 = !{!"double", !2, i64 0} 57 | !2 = !{!"omnipotent char", !3, i64 0} 58 | !3 = !{!"Simple C/C++ TBAA"} 59 | -------------------------------------------------------------------------------- /test/pprof/lapack/f2c_dsyrk_for.cond.69.preheader.pjit.scop.ll: -------------------------------------------------------------------------------- 1 | 2 | ; RUN: opt -load LLVMPolly.so -load LLVMPolyJIT.so -O3 -polli -polli-no-recompilation -polli-analyze -disable-output -stats < %s 2>&1 | FileCheck %s 3 | 4 | ; CHECK: 1 regions require runtime support: 5 | 6 | ; ModuleID = 'dsyrk.c.f2c_dsyrk_for.cond.69.preheader.pjit.scop.prototype' 7 | target datalayout = "e-m:e-i64:64-f80:128-n8:16:32:64-S128" 8 | target triple = "x86_64-unknown-linux-gnu" 9 | 10 | ; Function Attrs: nounwind 11 | define weak void @f2c_dsyrk_for.cond.69.preheader.pjit.scop(i1 %cmp60.645, i64, i64, double* %beta, double* %add.ptr3) { 12 | newFuncRoot: 13 | br label %for.cond.69.preheader 14 | 15 | cleanup.exitStub: ; preds = %cleanup.loopexit812, %for.cond.69.preheader 16 | ret void 17 | 18 | for.cond.69.preheader: ; preds = %newFuncRoot 19 | br i1 %cmp60.645, label %cleanup.exitStub, label %for.body.74.lr.ph.preheader 20 | 21 | for.body.74.lr.ph.preheader: ; preds = %for.cond.69.preheader 22 | %2 = add i64 %0, 2 23 | br label %for.body.74.lr.ph 24 | 25 | for.body.74.lr.ph: ; preds = %for.inc.85, %for.body.74.lr.ph.preheader 26 | %indvars.iv746 = phi i64 [ %indvars.iv.next747, %for.inc.85 ], [ 2, %for.body.74.lr.ph.preheader ] 27 | %j.1651 = phi i64 [ %inc86, %for.inc.85 ], [ 1, %for.body.74.lr.ph.preheader ] 28 | %mul75 = mul nsw i64 %j.1651, %1 29 | br label %for.body.74 30 | 31 | for.body.74: ; preds = %for.body.74, %for.body.74.lr.ph 32 | %i__.1649 = phi i64 [ 1, %for.body.74.lr.ph ], [ %inc83, %for.body.74 ] 33 | %3 = load double, double* %beta, align 8, !tbaa !0 34 | %add76 = add nsw i64 %i__.1649, %mul75 35 | %arrayidx77 = getelementptr inbounds double, double* %add.ptr3, i64 %add76 36 | %4 = load double, double* %arrayidx77, align 8, !tbaa !0 37 | %mul78 = fmul double %3, %4 38 | store double %mul78, double* %arrayidx77, align 8, !tbaa !0 39 | %inc83 = add nuw nsw i64 %i__.1649, 1 40 | %exitcond748 = icmp eq i64 %inc83, %indvars.iv746 41 | br i1 %exitcond748, label %for.inc.85, label %for.body.74 42 | 43 | for.inc.85: ; preds = %for.body.74 44 | %inc86 = add nuw nsw i64 %j.1651, 1 45 | %indvars.iv.next747 = add nuw i64 %indvars.iv746, 1 46 | %exitcond823 = icmp eq i64 %indvars.iv.next747, %2 47 | br i1 %exitcond823, label %cleanup.loopexit812, label %for.body.74.lr.ph 48 | 49 | cleanup.loopexit812: ; preds = %for.inc.85 50 | br label %cleanup.exitStub 51 | } 52 | 53 | attributes #0 = { nounwind "polyjit-global-count"="0" "polyjit-jit-candidate" } 54 | 55 | !0 = !{!1, !1, i64 0} 56 | !1 = !{!"double", !2, i64 0} 57 | !2 = !{!"omnipotent char", !3, i64 0} 58 | !3 = !{!"Simple C/C++ TBAA"} 59 | -------------------------------------------------------------------------------- /test/pprof/lapack/f2c_sgemv_for.body.167.lr.ph.pjit.scop.ll: -------------------------------------------------------------------------------- 1 | 2 | ; RUN: opt -load LLVMPolly.so -load LLVMPolyJIT.so -O3 -polli -polli-no-recompilation -polli-analyze -disable-output -stats < %s 2>&1 | FileCheck %s 3 | 4 | ; CHECK: 1 regions require runtime support: 5 | 6 | ; ModuleID = 'sgemv.c.f2c_sgemv_for.body.167.lr.ph.pjit.scop.prototype' 7 | target datalayout = "e-m:e-i64:64-f80:128-n8:16:32:64-S128" 8 | target triple = "x86_64-unknown-linux-gnu" 9 | 10 | ; Function Attrs: nounwind 11 | define weak void @f2c_sgemv_for.body.167.lr.ph.pjit.scop(i64 %ky.0, i64, float* %add.ptr, float* %incdec.ptr, i64, float* %alpha, float* %incdec.ptr1, i64, i64) { 12 | newFuncRoot: 13 | br label %for.body.167.lr.ph 14 | 15 | cleanup.loopexit448.exitStub: ; preds = %for.end.176 16 | ret void 17 | 18 | for.body.167.lr.ph: ; preds = %for.end.176, %newFuncRoot 19 | %jy.0391 = phi i64 [ %add180, %for.end.176 ], [ %ky.0, %newFuncRoot ] 20 | %j.2389 = phi i64 [ %inc182, %for.end.176 ], [ 1, %newFuncRoot ] 21 | %mul168 = mul nsw i64 %j.2389, %0 22 | br label %for.body.167 23 | 24 | for.body.167: ; preds = %for.body.167, %for.body.167.lr.ph 25 | %temp.0387 = phi float [ 0.000000e+00, %for.body.167.lr.ph ], [ %add173, %for.body.167 ] 26 | %i__.6386 = phi i64 [ 1, %for.body.167.lr.ph ], [ %inc175, %for.body.167 ] 27 | %add169 = add nsw i64 %i__.6386, %mul168 28 | %arrayidx170 = getelementptr inbounds float, float* %add.ptr, i64 %add169 29 | %4 = load float, float* %arrayidx170, align 4, !tbaa !0 30 | %arrayidx171 = getelementptr inbounds float, float* %incdec.ptr, i64 %i__.6386 31 | %5 = load float, float* %arrayidx171, align 4, !tbaa !0 32 | %mul172 = fmul float %4, %5 33 | %add173 = fadd float %temp.0387, %mul172 34 | %inc175 = add nuw nsw i64 %i__.6386, 1 35 | %exitcond434 = icmp eq i64 %i__.6386, %1 36 | br i1 %exitcond434, label %for.end.176, label %for.body.167 37 | 38 | for.end.176: ; preds = %for.body.167 39 | %add173.lcssa = phi float [ %add173, %for.body.167 ] 40 | %6 = load float, float* %alpha, align 4, !tbaa !0 41 | %mul177 = fmul float %add173.lcssa, %6 42 | %arrayidx178 = getelementptr inbounds float, float* %incdec.ptr1, i64 %jy.0391 43 | %7 = load float, float* %arrayidx178, align 4, !tbaa !0 44 | %add179 = fadd float %7, %mul177 45 | store float %add179, float* %arrayidx178, align 4, !tbaa !0 46 | %add180 = add nsw i64 %jy.0391, %2 47 | %inc182 = add nuw nsw i64 %j.2389, 1 48 | %exitcond435 = icmp eq i64 %j.2389, %3 49 | br i1 %exitcond435, label %cleanup.loopexit448.exitStub, label %for.body.167.lr.ph 50 | } 51 | 52 | attributes #0 = { nounwind "polyjit-global-count"="0" "polyjit-jit-candidate" } 53 | 54 | !0 = !{!1, !1, i64 0} 55 | !1 = !{!"float", !2, i64 0} 56 | !2 = !{!"omnipotent char", !3, i64 0} 57 | !3 = !{!"Simple C/C++ TBAA"} 58 | -------------------------------------------------------------------------------- /test/pprof/lapack/f2c_ssymm_for.body.280.pjit.scop.ll: -------------------------------------------------------------------------------- 1 | 2 | ; RUN: opt -load LLVMPolly.so -load LLVMPolyJIT.so -O3 -polli -polli-no-recompilation -polli-analyze -disable-output -stats < %s 2>&1 | FileCheck %s 3 | 4 | ; CHECK: 1 regions require runtime support: 5 | 6 | ; ModuleID = 'ssymm.c.f2c_ssymm_for.body.280.pjit.scop.prototype' 7 | target datalayout = "e-m:e-i64:64-f80:128-n8:16:32:64-S128" 8 | target triple = "x86_64-unknown-linux-gnu" 9 | 10 | ; Function Attrs: nounwind 11 | define weak void @f2c_ssymm_for.body.280.pjit.scop(float* %alpha, i64 %mul238, float* %add.ptr, i64, float* %add.ptr3, i64 %mul300, float* %add.ptr6, i64, i64 %indvars.iv767) { 12 | newFuncRoot: 13 | br label %for.body.280 14 | 15 | for.end.309.loopexit784.exitStub: ; preds = %for.inc.307 16 | ret void 17 | 18 | for.body.280: ; preds = %for.inc.307, %newFuncRoot 19 | %k.2664 = phi i64 [ %inc308, %for.inc.307 ], [ 1, %newFuncRoot ] 20 | %2 = load float, float* %alpha, align 4, !tbaa !0 21 | %add284 = add nsw i64 %k.2664, %mul238 22 | %.pn.638.in = getelementptr inbounds float, float* %add.ptr, i64 %add284 23 | %.pn.638 = load float, float* %.pn.638.in, align 4, !tbaa !0 24 | %temp1.0 = fmul float %2, %.pn.638 25 | %mul296 = mul nsw i64 %k.2664, %0 26 | br label %for.body.295 27 | 28 | for.body.295: ; preds = %for.body.295, %for.body.280 29 | %i__.6662 = phi i64 [ 1, %for.body.280 ], [ %inc305, %for.body.295 ] 30 | %add297 = add nsw i64 %i__.6662, %mul296 31 | %arrayidx298 = getelementptr inbounds float, float* %add.ptr3, i64 %add297 32 | %3 = load float, float* %arrayidx298, align 4, !tbaa !0 33 | %mul299 = fmul float %temp1.0, %3 34 | %add301 = add nsw i64 %i__.6662, %mul300 35 | %arrayidx302 = getelementptr inbounds float, float* %add.ptr6, i64 %add301 36 | %4 = load float, float* %arrayidx302, align 4, !tbaa !0 37 | %add303 = fadd float %4, %mul299 38 | store float %add303, float* %arrayidx302, align 4, !tbaa !0 39 | %inc305 = add nuw nsw i64 %i__.6662, 1 40 | %exitcond761 = icmp eq i64 %i__.6662, %1 41 | br i1 %exitcond761, label %for.inc.307, label %for.body.295 42 | 43 | for.inc.307: ; preds = %for.body.295 44 | %inc308 = add nuw nsw i64 %k.2664, 1 45 | %exitcond762 = icmp eq i64 %inc308, %indvars.iv767 46 | br i1 %exitcond762, label %for.end.309.loopexit784.exitStub, label %for.body.280 47 | } 48 | 49 | attributes #0 = { nounwind "polyjit-global-count"="0" "polyjit-jit-candidate" } 50 | 51 | !0 = !{!1, !1, i64 0} 52 | !1 = !{!"float", !2, i64 0} 53 | !2 = !{!"omnipotent char", !3, i64 0} 54 | !3 = !{!"Simple C/C++ TBAA"} 55 | -------------------------------------------------------------------------------- /test/pprof/lapack/f2c_ssyr2k_for.cond.81.preheader.pjit.scop.ll: -------------------------------------------------------------------------------- 1 | 2 | ; RUN: opt -load LLVMPolly.so -load LLVMPolyJIT.so -O3 -polli -polli-no-recompilation -polli-analyze -disable-output -stats < %s 2>&1 | FileCheck %s 3 | 4 | ; CHECK: 1 regions require runtime support: 5 | 6 | ; ModuleID = 'ssyr2k.c.f2c_ssyr2k_for.cond.81.preheader.pjit.scop.prototype' 7 | target datalayout = "e-m:e-i64:64-f80:128-n8:16:32:64-S128" 8 | target triple = "x86_64-unknown-linux-gnu" 9 | 10 | ; Function Attrs: nounwind 11 | define weak void @f2c_ssyr2k_for.cond.81.preheader.pjit.scop(i1 %cmp72.788, i64, i64, float* %beta, float* %add.ptr6) { 12 | newFuncRoot: 13 | br label %for.cond.81.preheader 14 | 15 | cleanup.exitStub: ; preds = %cleanup.loopexit921, %for.cond.81.preheader 16 | ret void 17 | 18 | for.cond.81.preheader: ; preds = %newFuncRoot 19 | br i1 %cmp72.788, label %cleanup.exitStub, label %for.body.86.lr.ph.preheader 20 | 21 | for.body.86.lr.ph.preheader: ; preds = %for.cond.81.preheader 22 | %2 = add i64 %0, 2 23 | br label %for.body.86.lr.ph 24 | 25 | for.body.86.lr.ph: ; preds = %for.inc.97, %for.body.86.lr.ph.preheader 26 | %indvars.iv866 = phi i64 [ %indvars.iv.next867, %for.inc.97 ], [ 2, %for.body.86.lr.ph.preheader ] 27 | %j.1794 = phi i64 [ %inc98, %for.inc.97 ], [ 1, %for.body.86.lr.ph.preheader ] 28 | %mul87 = mul nsw i64 %j.1794, %1 29 | br label %for.body.86 30 | 31 | for.body.86: ; preds = %for.body.86, %for.body.86.lr.ph 32 | %i__.1792 = phi i64 [ 1, %for.body.86.lr.ph ], [ %inc95, %for.body.86 ] 33 | %3 = load float, float* %beta, align 4, !tbaa !0 34 | %add88 = add nsw i64 %i__.1792, %mul87 35 | %arrayidx89 = getelementptr inbounds float, float* %add.ptr6, i64 %add88 36 | %4 = load float, float* %arrayidx89, align 4, !tbaa !0 37 | %mul90 = fmul float %3, %4 38 | store float %mul90, float* %arrayidx89, align 4, !tbaa !0 39 | %inc95 = add nuw nsw i64 %i__.1792, 1 40 | %exitcond868 = icmp eq i64 %inc95, %indvars.iv866 41 | br i1 %exitcond868, label %for.inc.97, label %for.body.86 42 | 43 | for.inc.97: ; preds = %for.body.86 44 | %inc98 = add nuw nsw i64 %j.1794, 1 45 | %indvars.iv.next867 = add nuw i64 %indvars.iv866, 1 46 | %exitcond931 = icmp eq i64 %indvars.iv.next867, %2 47 | br i1 %exitcond931, label %cleanup.loopexit921, label %for.body.86.lr.ph 48 | 49 | cleanup.loopexit921: ; preds = %for.inc.97 50 | br label %cleanup.exitStub 51 | } 52 | 53 | attributes #0 = { nounwind "polyjit-global-count"="0" "polyjit-jit-candidate" } 54 | 55 | !0 = !{!1, !1, i64 0} 56 | !1 = !{!"float", !2, i64 0} 57 | !2 = !{!"omnipotent char", !3, i64 0} 58 | !3 = !{!"Simple C/C++ TBAA"} 59 | -------------------------------------------------------------------------------- /test/pprof/lapack/f2c_ssyrk_for.cond.69.preheader.pjit.scop.ll: -------------------------------------------------------------------------------- 1 | 2 | ; RUN: opt -load LLVMPolly.so -load LLVMPolyJIT.so -O3 -polli -polli-no-recompilation -polli-analyze -disable-output -stats < %s 2>&1 | FileCheck %s 3 | 4 | ; CHECK: 1 regions require runtime support: 5 | 6 | ; ModuleID = 'ssyrk.c.f2c_ssyrk_for.cond.69.preheader.pjit.scop.prototype' 7 | target datalayout = "e-m:e-i64:64-f80:128-n8:16:32:64-S128" 8 | target triple = "x86_64-unknown-linux-gnu" 9 | 10 | ; Function Attrs: nounwind 11 | define weak void @f2c_ssyrk_for.cond.69.preheader.pjit.scop(i1 %cmp60.645, i64, i64, float* %beta, float* %add.ptr3) { 12 | newFuncRoot: 13 | br label %for.cond.69.preheader 14 | 15 | cleanup.exitStub: ; preds = %cleanup.loopexit812, %for.cond.69.preheader 16 | ret void 17 | 18 | for.cond.69.preheader: ; preds = %newFuncRoot 19 | br i1 %cmp60.645, label %cleanup.exitStub, label %for.body.74.lr.ph.preheader 20 | 21 | for.body.74.lr.ph.preheader: ; preds = %for.cond.69.preheader 22 | %2 = add i64 %0, 2 23 | br label %for.body.74.lr.ph 24 | 25 | for.body.74.lr.ph: ; preds = %for.inc.85, %for.body.74.lr.ph.preheader 26 | %indvars.iv746 = phi i64 [ %indvars.iv.next747, %for.inc.85 ], [ 2, %for.body.74.lr.ph.preheader ] 27 | %j.1651 = phi i64 [ %inc86, %for.inc.85 ], [ 1, %for.body.74.lr.ph.preheader ] 28 | %mul75 = mul nsw i64 %j.1651, %1 29 | br label %for.body.74 30 | 31 | for.body.74: ; preds = %for.body.74, %for.body.74.lr.ph 32 | %i__.1649 = phi i64 [ 1, %for.body.74.lr.ph ], [ %inc83, %for.body.74 ] 33 | %3 = load float, float* %beta, align 4, !tbaa !0 34 | %add76 = add nsw i64 %i__.1649, %mul75 35 | %arrayidx77 = getelementptr inbounds float, float* %add.ptr3, i64 %add76 36 | %4 = load float, float* %arrayidx77, align 4, !tbaa !0 37 | %mul78 = fmul float %3, %4 38 | store float %mul78, float* %arrayidx77, align 4, !tbaa !0 39 | %inc83 = add nuw nsw i64 %i__.1649, 1 40 | %exitcond748 = icmp eq i64 %inc83, %indvars.iv746 41 | br i1 %exitcond748, label %for.inc.85, label %for.body.74 42 | 43 | for.inc.85: ; preds = %for.body.74 44 | %inc86 = add nuw nsw i64 %j.1651, 1 45 | %indvars.iv.next747 = add nuw i64 %indvars.iv746, 1 46 | %exitcond823 = icmp eq i64 %indvars.iv.next747, %2 47 | br i1 %exitcond823, label %cleanup.loopexit812, label %for.body.74.lr.ph 48 | 49 | cleanup.loopexit812: ; preds = %for.inc.85 50 | br label %cleanup.exitStub 51 | } 52 | 53 | attributes #0 = { nounwind "polyjit-global-count"="0" "polyjit-jit-candidate" } 54 | 55 | !0 = !{!1, !1, i64 0} 56 | !1 = !{!"float", !2, i64 0} 57 | !2 = !{!"omnipotent char", !3, i64 0} 58 | !3 = !{!"Simple C/C++ TBAA"} 59 | -------------------------------------------------------------------------------- /test/pprof/lapack/f2c_zgemm_for.body.113.lr.ph.pjit.scop.ll: -------------------------------------------------------------------------------- 1 | 2 | ; RUN: opt -load LLVMPolly.so -load LLVMPolyJIT.so -O3 -polli -polli-no-recompilation -polli-analyze -disable-output -stats < %s 2>&1 | FileCheck %s 3 | 4 | ; CHECK: 1 regions require runtime support: 5 | 6 | ; ModuleID = 'zgemm.c.f2c_zgemm_for.body.113.lr.ph.pjit.scop.prototype' 7 | target datalayout = "e-m:e-i64:64-f80:128-n8:16:32:64-S128" 8 | target triple = "x86_64-unknown-linux-gnu" 9 | 10 | %struct.doublecomplex = type { double, double } 11 | 12 | ; Function Attrs: nounwind 13 | define weak void @f2c_zgemm_for.body.113.lr.ph.pjit.scop(i64, double* %r90, %struct.doublecomplex* %add.ptr6, double* %i122, i64, i64) { 14 | newFuncRoot: 15 | br label %for.body.113.lr.ph 16 | 17 | cleanup.loopexit2648.exitStub: ; preds = %for.inc.146 18 | ret void 19 | 20 | for.body.113.lr.ph: ; preds = %for.inc.146, %newFuncRoot 21 | %j.12483 = phi i64 [ %inc147, %for.inc.146 ], [ 1, %newFuncRoot ] 22 | %mul114 = mul nsw i64 %j.12483, %0 23 | br label %for.body.113 24 | 25 | for.body.113: ; preds = %for.body.113, %for.body.113.lr.ph 26 | %i__.12481 = phi i64 [ 1, %for.body.113.lr.ph ], [ %inc144, %for.body.113 ] 27 | %add115 = add nsw i64 %i__.12481, %mul114 28 | %3 = load double, double* %r90, align 8, !tbaa !0 29 | %arrayidx119 = getelementptr inbounds %struct.doublecomplex, %struct.doublecomplex* %add.ptr6, i64 %add115 30 | %r120 = getelementptr inbounds %struct.doublecomplex, %struct.doublecomplex* %arrayidx119, i64 0, i32 0 31 | %4 = load double, double* %r120, align 8, !tbaa !0 32 | %mul121 = fmul double %3, %4 33 | %5 = load double, double* %i122, align 8, !tbaa !5 34 | %i124 = getelementptr inbounds %struct.doublecomplex, %struct.doublecomplex* %arrayidx119, i64 0, i32 1 35 | %6 = load double, double* %i124, align 8, !tbaa !5 36 | %mul125 = fmul double %5, %6 37 | %sub = fsub double %mul121, %mul125 38 | %mul130 = fmul double %3, %6 39 | %mul134 = fmul double %4, %5 40 | %add135 = fadd double %mul134, %mul130 41 | store double %sub, double* %r120, align 8, !tbaa !0 42 | store double %add135, double* %i124, align 8, !tbaa !5 43 | %inc144 = add nuw nsw i64 %i__.12481, 1 44 | %exitcond2613 = icmp eq i64 %i__.12481, %1 45 | br i1 %exitcond2613, label %for.inc.146, label %for.body.113 46 | 47 | for.inc.146: ; preds = %for.body.113 48 | %inc147 = add nuw nsw i64 %j.12483, 1 49 | %exitcond2614 = icmp eq i64 %j.12483, %2 50 | br i1 %exitcond2614, label %cleanup.loopexit2648.exitStub, label %for.body.113.lr.ph 51 | } 52 | 53 | attributes #0 = { nounwind "polyjit-global-count"="0" "polyjit-jit-candidate" } 54 | 55 | !0 = !{!1, !2, i64 0} 56 | !1 = !{!"", !2, i64 0, !2, i64 8} 57 | !2 = !{!"double", !3, i64 0} 58 | !3 = !{!"omnipotent char", !4, i64 0} 59 | !4 = !{!"Simple C/C++ TBAA"} 60 | !5 = !{!1, !2, i64 8} 61 | -------------------------------------------------------------------------------- /test/pprof/lapack/f2c_zhemm_for.body.98.lr.ph.pjit.scop.ll: -------------------------------------------------------------------------------- 1 | 2 | ; RUN: opt -load LLVMPolly.so -load LLVMPolyJIT.so -O3 -polli -polli-no-recompilation -polli-analyze -disable-output -stats < %s 2>&1 | FileCheck %s 3 | 4 | ; CHECK: 1 regions require runtime support: 5 | 6 | ; ModuleID = 'zhemm.c.f2c_zhemm_for.body.98.lr.ph.pjit.scop.prototype' 7 | target datalayout = "e-m:e-i64:64-f80:128-n8:16:32:64-S128" 8 | target triple = "x86_64-unknown-linux-gnu" 9 | 10 | %struct.doublecomplex = type { double, double } 11 | 12 | ; Function Attrs: nounwind 13 | define weak void @f2c_zhemm_for.body.98.lr.ph.pjit.scop(i64, double* %r75, %struct.doublecomplex* %add.ptr6, double* %i107, i64, i64) { 14 | newFuncRoot: 15 | br label %for.body.98.lr.ph 16 | 17 | cleanup.loopexit1698.exitStub: ; preds = %for.inc.131 18 | ret void 19 | 20 | for.body.98.lr.ph: ; preds = %for.inc.131, %newFuncRoot 21 | %j.11631 = phi i64 [ %inc132, %for.inc.131 ], [ 1, %newFuncRoot ] 22 | %mul99 = mul nsw i64 %j.11631, %0 23 | br label %for.body.98 24 | 25 | for.body.98: ; preds = %for.body.98, %for.body.98.lr.ph 26 | %i__.11629 = phi i64 [ 1, %for.body.98.lr.ph ], [ %inc129, %for.body.98 ] 27 | %add100 = add nsw i64 %i__.11629, %mul99 28 | %3 = load double, double* %r75, align 8, !tbaa !0 29 | %arrayidx104 = getelementptr inbounds %struct.doublecomplex, %struct.doublecomplex* %add.ptr6, i64 %add100 30 | %r105 = getelementptr inbounds %struct.doublecomplex, %struct.doublecomplex* %arrayidx104, i64 0, i32 0 31 | %4 = load double, double* %r105, align 8, !tbaa !0 32 | %mul106 = fmul double %3, %4 33 | %5 = load double, double* %i107, align 8, !tbaa !5 34 | %i109 = getelementptr inbounds %struct.doublecomplex, %struct.doublecomplex* %arrayidx104, i64 0, i32 1 35 | %6 = load double, double* %i109, align 8, !tbaa !5 36 | %mul110 = fmul double %5, %6 37 | %sub = fsub double %mul106, %mul110 38 | %mul115 = fmul double %3, %6 39 | %mul119 = fmul double %4, %5 40 | %add120 = fadd double %mul119, %mul115 41 | store double %sub, double* %r105, align 8, !tbaa !0 42 | store double %add120, double* %i109, align 8, !tbaa !5 43 | %inc129 = add nuw nsw i64 %i__.11629, 1 44 | %exitcond1682 = icmp eq i64 %i__.11629, %1 45 | br i1 %exitcond1682, label %for.inc.131, label %for.body.98 46 | 47 | for.inc.131: ; preds = %for.body.98 48 | %inc132 = add nuw nsw i64 %j.11631, 1 49 | %exitcond1683 = icmp eq i64 %j.11631, %2 50 | br i1 %exitcond1683, label %cleanup.loopexit1698.exitStub, label %for.body.98.lr.ph 51 | } 52 | 53 | attributes #0 = { nounwind "polyjit-global-count"="0" "polyjit-jit-candidate" } 54 | 55 | !0 = !{!1, !2, i64 0} 56 | !1 = !{!"", !2, i64 0, !2, i64 8} 57 | !2 = !{!"double", !3, i64 0} 58 | !3 = !{!"omnipotent char", !4, i64 0} 59 | !4 = !{!"Simple C/C++ TBAA"} 60 | !5 = !{!1, !2, i64 8} 61 | -------------------------------------------------------------------------------- /test/pprof/lapack/f2c_zsymm_for.body.98.lr.ph.pjit.scop.ll: -------------------------------------------------------------------------------- 1 | 2 | ; RUN: opt -load LLVMPolly.so -load LLVMPolyJIT.so -O3 -polli -polli-no-recompilation -polli-analyze -disable-output -stats < %s 2>&1 | FileCheck %s 3 | 4 | ; CHECK: 1 regions require runtime support: 5 | 6 | ; ModuleID = 'zsymm.c.f2c_zsymm_for.body.98.lr.ph.pjit.scop.prototype' 7 | target datalayout = "e-m:e-i64:64-f80:128-n8:16:32:64-S128" 8 | target triple = "x86_64-unknown-linux-gnu" 9 | 10 | %struct.doublecomplex = type { double, double } 11 | 12 | ; Function Attrs: nounwind 13 | define weak void @f2c_zsymm_for.body.98.lr.ph.pjit.scop(i64, double* %r75, %struct.doublecomplex* %add.ptr6, double* %i107, i64, i64) { 14 | newFuncRoot: 15 | br label %for.body.98.lr.ph 16 | 17 | cleanup.loopexit1866.exitStub: ; preds = %for.inc.131 18 | ret void 19 | 20 | for.body.98.lr.ph: ; preds = %for.inc.131, %newFuncRoot 21 | %j.11792 = phi i64 [ %inc132, %for.inc.131 ], [ 1, %newFuncRoot ] 22 | %mul99 = mul nsw i64 %j.11792, %0 23 | br label %for.body.98 24 | 25 | for.body.98: ; preds = %for.body.98, %for.body.98.lr.ph 26 | %i__.11790 = phi i64 [ 1, %for.body.98.lr.ph ], [ %inc129, %for.body.98 ] 27 | %add100 = add nsw i64 %i__.11790, %mul99 28 | %3 = load double, double* %r75, align 8, !tbaa !0 29 | %arrayidx104 = getelementptr inbounds %struct.doublecomplex, %struct.doublecomplex* %add.ptr6, i64 %add100 30 | %r105 = getelementptr inbounds %struct.doublecomplex, %struct.doublecomplex* %arrayidx104, i64 0, i32 0 31 | %4 = load double, double* %r105, align 8, !tbaa !0 32 | %mul106 = fmul double %3, %4 33 | %5 = load double, double* %i107, align 8, !tbaa !5 34 | %i109 = getelementptr inbounds %struct.doublecomplex, %struct.doublecomplex* %arrayidx104, i64 0, i32 1 35 | %6 = load double, double* %i109, align 8, !tbaa !5 36 | %mul110 = fmul double %5, %6 37 | %sub = fsub double %mul106, %mul110 38 | %mul115 = fmul double %3, %6 39 | %mul119 = fmul double %4, %5 40 | %add120 = fadd double %mul119, %mul115 41 | store double %sub, double* %r105, align 8, !tbaa !0 42 | store double %add120, double* %i109, align 8, !tbaa !5 43 | %inc129 = add nuw nsw i64 %i__.11790, 1 44 | %exitcond1846 = icmp eq i64 %i__.11790, %1 45 | br i1 %exitcond1846, label %for.inc.131, label %for.body.98 46 | 47 | for.inc.131: ; preds = %for.body.98 48 | %inc132 = add nuw nsw i64 %j.11792, 1 49 | %exitcond1847 = icmp eq i64 %j.11792, %2 50 | br i1 %exitcond1847, label %cleanup.loopexit1866.exitStub, label %for.body.98.lr.ph 51 | } 52 | 53 | attributes #0 = { nounwind "polyjit-global-count"="0" "polyjit-jit-candidate" } 54 | 55 | !0 = !{!1, !2, i64 0} 56 | !1 = !{!"", !2, i64 0, !2, i64 8} 57 | !2 = !{!"double", !3, i64 0} 58 | !3 = !{!"omnipotent char", !4, i64 0} 59 | !4 = !{!"Simple C/C++ TBAA"} 60 | !5 = !{!1, !2, i64 8} 61 | -------------------------------------------------------------------------------- /test/pprof/lapack/schk3__for.body.332.lr.ph.pjit.scop.ll: -------------------------------------------------------------------------------- 1 | 2 | ; RUN: opt -load LLVMPolly.so -load LLVMPolyJIT.so -O3 -polli -polli-no-recompilation -polli-analyze -disable-output -stats < %s 2>&1 | FileCheck %s 3 | 4 | ; CHECK: 1 regions require runtime support: 5 | 6 | ; ModuleID = 'sblat3.c.schk3__for.body.332.lr.ph.pjit.scop.prototype' 7 | target datalayout = "e-m:e-i64:64-f80:128-n8:16:32:64-S128" 8 | target triple = "x86_64-unknown-linux-gnu" 9 | 10 | ; Function Attrs: nounwind 11 | define weak void @schk3__for.body.332.lr.ph.pjit.scop(i64, i64, float* %incdec.ptr5, float* %add.ptr, float* %add.ptr8, float, i64, i64) { 12 | newFuncRoot: 13 | br label %for.body.332.lr.ph 14 | 15 | for.cond.325.for.end.353_crit_edge.loopexit.exitStub: ; preds = %for.inc.351 16 | ret void 17 | 18 | for.body.332.lr.ph: ; preds = %for.inc.351, %newFuncRoot 19 | %j.1650 = phi i64 [ %inc352, %for.inc.351 ], [ 1, %newFuncRoot ] 20 | %sub333 = add nsw i64 %j.1650, -1 21 | %mul334 = mul nsw i64 %sub333, %0 22 | %mul337 = mul nsw i64 %j.1650, %1 23 | %mul345 = mul nsw i64 %sub333, %0 24 | br label %for.body.332 25 | 26 | for.body.332: ; preds = %for.body.332, %for.body.332.lr.ph 27 | %inc349671 = phi i64 [ 1, %for.body.332.lr.ph ], [ %inc349, %for.body.332 ] 28 | %add335 = add nsw i64 %inc349671, %mul334 29 | %arrayidx336 = getelementptr inbounds float, float* %incdec.ptr5, i64 %add335 30 | %5 = bitcast float* %arrayidx336 to i32* 31 | %6 = load i32, i32* %5, align 4, !tbaa !0 32 | %add338 = add nsw i64 %inc349671, %mul337 33 | %arrayidx339 = getelementptr inbounds float, float* %add.ptr, i64 %add338 34 | %7 = bitcast float* %arrayidx339 to i32* 35 | store i32 %6, i32* %7, align 4, !tbaa !0 36 | %add341 = add nsw i64 %inc349671, %mul337 37 | %arrayidx342 = getelementptr inbounds float, float* %add.ptr8, i64 %add341 38 | %8 = load float, float* %arrayidx342, align 4, !tbaa !0 39 | %mul343 = fmul float %2, %8 40 | %add346 = add nsw i64 %inc349671, %mul345 41 | %arrayidx347 = getelementptr inbounds float, float* %incdec.ptr5, i64 %add346 42 | store float %mul343, float* %arrayidx347, align 4, !tbaa !0 43 | %inc349 = add nuw nsw i64 %inc349671, 1 44 | %exitcond = icmp eq i64 %inc349, %3 45 | br i1 %exitcond, label %for.inc.351, label %for.body.332 46 | 47 | for.inc.351: ; preds = %for.body.332 48 | %inc352 = add nuw nsw i64 %j.1650, 1 49 | %exitcond680 = icmp eq i64 %j.1650, %4 50 | br i1 %exitcond680, label %for.cond.325.for.end.353_crit_edge.loopexit.exitStub, label %for.body.332.lr.ph 51 | } 52 | 53 | attributes #0 = { nounwind "polyjit-global-count"="0" "polyjit-jit-candidate" } 54 | 55 | !0 = !{!1, !1, i64 0} 56 | !1 = !{!"float", !2, i64 0} 57 | !2 = !{!"omnipotent char", !3, i64 0} 58 | !3 = !{!"Simple C/C++ TBAA"} 59 | -------------------------------------------------------------------------------- /test/pprof/linpack/main_for.cond.33.preheader.i.40.i.pjit.scop.ll: -------------------------------------------------------------------------------- 1 | 2 | ; RUN: opt -load LLVMPolly.so -load LLVMPolyJIT.so -O3 -polli -polli-no-recompilation -polli-analyze -disable-output -stats < %s 2>&1 | FileCheck %s 3 | 4 | ; CHECK: 1 regions require runtime support: 5 | 6 | ; ModuleID = 'linpack.c.main_for.cond.33.preheader.i.40.i.pjit.scop.prototype' 7 | target datalayout = "e-m:e-i64:64-f80:128-n8:16:32:64-S128" 8 | target triple = "x86_64-unknown-linux-gnu" 9 | 10 | ; Function Attrs: nounwind 11 | define weak void @main_for.cond.33.preheader.i.40.i.pjit.scop(double* %add.ptr.i, double*) { 12 | newFuncRoot: 13 | br label %for.cond.33.preheader.i.40.i 14 | 15 | matgen.exit51.i.exitStub: ; preds = %for.inc.49.i.50.i 16 | ret void 17 | 18 | for.cond.33.preheader.i.40.i: ; preds = %for.inc.49.i.50.i, %newFuncRoot 19 | %indvars.iv9.i.39.i = phi i64 [ 0, %newFuncRoot ], [ %indvars.iv.next10.i.48.i, %for.inc.49.i.50.i ] 20 | %1 = mul nuw nsw i64 %indvars.iv9.i.39.i, 10240 21 | br label %for.body.36.i.47.i 22 | 23 | for.body.36.i.47.i: ; preds = %for.body.36.i.47.i, %for.cond.33.preheader.i.40.i 24 | %indvars.iv.i.41.i = phi i64 [ 0, %for.cond.33.preheader.i.40.i ], [ %indvars.iv.next.i.45.i, %for.body.36.i.47.i ] 25 | %arrayidx38.i.42.i = getelementptr inbounds double, double* %add.ptr.i, i64 %indvars.iv.i.41.i 26 | %2 = load double, double* %arrayidx38.i.42.i, align 8, !tbaa !0 27 | %3 = add nuw nsw i64 %indvars.iv.i.41.i, %1 28 | %arrayidx42.i.43.i = getelementptr inbounds double, double* %0, i64 %3 29 | %4 = load double, double* %arrayidx42.i.43.i, align 8, !tbaa !0 30 | %add43.i.44.i = fadd double %2, %4 31 | store double %add43.i.44.i, double* %arrayidx38.i.42.i, align 8, !tbaa !0 32 | %indvars.iv.next.i.45.i = add nuw nsw i64 %indvars.iv.i.41.i, 1 33 | %exitcond.i.46.i = icmp eq i64 %indvars.iv.next.i.45.i, 5120 34 | br i1 %exitcond.i.46.i, label %for.inc.49.i.50.i, label %for.body.36.i.47.i 35 | 36 | for.inc.49.i.50.i: ; preds = %for.body.36.i.47.i 37 | %indvars.iv.next10.i.48.i = add nuw nsw i64 %indvars.iv9.i.39.i, 1 38 | %exitcond12.i.49.i = icmp eq i64 %indvars.iv.next10.i.48.i, 5120 39 | br i1 %exitcond12.i.49.i, label %matgen.exit51.i.exitStub, label %for.cond.33.preheader.i.40.i 40 | } 41 | 42 | attributes #0 = { nounwind "polyjit-global-count"="0" "polyjit-jit-candidate" } 43 | 44 | !0 = !{!1, !1, i64 0} 45 | !1 = !{!"double", !2, i64 0} 46 | !2 = !{!"omnipotent char", !3, i64 0} 47 | !3 = !{!"Simple C/C++ TBAA"} 48 | -------------------------------------------------------------------------------- /test/pprof/ludcmp/main_for.cond.116.preheader.i.pjit.scop.ll: -------------------------------------------------------------------------------- 1 | 2 | ; RUN: opt -load LLVMPolly.so -load LLVMPolyJIT.so -O3 -polli -polli-no-recompilation -polli-analyze -disable-output -stats < %s 2>&1 | FileCheck %s 3 | 4 | ; CHECK: 1 regions require runtime support: 5 | 6 | ; ModuleID = 'ludcmp.dir/ludcmp.c.main_for.cond.116.preheader.i.pjit.scop.prototype' 7 | target datalayout = "e-m:e-i64:64-f80:128-n8:16:32:64-S128" 8 | target triple = "x86_64-unknown-linux-gnu" 9 | 10 | ; Function Attrs: nounwind 11 | define weak void @main_for.cond.116.preheader.i.pjit.scop(double*, double*) { 12 | newFuncRoot: 13 | br label %for.cond.116.preheader.i 14 | 15 | init_array.exit.exitStub: ; preds = %for.inc.131.i 16 | ret void 17 | 18 | for.cond.116.preheader.i: ; preds = %for.inc.131.i, %newFuncRoot 19 | %indvars.iv14.i = phi i64 [ %indvars.iv.next15.i, %for.inc.131.i ], [ 0, %newFuncRoot ] 20 | %2 = mul nuw nsw i64 %indvars.iv14.i, 2000 21 | %arrayidx122.i = getelementptr inbounds double, double* %0, i64 %2 22 | %arrayidx126.i = getelementptr inbounds double, double* %1, i64 %2 23 | br label %for.body.119.i 24 | 25 | for.body.119.i: ; preds = %for.body.119.i, %for.cond.116.preheader.i 26 | %indvars.iv.i = phi i64 [ 0, %for.cond.116.preheader.i ], [ %indvars.iv.next.i, %for.body.119.i ] 27 | %arrayidx123.i = getelementptr inbounds double, double* %arrayidx122.i, i64 %indvars.iv.i 28 | %3 = bitcast double* %arrayidx123.i to i64* 29 | %4 = load i64, i64* %3, align 8, !tbaa !0 30 | %arrayidx127.i = getelementptr inbounds double, double* %arrayidx126.i, i64 %indvars.iv.i 31 | %5 = bitcast double* %arrayidx127.i to i64* 32 | store i64 %4, i64* %5, align 8, !tbaa !0 33 | %indvars.iv.next.i = add nuw nsw i64 %indvars.iv.i, 1 34 | %exitcond.i = icmp eq i64 %indvars.iv.next.i, 2000 35 | br i1 %exitcond.i, label %for.inc.131.i, label %for.body.119.i 36 | 37 | for.inc.131.i: ; preds = %for.body.119.i 38 | %indvars.iv.next15.i = add nuw nsw i64 %indvars.iv14.i, 1 39 | %exitcond16.i = icmp eq i64 %indvars.iv.next15.i, 2000 40 | br i1 %exitcond16.i, label %init_array.exit.exitStub, label %for.cond.116.preheader.i 41 | } 42 | 43 | attributes #0 = { nounwind "polyjit-global-count"="0" "polyjit-jit-candidate" } 44 | 45 | !0 = !{!1, !1, i64 0} 46 | !1 = !{!"double", !2, i64 0} 47 | !2 = !{!"omnipotent char", !3, i64 0} 48 | !3 = !{!"Simple C/C++ TBAA"} 49 | -------------------------------------------------------------------------------- /test/pprof/mvt/main_for.cond.24.preheader.i.pjit.scop.ll: -------------------------------------------------------------------------------- 1 | 2 | ; RUN: opt -load LLVMPolly.so -load LLVMPolyJIT.so -O3 -polli -polli-no-recompilation -polli-analyze -disable-output -stats < %s 2>&1 | FileCheck %s 3 | 4 | ; CHECK: 1 regions require runtime support: 5 | 6 | ; ModuleID = 'mvt.dir/mvt.c.main_for.cond.24.preheader.i.pjit.scop.prototype' 7 | target datalayout = "e-m:e-i64:64-f80:128-n8:16:32:64-S128" 8 | target triple = "x86_64-unknown-linux-gnu" 9 | 10 | ; Function Attrs: nounwind 11 | define weak void @main_for.cond.24.preheader.i.pjit.scop(double*, double*, double*) { 12 | newFuncRoot: 13 | br label %for.cond.24.preheader.i 14 | 15 | kernel_mvt.exit.exitStub: ; preds = %for.inc.42.i 16 | ret void 17 | 18 | for.cond.24.preheader.i: ; preds = %for.inc.42.i, %newFuncRoot 19 | %indvars.iv5.i = phi i64 [ %indvars.iv.next6.i, %for.inc.42.i ], [ 0, %newFuncRoot ] 20 | %arrayidx28.i = getelementptr inbounds double, double* %0, i64 %indvars.iv5.i 21 | br label %for.body.26.i 22 | 23 | for.body.26.i: ; preds = %for.body.26.i, %for.cond.24.preheader.i 24 | %indvars.iv.i.133 = phi i64 [ 0, %for.cond.24.preheader.i ], [ %indvars.iv.next.i.134, %for.body.26.i ] 25 | %3 = load double, double* %arrayidx28.i, align 8, !tbaa !0 26 | %4 = mul nuw nsw i64 %indvars.iv.i.133, 2000 27 | %arrayidx31.i = getelementptr inbounds double, double* %1, i64 %4 28 | %arrayidx32.i = getelementptr inbounds double, double* %arrayidx31.i, i64 %indvars.iv5.i 29 | %5 = load double, double* %arrayidx32.i, align 8, !tbaa !0 30 | %arrayidx34.i = getelementptr inbounds double, double* %2, i64 %indvars.iv.i.133 31 | %6 = load double, double* %arrayidx34.i, align 8, !tbaa !0 32 | %mul35.i = fmul double %5, %6 33 | %add36.i = fadd double %3, %mul35.i 34 | store double %add36.i, double* %arrayidx28.i, align 8, !tbaa !0 35 | %indvars.iv.next.i.134 = add nuw nsw i64 %indvars.iv.i.133, 1 36 | %exitcond.i.135 = icmp eq i64 %indvars.iv.next.i.134, 2000 37 | br i1 %exitcond.i.135, label %for.inc.42.i, label %for.body.26.i 38 | 39 | for.inc.42.i: ; preds = %for.body.26.i 40 | %indvars.iv.next6.i = add nuw nsw i64 %indvars.iv5.i, 1 41 | %exitcond7.i = icmp eq i64 %indvars.iv.next6.i, 2000 42 | br i1 %exitcond7.i, label %kernel_mvt.exit.exitStub, label %for.cond.24.preheader.i 43 | } 44 | 45 | attributes #0 = { nounwind "polyjit-global-count"="0" "polyjit-jit-candidate" } 46 | 47 | !0 = !{!1, !1, i64 0} 48 | !1 = !{!"double", !2, i64 0} 49 | !2 = !{!"omnipotent char", !3, i64 0} 50 | !3 = !{!"Simple C/C++ TBAA"} 51 | -------------------------------------------------------------------------------- /test/pprof/python/mpd_qformat_spec_for.body.51.lr.ph.us.i.pjit.scop.ll: -------------------------------------------------------------------------------- 1 | 2 | ; RUN: opt -load LLVMPolly.so -load LLVMPolyJIT.so -O3 -polli -polli-no-recompilation -polli-analyze -disable-output -stats < %s 2>&1 | FileCheck %s 3 | 4 | ; CHECK: 1 regions require runtime support: 5 | 6 | ; ModuleID = '/local/hdd/pjtest/pj-collect/python/Python-3.4.3/Modules/_decimal/libmpdec/io.c.mpd_qformat_spec_for.body.51.lr.ph.us.i.pjit.scop.prototype' 7 | target datalayout = "e-m:e-i64:64-f80:128-n8:16:32:64-S128" 8 | target triple = "x86_64-unknown-linux-gnu" 9 | 10 | %struct.mpd_spec_t = type { i64, i64, i8, i8, i8, [5 x i8], i8*, i8*, i8* } 11 | 12 | ; Function Attrs: nounwind 13 | define weak void @mpd_qformat_spec_for.body.51.lr.ph.us.i.pjit.scop(i64 %call.i.247, %struct.mpd_spec_t* %spec.addr.1, i8* %cp.0.i, i64 %lpad.0165.i) { 14 | newFuncRoot: 15 | br label %for.body.51.lr.ph.us.i 16 | 17 | for.end.58.i.loopexit.exitStub: ; preds = %for.cond.48.for.inc.56_crit_edge.us.i 18 | ret void 19 | 20 | for.body.51.lr.ph.us.i: ; preds = %for.cond.48.for.inc.56_crit_edge.us.i, %newFuncRoot 21 | %i.0175.us.i = phi i64 [ %inc57.us.i, %for.cond.48.for.inc.56_crit_edge.us.i ], [ 0, %newFuncRoot ] 22 | %mul53.us.i = mul i64 %i.0175.us.i, %call.i.247 23 | br label %for.body.51.us.i 24 | 25 | for.body.51.us.i: ; preds = %for.body.51.us.i, %for.body.51.lr.ph.us.i 26 | %j.0173.us.i = phi i64 [ 0, %for.body.51.lr.ph.us.i ], [ %inc.us.i, %for.body.51.us.i ] 27 | %arrayidx.us.i = getelementptr %struct.mpd_spec_t, %struct.mpd_spec_t* %spec.addr.1, i64 0, i32 5, i64 %j.0173.us.i 28 | %0 = load i8, i8* %arrayidx.us.i, align 1, !tbaa !0 29 | %add54.us.i = add i64 %j.0173.us.i, %mul53.us.i 30 | %arrayidx55.us.i = getelementptr i8, i8* %cp.0.i, i64 %add54.us.i 31 | store i8 %0, i8* %arrayidx55.us.i, align 1, !tbaa !0 32 | %inc.us.i = add nuw i64 %j.0173.us.i, 1 33 | %exitcond182.i = icmp eq i64 %inc.us.i, %call.i.247 34 | br i1 %exitcond182.i, label %for.cond.48.for.inc.56_crit_edge.us.i, label %for.body.51.us.i 35 | 36 | for.cond.48.for.inc.56_crit_edge.us.i: ; preds = %for.body.51.us.i 37 | %inc57.us.i = add nuw i64 %i.0175.us.i, 1 38 | %exitcond183.i = icmp eq i64 %inc57.us.i, %lpad.0165.i 39 | br i1 %exitcond183.i, label %for.end.58.i.loopexit.exitStub, label %for.body.51.lr.ph.us.i 40 | } 41 | 42 | attributes #0 = { nounwind "polyjit-global-count"="0" "polyjit-jit-candidate" } 43 | 44 | !0 = !{!1, !1, i64 0} 45 | !1 = !{!"omnipotent char", !2, i64 0} 46 | !2 = !{!"Simple C/C++ TBAA"} 47 | -------------------------------------------------------------------------------- /test/pprof/python/std_trans_for.body.us.pjit.scop.ll: -------------------------------------------------------------------------------- 1 | 2 | ; RUN: opt -load LLVMPolly.so -load LLVMPolyJIT.so -O3 -polli -polli-no-recompilation -polli-analyze -disable-output -stats < %s 2>&1 | FileCheck %s 3 | 4 | ; CHECK: 1 regions require runtime support: 5 | 6 | ; ModuleID = '/local/hdd/pjtest/pj-collect/python/Python-3.4.3/Modules/_decimal/libmpdec/transpose.c.std_trans_for.body.us.pjit.scop.prototype' 7 | target datalayout = "e-m:e-i64:64-f80:128-n8:16:32:64-S128" 8 | target triple = "x86_64-unknown-linux-gnu" 9 | 10 | ; Function Attrs: nounwind 11 | define weak void @std_trans_for.body.us.pjit.scop(i64 %cols, i64* %src, i64* %dest, i64 %rows) { 12 | newFuncRoot: 13 | br label %for.body.us 14 | 15 | for.end.8.loopexit.exitStub: ; preds = %for.cond.1.for.inc.6_crit_edge.us 16 | ret void 17 | 18 | for.body.us: ; preds = %for.cond.1.for.inc.6_crit_edge.us, %newFuncRoot 19 | %r.026.us = phi i64 [ %inc7.us, %for.cond.1.for.inc.6_crit_edge.us ], [ 0, %newFuncRoot ] 20 | %mul.us = mul i64 %r.026.us, %cols 21 | br label %for.body.3.us 22 | 23 | for.body.3.us: ; preds = %for.body.3.us, %for.body.us 24 | %c.024.us = phi i64 [ 0, %for.body.us ], [ %inc.us, %for.body.3.us ] 25 | %isrc.023.us = phi i64 [ %mul.us, %for.body.us ], [ %add.us, %for.body.3.us ] 26 | %idest.022.us = phi i64 [ %r.026.us, %for.body.us ], [ %add5.us, %for.body.3.us ] 27 | %arrayidx.us = getelementptr i64, i64* %src, i64 %isrc.023.us 28 | %0 = load i64, i64* %arrayidx.us, align 8, !tbaa !0 29 | %arrayidx4.us = getelementptr i64, i64* %dest, i64 %idest.022.us 30 | store i64 %0, i64* %arrayidx4.us, align 8, !tbaa !0 31 | %add.us = add i64 %isrc.023.us, 1 32 | %add5.us = add i64 %idest.022.us, %rows 33 | %inc.us = add nuw i64 %c.024.us, 1 34 | %exitcond28 = icmp eq i64 %inc.us, %cols 35 | br i1 %exitcond28, label %for.cond.1.for.inc.6_crit_edge.us, label %for.body.3.us 36 | 37 | for.cond.1.for.inc.6_crit_edge.us: ; preds = %for.body.3.us 38 | %inc7.us = add nuw i64 %r.026.us, 1 39 | %exitcond29 = icmp eq i64 %inc7.us, %rows 40 | br i1 %exitcond29, label %for.end.8.loopexit.exitStub, label %for.body.us 41 | } 42 | 43 | attributes #0 = { nounwind "polyjit-global-count"="0" "polyjit-jit-candidate" } 44 | 45 | !0 = !{!1, !1, i64 0} 46 | !1 = !{!"long", !2, i64 0} 47 | !2 = !{!"omnipotent char", !3, i64 0} 48 | !3 = !{!"Simple C/C++ TBAA"} 49 | -------------------------------------------------------------------------------- /utils/arcanist/LitTestEngine/__phutil_library_init__.php: -------------------------------------------------------------------------------- 1 | 2, 11 | 'class' => 12 | array( 13 | 'LitTestEngine' => 'src/LitTestEngine.php', 14 | ), 15 | 'function' => 16 | array( 17 | ), 18 | 'xmap' => 19 | array( 20 | 'LitTestEngine' => 'ArcanistBaseUnitTestEngine', 21 | ), 22 | )); 23 | --------------------------------------------------------------------------------