2012-12-12 05:25:42 +08:00
|
|
|
set(LLVM_TARGET_DEFINITIONS AMDGPU.td)
|
|
|
|
|
|
|
|
tablegen(LLVM AMDGPUGenRegisterInfo.inc -gen-register-info)
|
|
|
|
tablegen(LLVM AMDGPUGenInstrInfo.inc -gen-instr-info)
|
|
|
|
tablegen(LLVM AMDGPUGenDAGISel.inc -gen-dag-isel)
|
|
|
|
tablegen(LLVM AMDGPUGenCallingConv.inc -gen-callingconv)
|
|
|
|
tablegen(LLVM AMDGPUGenSubtargetInfo.inc -gen-subtarget)
|
|
|
|
tablegen(LLVM AMDGPUGenIntrinsics.inc -gen-tgt-intrinsic)
|
2014-09-03 06:28:02 +08:00
|
|
|
tablegen(LLVM AMDGPUGenMCCodeEmitter.inc -gen-emitter)
|
2012-12-12 05:25:42 +08:00
|
|
|
tablegen(LLVM AMDGPUGenDFAPacketizer.inc -gen-dfa-packetizer)
|
|
|
|
tablegen(LLVM AMDGPUGenAsmWriter.inc -gen-asm-writer)
|
2014-11-14 22:08:00 +08:00
|
|
|
tablegen(LLVM AMDGPUGenAsmMatcher.inc -gen-asm-matcher)
|
2016-02-18 11:42:32 +08:00
|
|
|
tablegen(LLVM AMDGPUGenDisassemblerTables.inc -gen-disassembler)
|
2016-10-07 01:19:11 +08:00
|
|
|
tablegen(LLVM AMDGPUGenMCPseudoLowering.inc -gen-pseudo-lowering)
|
Re-commit AMDGPU/GlobalISel: Add support for simple shaders
Fix build when global-isel is disabled and fix a warning.
Summary: We can select constant/global G_LOAD, global G_STORE, and G_GEP.
Reviewers: qcolombet, MatzeB, t.p.northover, ab, arsenm
Subscribers: mehdi_amini, vkalintiris, kzhuravl, wdng, nhaehnle, mgorny, yaxunl, tony-tye, modocache, llvm-commits, dberris
Differential Revision: https://reviews.llvm.org/D26730
llvm-svn: 293551
2017-01-31 05:56:46 +08:00
|
|
|
if(LLVM_BUILD_GLOBAL_ISEL)
|
|
|
|
tablegen(LLVM AMDGPUGenRegisterBank.inc -gen-register-bank)
|
|
|
|
endif()
|
2012-12-12 05:25:42 +08:00
|
|
|
add_public_tablegen_target(AMDGPUCommonTableGen)
|
|
|
|
|
2016-04-15 03:09:28 +08:00
|
|
|
# List of all GlobalISel files.
|
|
|
|
set(GLOBAL_ISEL_FILES
|
|
|
|
AMDGPUCallLowering.cpp
|
Re-commit AMDGPU/GlobalISel: Add support for simple shaders
Fix build when global-isel is disabled and fix a warning.
Summary: We can select constant/global G_LOAD, global G_STORE, and G_GEP.
Reviewers: qcolombet, MatzeB, t.p.northover, ab, arsenm
Subscribers: mehdi_amini, vkalintiris, kzhuravl, wdng, nhaehnle, mgorny, yaxunl, tony-tye, modocache, llvm-commits, dberris
Differential Revision: https://reviews.llvm.org/D26730
llvm-svn: 293551
2017-01-31 05:56:46 +08:00
|
|
|
AMDGPUInstructionSelector.cpp
|
|
|
|
AMDGPULegalizerInfo.cpp
|
|
|
|
AMDGPURegisterBankInfo.cpp
|
2016-04-15 03:09:28 +08:00
|
|
|
)
|
|
|
|
|
|
|
|
# Add GlobalISel files to the dependencies if the user wants to build it.
|
|
|
|
if(LLVM_BUILD_GLOBAL_ISEL)
|
|
|
|
set(GLOBAL_ISEL_BUILD_FILES ${GLOBAL_ISEL_FILES})
|
|
|
|
else()
|
|
|
|
set(GLOBAL_ISEL_BUILD_FILES"")
|
|
|
|
set(LLVM_OPTIONAL_SOURCES LLVMGlobalISel ${GLOBAL_ISEL_FILES})
|
|
|
|
endif()
|
|
|
|
|
|
|
|
|
2015-06-13 11:28:10 +08:00
|
|
|
add_llvm_target(AMDGPUCodeGen
|
2012-12-12 05:25:42 +08:00
|
|
|
AMDILCFGStructurizer.cpp
|
2017-03-18 07:56:58 +08:00
|
|
|
AMDGPUAliasAnalysis.cpp
|
2014-11-04 03:49:05 +08:00
|
|
|
AMDGPUAlwaysInlinePass.cpp
|
2015-11-07 02:01:57 +08:00
|
|
|
AMDGPUAnnotateKernelFeatures.cpp
|
2015-12-16 04:55:55 +08:00
|
|
|
AMDGPUAnnotateUniformValues.cpp
|
2012-12-12 05:25:42 +08:00
|
|
|
AMDGPUAsmPrinter.cpp
|
2016-06-24 15:07:55 +08:00
|
|
|
AMDGPUCodeGenPrepare.cpp
|
2013-02-07 01:32:29 +08:00
|
|
|
AMDGPUFrameLowering.cpp
|
2015-12-10 10:13:01 +08:00
|
|
|
AMDGPUTargetObjectFile.cpp
|
2014-06-24 02:00:31 +08:00
|
|
|
AMDGPUIntrinsicInfo.cpp
|
2013-07-23 09:48:29 +08:00
|
|
|
AMDGPUISelDAGToDAG.cpp
|
2017-02-10 06:00:42 +08:00
|
|
|
AMDGPULowerIntrinsics.cpp
|
2017-07-07 04:57:05 +08:00
|
|
|
AMDGPUMacroFusion.cpp
|
2012-12-12 05:25:42 +08:00
|
|
|
AMDGPUMCInstLower.cpp
|
2017-05-16 04:18:37 +08:00
|
|
|
AMDGPUMachineCFGStructurizer.cpp
|
2013-04-02 06:05:58 +08:00
|
|
|
AMDGPUMachineFunction.cpp
|
2017-07-22 05:19:23 +08:00
|
|
|
AMDGPUMachineModuleInfo.cpp
|
2016-12-09 03:46:04 +08:00
|
|
|
AMDGPUUnifyMetadata.cpp
|
2015-08-08 07:19:30 +08:00
|
|
|
AMDGPUOpenCLImageTypeLoweringPass.cpp
|
2012-12-12 05:25:42 +08:00
|
|
|
AMDGPUSubtarget.cpp
|
|
|
|
AMDGPUTargetMachine.cpp
|
2013-07-27 08:01:07 +08:00
|
|
|
AMDGPUTargetTransformInfo.cpp
|
2012-12-12 05:25:42 +08:00
|
|
|
AMDGPUISelLowering.cpp
|
|
|
|
AMDGPUInstrInfo.cpp
|
2014-06-18 00:53:14 +08:00
|
|
|
AMDGPUPromoteAlloca.cpp
|
2017-06-09 03:25:21 +08:00
|
|
|
AMDGPURegAsmNames.inc.cpp
|
2012-12-12 05:25:42 +08:00
|
|
|
AMDGPURegisterInfo.cpp
|
2017-03-25 03:52:05 +08:00
|
|
|
AMDGPUUnifyDivergentExitNodes.cpp
|
2016-04-30 08:23:06 +08:00
|
|
|
GCNHazardRecognizer.cpp
|
2016-08-30 03:42:52 +08:00
|
|
|
GCNSchedStrategy.cpp
|
2013-10-02 03:32:58 +08:00
|
|
|
R600ClauseMergePass.cpp
|
2013-04-02 06:05:58 +08:00
|
|
|
R600ControlFlowFinalizer.cpp
|
|
|
|
R600EmitClauseMarkers.cpp
|
2012-12-12 05:25:42 +08:00
|
|
|
R600ExpandSpecialInstrs.cpp
|
2016-06-24 14:30:11 +08:00
|
|
|
R600FrameLowering.cpp
|
2012-12-12 05:25:42 +08:00
|
|
|
R600InstrInfo.cpp
|
|
|
|
R600ISelLowering.cpp
|
|
|
|
R600MachineFunctionInfo.cpp
|
2013-03-06 02:54:05 +08:00
|
|
|
R600MachineScheduler.cpp
|
2013-06-06 05:38:04 +08:00
|
|
|
R600OptimizeVectorRegisters.cpp
|
2013-04-30 08:14:27 +08:00
|
|
|
R600Packetizer.cpp
|
2012-12-12 05:25:42 +08:00
|
|
|
R600RegisterInfo.cpp
|
2012-12-20 06:10:31 +08:00
|
|
|
SIAnnotateControlFlow.cpp
|
2016-05-11 02:33:41 +08:00
|
|
|
SIDebuggerInsertNops.cpp
|
2015-05-13 01:13:02 +08:00
|
|
|
SIFixControlFlowLiveIntervals.cpp
|
2013-08-07 07:12:34 +08:00
|
|
|
SIFixSGPRCopies.cpp
|
2017-01-25 01:46:17 +08:00
|
|
|
SIFixVGPRCopies.cpp
|
2014-11-22 06:06:37 +08:00
|
|
|
SIFoldOperands.cpp
|
2015-11-07 02:17:45 +08:00
|
|
|
SIFrameLowering.cpp
|
2016-08-23 03:33:16 +08:00
|
|
|
SIInsertSkips.cpp
|
2013-01-19 05:15:53 +08:00
|
|
|
SIInsertWaits.cpp
|
2017-04-12 11:25:12 +08:00
|
|
|
SIInsertWaitcnts.cpp
|
2012-12-12 05:25:42 +08:00
|
|
|
SIInstrInfo.cpp
|
|
|
|
SIISelLowering.cpp
|
2014-10-11 06:01:59 +08:00
|
|
|
SILoadStoreOptimizer.cpp
|
2012-12-12 05:25:42 +08:00
|
|
|
SILowerControlFlow.cpp
|
2014-04-30 23:31:33 +08:00
|
|
|
SILowerI1Copies.cpp
|
2012-12-12 05:25:42 +08:00
|
|
|
SIMachineFunctionInfo.cpp
|
2016-01-14 00:10:10 +08:00
|
|
|
SIMachineScheduler.cpp
|
2017-07-22 05:19:23 +08:00
|
|
|
SIMemoryLegalizer.cpp
|
2016-09-29 09:44:16 +08:00
|
|
|
SIOptimizeExecMasking.cpp
|
[ADMGPU] SDWA peephole optimization pass.
Summary:
First iteration of SDWA peephole.
This pass tries to combine several instruction into one SDWA instruction. E.g. it converts:
'''
V_LSHRREV_B32_e32 %vreg0, 16, %vreg1
V_ADD_I32_e32 %vreg2, %vreg0, %vreg3
V_LSHLREV_B32_e32 %vreg4, 16, %vreg2
'''
Into:
'''
V_ADD_I32_sdwa %vreg4, %vreg1, %vreg3 dst_sel:WORD_1 dst_unused:UNUSED_PAD src0_sel:WORD_1 src1_sel:DWORD
'''
Pass structure:
1. Iterate over machine instruction in basic block and try to apply "SDWA patterns" to each of them. SDWA patterns match machine instruction into either source or destination SDWA operand. E.g. ''' V_LSHRREV_B32_e32 %vreg0, 16, %vreg1''' is matched to source SDWA operand '''%vreg1 src_sel:WORD_1'''.
2. Iterate over found SDWA operands and find instruction that could be potentially coverted into SDWA. E.g. for source SDWA operand potential instruction are all instruction in this basic block that uses '''%vreg0'''
3. Iterate over all potential instructions and check if they can be converted into SDWA.
4. Convert instructions to SDWA.
This review contains basic implementation of SDWA peephole pass. This pass requires additional testing fot both correctness and performance (no performance testing done).
There are several ways this pass can be improved:
1. Make this pass work on whole function not only basic block. As I can see this can be done right now without changes to pass.
2. Introduce more SDWA patterns
3. Introduce mnemonics to limit when SDWA patterns should apply
Reviewers: vpykhtin, alex-t, arsenm, rampitec
Subscribers: wdng, nhaehnle, mgorny
Differential Revision: https://reviews.llvm.org/D30038
llvm-svn: 298365
2017-03-21 20:51:34 +08:00
|
|
|
SIPeepholeSDWA.cpp
|
2012-12-12 05:25:42 +08:00
|
|
|
SIRegisterInfo.cpp
|
2014-07-22 00:55:33 +08:00
|
|
|
SIShrinkInstructions.cpp
|
2016-03-22 04:28:33 +08:00
|
|
|
SIWholeQuadMode.cpp
|
2017-03-21 21:15:46 +08:00
|
|
|
GCNIterativeScheduler.cpp
|
|
|
|
GCNMinRegStrategy.cpp
|
|
|
|
GCNRegPressure.cpp
|
2016-04-15 03:09:28 +08:00
|
|
|
${GLOBAL_ISEL_BUILD_FILES}
|
2012-12-12 05:25:42 +08:00
|
|
|
)
|
|
|
|
|
2014-11-14 22:08:00 +08:00
|
|
|
add_subdirectory(AsmParser)
|
2012-12-12 05:25:42 +08:00
|
|
|
add_subdirectory(InstPrinter)
|
2016-02-18 11:42:32 +08:00
|
|
|
add_subdirectory(Disassembler)
|
2012-12-12 05:25:42 +08:00
|
|
|
add_subdirectory(TargetInfo)
|
|
|
|
add_subdirectory(MCTargetDesc)
|
2015-06-27 05:15:07 +08:00
|
|
|
add_subdirectory(Utils)
|