-
Notifications
You must be signed in to change notification settings - Fork 154
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Pass to convert 2D block intrinsics into constituents.
The 2D block IO intrinsics are opaque to the compiler and identical payloads cannot be optimized by the compiler. Intrinsics have been introduced to overcome this problem by allowing the 2D intrinsics to be broken up into constituent stages (payload, set X and Y relative to payload, IO operation). This PR adds a new pass, `Decompose2DBlockFuncs`, which converts the 2D IO intrinsics into the constituents, allowing subequent passes to optimize the code. At the current stage, the payload intrinsics can be hoisted above loops by LICM, and can be merged by EarlyCSA and others. The `LSC2DBlockSetAddrPayloadField` intrinsics have a mode in which the IO location in memory is specified exactly (relative to the payload), and another mode in which the intrinsic increments the value. When a payload is used by the `LSC2DBlockSetAddrPayloadField` intrinsic in the accumulator mode, the payload cannot be hoisted. Because of this, I have given the `LSC2DBlockCreateAddrPayload` default attributes of `writeonly`, which is conservative for when the SetAddr intrinsic is in accumulator mode. The `LSC2DBlockSetAddrPayloadField` intrinsic added by the `Decompose2DBlockFuncs` is always in the mode in which it explicitly specifies the memory location. Since we have this guarantee, the related payload is described as not accessing memory, since the dependencies are all properly accounted for by the data dependency; this allows the desired optimizations to function. The 2D block intrinsics are not decomposed when they do not fall within a loop, or if the payload would have loop-dependent parameters.
- Loading branch information
1 parent
71165b1
commit 82a6156
Showing
15 changed files
with
726 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
29 changes: 29 additions & 0 deletions
29
IGC/Compiler/Optimizer/OpenCLPasses/Decompose2DBlockFuncs/CMakeLists.txt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
#=========================== begin_copyright_notice ============================ | ||
# | ||
# Copyright (C) 2019-2021 Intel Corporation | ||
# | ||
# SPDX-License-Identifier: MIT | ||
# | ||
#============================ end_copyright_notice ============================= | ||
|
||
include_directories("${CMAKE_CURRENT_SOURCE_DIR}") | ||
|
||
|
||
set(IGC_BUILD__SRC__Decompose2DBlockFuncs | ||
"${CMAKE_CURRENT_SOURCE_DIR}/Decompose2DBlockFuncs.cpp" | ||
) | ||
set(IGC_BUILD__SRC__OpenCLPasses_Decompose2DBlockFuncs ${IGC_BUILD__SRC__Decompose2DBlockFuncs} PARENT_SCOPE) | ||
|
||
set(IGC_BUILD__HDR__Decompose2DBlockFuncs | ||
"${CMAKE_CURRENT_SOURCE_DIR}/Decompose2DBlockFuncs.hpp" | ||
) | ||
set(IGC_BUILD__HDR__OpenCLPasses_Decompose2DBlockFuncs ${IGC_BUILD__HDR__Decompose2DBlockFuncs} PARENT_SCOPE) | ||
|
||
|
||
igc_sg_register( | ||
Compiler__OpenCLPasses_Decompose2DBlockFuncs | ||
"Decompose2DBlockFuncs" | ||
FILES | ||
${IGC_BUILD__SRC__Decompose2DBlockFuncs} | ||
${IGC_BUILD__HDR__Decompose2DBlockFuncs} | ||
) |
Oops, something went wrong.