1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2024-11-22 10:42:39 +01:00
llvm-mirror/lib/Transforms/IPO
Jose M Monsalve Diaz 5b7208da36 [OpenMP] Folding threadLimit and numThreads when single value in kernels
The device runtime contains several calls to `__kmpc_get_hardware_num_threads_in_block`
and `__kmpc_get_hardware_num_blocks`. If the thread_limit and the num_teams are constant,
these calls can be folded to the constant value.

In this patch we use the already introduced `AAFoldRuntimeCall` and the `NumTeams` and
`NumThreads` kernel attributes (to be introduced in a different patch) to fold these functions.
The code checks all the kernels, and if their attributes match, the functions are folded.

In the future we will explore specializing for multiple values of NumThreads and NumTeams.

Depends on D106390

Reviewed By: jdoerfert, JonChesterfield

Differential Revision: https://reviews.llvm.org/D106033
2021-07-27 21:47:12 -04:00
..
AlwaysInliner.cpp
Annotation2Metadata.cpp
ArgumentPromotion.cpp [OpaquePtr] Use byval type more 2021-07-13 09:34:34 -07:00
Attributor.cpp Reapply "[Attributor] Disable simplification AAs if a callback is present"" 2021-07-27 19:14:50 -05:00
AttributorAttributes.cpp Reapply "[Attributor] Disable simplification AAs if a callback is present"" 2021-07-27 19:14:50 -05:00
BarrierNoopPass.cpp
BlockExtractor.cpp Internalize some cl::opt global variables or move them under namespace llvm 2021-05-07 11:15:43 -07:00
CalledValuePropagation.cpp
CMakeLists.txt Move Function Specialization to its correct location. NFC. 2021-06-11 15:00:10 +01:00
ConstantMerge.cpp [ConstantMerge] Don't merge thread_local constants with non-thread_local constants 2021-04-28 23:44:20 +01:00
CrossDSOCFI.cpp
DeadArgumentElimination.cpp [Attributes] Clean up handling of UB implying attributes (NFC) 2021-07-25 18:21:13 +02:00
ElimAvailExtern.cpp
ExtractGV.cpp [Transforms] Use range-based for loops (NFC) 2021-02-08 22:33:53 -08:00
ForceFunctionAttrs.cpp [Attributes] Determine attribute properties from TableGen data 2021-07-12 22:13:38 +02:00
FunctionAttrs.cpp Revert "[NewPM] Only invalidate modified functions' analyses in CGSCC passes" 2021-05-21 16:38:03 -07:00
FunctionImport.cpp [HIP] support ThinLTO 2021-05-22 10:48:34 -04:00
FunctionSpecialization.cpp [FuncSpec] Add an option to specializing literal constant 2021-06-30 11:26:44 +08:00
GlobalDCE.cpp
GlobalOpt.cpp This patch extends the OptimizeGlobalAddressOfMalloc to handle the null check of global pointer variables. It is disabled with https://reviews.llvm.org/rGb7cd291c1542aee12c9e9fde6c411314a163a8ea. This PR is to reenable it while fixing the original problem reported. The fix is to set the store value correctly when creating store for the new created global init bool symbol. 2021-07-20 12:27:26 -04:00
GlobalSplit.cpp
HotColdSplitting.cpp Calculate getTerminator only when necessary 2021-06-13 20:16:07 -07:00
InferFunctionAttrs.cpp [inferattrs] Don't infer lib func attributes for nobuiltin functions 2021-04-16 15:36:15 -07:00
Inliner.cpp [NewPM][Inliner] Check if deleted function is in current SCC 2021-07-21 08:47:45 -07:00
InlineSimple.cpp
Internalize.cpp [IR] Rename comdat noduplicates to comdat nodeduplicate 2021-07-20 12:47:10 -07:00
IPO.cpp Function Specialization Pass 2021-06-11 09:11:29 +01:00
IROutliner.cpp [IROutliner] Adding DebugInfo handling for IR Outlined Functions 2021-06-15 10:57:08 -05:00
LoopExtractor.cpp
LowerTypeTests.cpp [LTT] Handle merged llvm.assume when dropping type tests 2021-05-25 17:02:13 -07:00
MergeFunctions.cpp [OpaquePtr] Use GlobalValue::getValueType() more 2021-07-13 09:34:34 -07:00
OpenMPOpt.cpp [OpenMP] Folding threadLimit and numThreads when single value in kernels 2021-07-27 21:47:12 -04:00
PartialInlining.cpp NFC: Migrate PartialInlining to work on InstructionCost 2021-03-30 11:59:45 +01:00
PassManagerBuilder.cpp Add jump-threading optimization for deterministic finite automata 2021-07-27 14:34:04 -04:00
PruneEH.cpp [Local] Do not introduce a new llvm.trap before unreachable 2021-07-26 23:33:36 -05:00
SampleContextTracker.cpp [CSSPGO] Fix a typo in SampleContextTracker 2021-07-22 16:44:50 -07:00
SampleProfile.cpp [CSSPGO] Tweak ICP threshold in top-down inliner 2021-07-26 21:49:20 -07:00
SampleProfileProbe.cpp [CSSPGO] Undoing the concept of dangling pseudo probe 2021-06-18 15:14:11 -07:00
SCCP.cpp Function Specialization Pass 2021-06-11 09:11:29 +01:00
StripDeadPrototypes.cpp
StripSymbols.cpp [Transforms] Use range-based for loops (NFC) 2021-02-08 22:33:53 -08:00
SyntheticCountsPropagation.cpp Internalize some cl::opt global variables or move them under namespace llvm 2021-05-07 11:15:43 -07:00
ThinLTOBitcodeWriter.cpp Revert "ThinLTO: Fix inline assembly references to static functions with CFI" 2021-07-20 13:59:46 -07:00
WholeProgramDevirt.cpp [WPD] Don't optimize calls more than once 2021-06-24 13:28:09 -07:00