[llvm] Add support for SPIR-V extension: SPV_INTEL_function_pointers (PR #80759)
via llvm-commits
llvm-commits at lists.llvm.org
Mon Feb 5 15:06:03 PST 2024
github-actions[bot] wrote:
<!--LLVM CODE FORMAT COMMENT: {clang-format}-->
:warning: C/C++ code formatter, clang-format found issues in your code. :warning:
<details>
<summary>
You can test this locally with the following command:
</summary>
``````````bash
git-clang-format --diff 5cc87b424be87db4247f34ae5477be8b09a573e9 fad3741edfc5970f11a634e456d8e86cdfe1b761 -- llvm/lib/Target/SPIRV/SPIRVCallLowering.cpp llvm/lib/Target/SPIRV/SPIRVCallLowering.h llvm/lib/Target/SPIRV/SPIRVDuplicatesTracker.cpp llvm/lib/Target/SPIRV/SPIRVDuplicatesTracker.h llvm/lib/Target/SPIRV/SPIRVGlobalRegistry.h llvm/lib/Target/SPIRV/SPIRVInstrInfo.cpp llvm/lib/Target/SPIRV/SPIRVInstructionSelector.cpp llvm/lib/Target/SPIRV/SPIRVModuleAnalysis.cpp llvm/lib/Target/SPIRV/SPIRVModuleAnalysis.h llvm/lib/Target/SPIRV/SPIRVSubtarget.cpp
``````````
</details>
<details>
<summary>
View the diff from clang-format here.
</summary>
``````````diff
diff --git a/llvm/lib/Target/SPIRV/SPIRVCallLowering.cpp b/llvm/lib/Target/SPIRV/SPIRVCallLowering.cpp
index 9fe517a996..a31180f847 100644
--- a/llvm/lib/Target/SPIRV/SPIRVCallLowering.cpp
+++ b/llvm/lib/Target/SPIRV/SPIRVCallLowering.cpp
@@ -381,8 +381,8 @@ bool SPIRVCallLowering::lowerFormalArguments(MachineIRBuilder &MIRBuilder,
if (hasFunctionPointers) {
if (F.hasFnAttribute("referenced-indirectly")) {
assert((F.getCallingConv() != CallingConv::SPIR_KERNEL) &&
- "Unexpected 'referenced-indirectly' attribute of the kernel "
- "function");
+ "Unexpected 'referenced-indirectly' attribute of the kernel "
+ "function");
buildOpDecorate(FuncVReg, MIRBuilder,
SPIRV::Decoration::ReferencedIndirectlyINTEL, {});
}
diff --git a/llvm/lib/Target/SPIRV/SPIRVDuplicatesTracker.h b/llvm/lib/Target/SPIRV/SPIRVDuplicatesTracker.h
index 65bc651116..dabd73367c 100644
--- a/llvm/lib/Target/SPIRV/SPIRVDuplicatesTracker.h
+++ b/llvm/lib/Target/SPIRV/SPIRVDuplicatesTracker.h
@@ -266,7 +266,8 @@ class SPIRVGeneralDuplicatesTracker {
// map a Function to its definition (as a machine instruction operand)
DenseMap<const Function *, const MachineOperand *> FunctionToInstr;
- // map function pointer (as a machine instruction operand) to the used Function
+ // map function pointer (as a machine instruction operand) to the used
+ // Function
DenseMap<const MachineOperand *, const Function *> InstrToFunction;
// NOTE: using MOs instead of regs to get rid of MF dependency to be able
@@ -289,7 +290,7 @@ public:
// pointer to a machine operand that represents the function definition.
// Return either the register or invalid value, because we have no context for
// a good diagnostic message in case of unexpectedly missing references.
- const MachineOperand* getFunctionDefinitionByUse(const MachineOperand *Use) {
+ const MachineOperand *getFunctionDefinitionByUse(const MachineOperand *Use) {
auto ResF = InstrToFunction.find(Use);
if (ResF == InstrToFunction.end())
return nullptr;
``````````
</details>
https://github.com/llvm/llvm-project/pull/80759
More information about the llvm-commits
mailing list