[PATCH] D150549: Move SubtargetFeature.h from MC to TargetParser

2023-06-26 Thread Job Noorman via Phabricator via cfe-commits
This revision was landed with ongoing or failed builds.
This revision was automatically updated to reflect the committed changes.
Closed by commit rG8de9f2b558a0: Move SubtargetFeature.h from MC to 
TargetParser (authored by jobnoorman).

Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D150549/new/

https://reviews.llvm.org/D150549

Files:
  clang/lib/CodeGen/BackendUtil.cpp
  clang/lib/Driver/ToolChains/AVR.cpp
  llvm/include/llvm/ExecutionEngine/Orc/JITTargetMachineBuilder.h
  llvm/include/llvm/MC/MCParser/MCTargetAsmParser.h
  llvm/include/llvm/MC/MCSubtargetInfo.h
  llvm/include/llvm/MC/SubtargetFeature.h
  llvm/include/llvm/Object/COFF.h
  llvm/include/llvm/Object/ELFObjectFile.h
  llvm/include/llvm/Object/GOFFObjectFile.h
  llvm/include/llvm/Object/MachO.h
  llvm/include/llvm/TargetParser/SubtargetFeature.h
  llvm/lib/CodeGen/CommandFlags.cpp
  llvm/lib/ExecutionEngine/TargetSelect.cpp
  llvm/lib/LTO/LTOBackend.cpp
  llvm/lib/LTO/LTOCodeGenerator.cpp
  llvm/lib/LTO/LTOModule.cpp
  llvm/lib/LTO/ThinLTOCodeGenerator.cpp
  llvm/lib/MC/CMakeLists.txt
  llvm/lib/MC/MCSubtargetInfo.cpp
  llvm/lib/MC/SubtargetFeature.cpp
  llvm/lib/Object/ELFObjectFile.cpp
  llvm/lib/Object/WasmObjectFile.cpp
  llvm/lib/Object/XCOFFObjectFile.cpp
  llvm/lib/Target/AArch64/AsmParser/AArch64AsmParser.cpp
  llvm/lib/Target/AArch64/Utils/AArch64BaseInfo.h
  llvm/lib/Target/AMDGPU/MCTargetDesc/R600MCCodeEmitter.cpp
  llvm/lib/Target/AMDGPU/MCTargetDesc/R600MCTargetDesc.cpp
  llvm/lib/Target/AMDGPU/MCTargetDesc/SIMCCodeEmitter.cpp
  llvm/lib/Target/ARM/ARMTargetTransformInfo.cpp
  llvm/lib/Target/ARM/ARMTargetTransformInfo.h
  llvm/lib/Target/ARM/AsmParser/ARMAsmParser.cpp
  llvm/lib/Target/ARM/Disassembler/ARMDisassembler.cpp
  llvm/lib/Target/ARM/MCTargetDesc/ARMInstPrinter.cpp
  llvm/lib/Target/ARM/Utils/ARMBaseInfo.h
  llvm/lib/Target/AVR/MCTargetDesc/AVRELFStreamer.cpp
  llvm/lib/Target/BPF/Disassembler/BPFDisassembler.cpp
  llvm/lib/Target/Hexagon/MCTargetDesc/HexagonMCCodeEmitter.h
  llvm/lib/Target/LoongArch/MCTargetDesc/LoongArchBaseInfo.h
  llvm/lib/Target/Mips/AsmParser/MipsAsmParser.cpp
  llvm/lib/Target/RISCV/MCTargetDesc/RISCVBaseInfo.h
  llvm/lib/Target/RISCV/MCTargetDesc/RISCVMatInt.h
  llvm/lib/Target/Sparc/MCTargetDesc/SparcMCCodeEmitter.cpp
  llvm/lib/Target/TargetMachineC.cpp
  llvm/lib/TargetParser/CMakeLists.txt
  llvm/lib/TargetParser/SubtargetFeature.cpp
  llvm/tools/llc/llc.cpp
  llvm/tools/llvm-jitlink/llvm-jitlink.h
  llvm/tools/llvm-mc-assemble-fuzzer/llvm-mc-assemble-fuzzer.cpp
  llvm/tools/llvm-mc-disassemble-fuzzer/llvm-mc-disassemble-fuzzer.cpp
  llvm/tools/opt/opt.cpp
  llvm/unittests/tools/llvm-mca/MCATestBase.h
  llvm/utils/TableGen/DecoderEmitter.cpp
  llvm/utils/TableGen/SubtargetEmitter.cpp
  mlir/lib/ExecutionEngine/ExecutionEngine.cpp
  openmp/libomptarget/plugins-nextgen/common/PluginInterface/JIT.cpp

Index: openmp/libomptarget/plugins-nextgen/common/PluginInterface/JIT.cpp
===
--- openmp/libomptarget/plugins-nextgen/common/PluginInterface/JIT.cpp
+++ openmp/libomptarget/plugins-nextgen/common/PluginInterface/JIT.cpp
@@ -23,7 +23,6 @@
 #include "llvm/IR/LegacyPassManager.h"
 #include "llvm/IRReader/IRReader.h"
 #include "llvm/InitializePasses.h"
-#include "llvm/MC/SubtargetFeature.h"
 #include "llvm/MC/TargetRegistry.h"
 #include "llvm/Object/IRObjectFile.h"
 #include "llvm/Passes/OptimizationLevel.h"
@@ -36,6 +35,7 @@
 #include "llvm/Support/raw_ostream.h"
 #include "llvm/Target/TargetMachine.h"
 #include "llvm/Target/TargetOptions.h"
+#include "llvm/TargetParser/SubtargetFeature.h"
 
 #include 
 #include 
Index: mlir/lib/ExecutionEngine/ExecutionEngine.cpp
===
--- mlir/lib/ExecutionEngine/ExecutionEngine.cpp
+++ mlir/lib/ExecutionEngine/ExecutionEngine.cpp
@@ -25,12 +25,12 @@
 #include "llvm/ExecutionEngine/Orc/JITTargetMachineBuilder.h"
 #include "llvm/ExecutionEngine/Orc/RTDyldObjectLinkingLayer.h"
 #include "llvm/IR/IRBuilder.h"
-#include "llvm/MC/SubtargetFeature.h"
 #include "llvm/MC/TargetRegistry.h"
 #include "llvm/Support/Debug.h"
 #include "llvm/Support/Error.h"
 #include "llvm/Support/ToolOutputFile.h"
 #include "llvm/TargetParser/Host.h"
+#include "llvm/TargetParser/SubtargetFeature.h"
 
 #define DEBUG_TYPE "execution-engine"
 
Index: llvm/utils/TableGen/SubtargetEmitter.cpp
===
--- llvm/utils/TableGen/SubtargetEmitter.cpp
+++ llvm/utils/TableGen/SubtargetEmitter.cpp
@@ -20,13 +20,13 @@
 #include "llvm/ADT/StringRef.h"
 #include "llvm/MC/MCInstrItineraries.h"
 #include "llvm/MC/MCSchedule.h"
-#include "llvm/MC/SubtargetFeature.h"
 #include "llvm/Support/Debug.h"
 #include "llvm/Support/Format.h"
 #include "llvm/Support/raw_ostream.h"
 #include "llvm/TableGen/Error.h"
 #include "llvm/TableGen/Record.h"
 #include 

[PATCH] D150549: Move SubtargetFeature.h from MC to TargetParser

2023-06-26 Thread Job Noorman via Phabricator via cfe-commits
jobnoorman updated this revision to Diff 534456.
jobnoorman added a comment.
Herald added a subscriber: wangpc.

Rebase


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D150549/new/

https://reviews.llvm.org/D150549

Files:
  clang/lib/CodeGen/BackendUtil.cpp
  clang/lib/Driver/ToolChains/AVR.cpp
  llvm/include/llvm/ExecutionEngine/Orc/JITTargetMachineBuilder.h
  llvm/include/llvm/MC/MCParser/MCTargetAsmParser.h
  llvm/include/llvm/MC/MCSubtargetInfo.h
  llvm/include/llvm/MC/SubtargetFeature.h
  llvm/include/llvm/Object/COFF.h
  llvm/include/llvm/Object/ELFObjectFile.h
  llvm/include/llvm/Object/GOFFObjectFile.h
  llvm/include/llvm/Object/MachO.h
  llvm/include/llvm/TargetParser/SubtargetFeature.h
  llvm/lib/CodeGen/CommandFlags.cpp
  llvm/lib/ExecutionEngine/TargetSelect.cpp
  llvm/lib/LTO/LTOBackend.cpp
  llvm/lib/LTO/LTOCodeGenerator.cpp
  llvm/lib/LTO/LTOModule.cpp
  llvm/lib/LTO/ThinLTOCodeGenerator.cpp
  llvm/lib/MC/CMakeLists.txt
  llvm/lib/MC/MCSubtargetInfo.cpp
  llvm/lib/MC/SubtargetFeature.cpp
  llvm/lib/Object/ELFObjectFile.cpp
  llvm/lib/Object/WasmObjectFile.cpp
  llvm/lib/Object/XCOFFObjectFile.cpp
  llvm/lib/Target/AArch64/AsmParser/AArch64AsmParser.cpp
  llvm/lib/Target/AArch64/Utils/AArch64BaseInfo.h
  llvm/lib/Target/AMDGPU/MCTargetDesc/R600MCCodeEmitter.cpp
  llvm/lib/Target/AMDGPU/MCTargetDesc/R600MCTargetDesc.cpp
  llvm/lib/Target/AMDGPU/MCTargetDesc/SIMCCodeEmitter.cpp
  llvm/lib/Target/ARM/ARMTargetTransformInfo.cpp
  llvm/lib/Target/ARM/ARMTargetTransformInfo.h
  llvm/lib/Target/ARM/AsmParser/ARMAsmParser.cpp
  llvm/lib/Target/ARM/Disassembler/ARMDisassembler.cpp
  llvm/lib/Target/ARM/MCTargetDesc/ARMInstPrinter.cpp
  llvm/lib/Target/ARM/Utils/ARMBaseInfo.h
  llvm/lib/Target/AVR/MCTargetDesc/AVRELFStreamer.cpp
  llvm/lib/Target/BPF/Disassembler/BPFDisassembler.cpp
  llvm/lib/Target/Hexagon/MCTargetDesc/HexagonMCCodeEmitter.h
  llvm/lib/Target/LoongArch/MCTargetDesc/LoongArchBaseInfo.h
  llvm/lib/Target/Mips/AsmParser/MipsAsmParser.cpp
  llvm/lib/Target/RISCV/MCTargetDesc/RISCVBaseInfo.h
  llvm/lib/Target/RISCV/MCTargetDesc/RISCVMatInt.h
  llvm/lib/Target/Sparc/MCTargetDesc/SparcMCCodeEmitter.cpp
  llvm/lib/Target/TargetMachineC.cpp
  llvm/lib/TargetParser/CMakeLists.txt
  llvm/lib/TargetParser/SubtargetFeature.cpp
  llvm/tools/llc/llc.cpp
  llvm/tools/llvm-jitlink/llvm-jitlink.h
  llvm/tools/llvm-mc-assemble-fuzzer/llvm-mc-assemble-fuzzer.cpp
  llvm/tools/llvm-mc-disassemble-fuzzer/llvm-mc-disassemble-fuzzer.cpp
  llvm/tools/opt/opt.cpp
  llvm/unittests/tools/llvm-mca/MCATestBase.h
  llvm/utils/TableGen/DecoderEmitter.cpp
  llvm/utils/TableGen/SubtargetEmitter.cpp
  mlir/lib/ExecutionEngine/ExecutionEngine.cpp
  openmp/libomptarget/plugins-nextgen/common/PluginInterface/JIT.cpp

Index: openmp/libomptarget/plugins-nextgen/common/PluginInterface/JIT.cpp
===
--- openmp/libomptarget/plugins-nextgen/common/PluginInterface/JIT.cpp
+++ openmp/libomptarget/plugins-nextgen/common/PluginInterface/JIT.cpp
@@ -23,7 +23,6 @@
 #include "llvm/IR/LegacyPassManager.h"
 #include "llvm/IRReader/IRReader.h"
 #include "llvm/InitializePasses.h"
-#include "llvm/MC/SubtargetFeature.h"
 #include "llvm/MC/TargetRegistry.h"
 #include "llvm/Object/IRObjectFile.h"
 #include "llvm/Passes/OptimizationLevel.h"
@@ -36,6 +35,7 @@
 #include "llvm/Support/raw_ostream.h"
 #include "llvm/Target/TargetMachine.h"
 #include "llvm/Target/TargetOptions.h"
+#include "llvm/TargetParser/SubtargetFeature.h"
 
 #include 
 #include 
Index: mlir/lib/ExecutionEngine/ExecutionEngine.cpp
===
--- mlir/lib/ExecutionEngine/ExecutionEngine.cpp
+++ mlir/lib/ExecutionEngine/ExecutionEngine.cpp
@@ -25,12 +25,12 @@
 #include "llvm/ExecutionEngine/Orc/JITTargetMachineBuilder.h"
 #include "llvm/ExecutionEngine/Orc/RTDyldObjectLinkingLayer.h"
 #include "llvm/IR/IRBuilder.h"
-#include "llvm/MC/SubtargetFeature.h"
 #include "llvm/MC/TargetRegistry.h"
 #include "llvm/Support/Debug.h"
 #include "llvm/Support/Error.h"
 #include "llvm/Support/ToolOutputFile.h"
 #include "llvm/TargetParser/Host.h"
+#include "llvm/TargetParser/SubtargetFeature.h"
 
 #define DEBUG_TYPE "execution-engine"
 
Index: llvm/utils/TableGen/SubtargetEmitter.cpp
===
--- llvm/utils/TableGen/SubtargetEmitter.cpp
+++ llvm/utils/TableGen/SubtargetEmitter.cpp
@@ -20,13 +20,13 @@
 #include "llvm/ADT/StringRef.h"
 #include "llvm/MC/MCInstrItineraries.h"
 #include "llvm/MC/MCSchedule.h"
-#include "llvm/MC/SubtargetFeature.h"
 #include "llvm/Support/Debug.h"
 #include "llvm/Support/Format.h"
 #include "llvm/Support/raw_ostream.h"
 #include "llvm/TableGen/Error.h"
 #include "llvm/TableGen/Record.h"
 #include "llvm/TableGen/TableGenBackend.h"
+#include "llvm/TargetParser/SubtargetFeature.h"
 #include 
 #include 
 #include 
Index: 

[PATCH] D150549: Move SubtargetFeature.h from MC to TargetParser

2023-05-31 Thread Job Noorman via Phabricator via cfe-commits
jobnoorman added a comment.

In D150549#4380786 , @MaskRay wrote:

> If we are certain this will not be reverted and cause churn, making the 
> header switch in one single patch looks fine to me...

Great. I'm not sure if we can ever be a 100% certain it will not get reverted. 
To increase our chances, I'll wait a bit before landing this. Does anyone else 
have thoughts about this patch?

> I have checked that this patch has migrated things that might be neglected: 
> `unittest` directories, openmp,mlir,clang, etc.

Thanks for checking this!


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D150549/new/

https://reviews.llvm.org/D150549

___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[PATCH] D150549: Move SubtargetFeature.h from MC to TargetParser

2023-05-30 Thread Fangrui Song via Phabricator via cfe-commits
MaskRay added a comment.

In D150549#4352174 , @jobnoorman 
wrote:

> In D150549#4351614 , @MaskRay wrote:
>
>> In D150549#4349531 , @jobnoorman 
>> wrote:
>>
>>> In D150549#4347056 , @MaskRay 
>>> wrote:
>>>
 This seems fine, but please consider making `MC/SubtargetFeature.h` a 
 forwarding header temporarily.
>>>
>>> To be clear: do you want me to check-in this forwarding header or should I 
>>> just do it locally for the tests below? If the former, what exactly is the 
>>> purpose of adding this header?
>>
>> The motivation is similar to https://reviews.llvm.org/D137838#3921828
>>
>>> That way, you don't have to update oodles of include lines in this patch, 
>>> and it makes it a bit easier to see what's going on. (You can then update 
>>> all the include lines in a trivial follow-up if this change goes through, 
>>> and then remove the forwarding headers in Support, to cut the dependency 
>>> you want to remove.)
>>
>> (There is a non-zero probability that the patch may miss something and get 
>> reverted. By creating a forwarding header we don't risk causing too much 
>> churn to the many files.)
>> For a large-scaling refactoring
>
> Thanks for the link! If I understand the discussion there correctly, the 
> motivation for adding the forwarding header was to not have to update any 
> `#include` sites directly in order to reduce the size of the patch. So what 
> you are asking me to do is
>
> 1. Update this patch to have a forwarding header and //not// change 
> `#include` sites;
> 2. Create a second patch that updates `#include`s and removes the forward. 
> This patch would be committed at some point in the future once we're sure the 
> move is fine.
>
> Is this correct?
>
> I do wonder if this is necessary in this case as the patch is much smaller 
> than the one in the link you shared.

If we are certain this will not be reverted and cause churn, making the header 
switch in one single patch looks fine to me...

I have checked that this patch has migrated things that might be neglected: 
`unittest` directories, openmp,mlir,clang, etc.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D150549/new/

https://reviews.llvm.org/D150549

___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[PATCH] D150549: Move SubtargetFeature.h from MC to TargetParser

2023-05-30 Thread Job Noorman via Phabricator via cfe-commits
jobnoorman added a comment.

Friendly ping. Any thoughts on my previous comment @MaskRay?


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D150549/new/

https://reviews.llvm.org/D150549

___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[PATCH] D150549: Move SubtargetFeature.h from MC to TargetParser

2023-05-18 Thread Job Noorman via Phabricator via cfe-commits
jobnoorman added a comment.

In D150549#4351614 , @MaskRay wrote:

> In D150549#4349531 , @jobnoorman 
> wrote:
>
>> In D150549#4347056 , @MaskRay 
>> wrote:
>>
>>> This seems fine, but please consider making `MC/SubtargetFeature.h` a 
>>> forwarding header temporarily.
>>
>> To be clear: do you want me to check-in this forwarding header or should I 
>> just do it locally for the tests below? If the former, what exactly is the 
>> purpose of adding this header?
>
> The motivation is similar to https://reviews.llvm.org/D137838#3921828
>
>> That way, you don't have to update oodles of include lines in this patch, 
>> and it makes it a bit easier to see what's going on. (You can then update 
>> all the include lines in a trivial follow-up if this change goes through, 
>> and then remove the forwarding headers in Support, to cut the dependency you 
>> want to remove.)
>
> (There is a non-zero probability that the patch may miss something and get 
> reverted. By creating a forwarding header we don't risk causing too much 
> churn to the many files.)
> For a large-scaling refactoring

Thanks for the link! If I understand the discussion there correctly, the 
motivation for adding the forwarding header was to not have to update any 
`#include` sites directly in order to reduce the size of the patch. So what you 
are asking me to do is

1. Update this patch to have a forwarding header and //not// change `#include` 
sites;
2. Create a second patch that updates `#include`s and removes the forward. This 
patch would be committed at some point in the future once we're sure the move 
is fine.

Is this correct?

I do wonder if this is necessary in this case as the patch is much smaller than 
the one in the link you shared.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D150549/new/

https://reviews.llvm.org/D150549

___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[PATCH] D150549: Move SubtargetFeature.h from MC to TargetParser

2023-05-17 Thread Fangrui Song via Phabricator via cfe-commits
MaskRay accepted this revision.
MaskRay added a comment.

In D150549#4349531 , @jobnoorman 
wrote:

> In D150549#4347056 , @MaskRay wrote:
>
>> This seems fine, but please consider making `MC/SubtargetFeature.h` a 
>> forwarding header temporarily.
>
> To be clear: do you want me to check-in this forwarding header or should I 
> just do it locally for the tests below? If the former, what exactly is the 
> purpose of adding this header?

The motivation is similar to https://reviews.llvm.org/D137838#3921828

> That way, you don't have to update oodles of include lines in this patch, and 
> it makes it a bit easier to see what's going on. (You can then update all the 
> include lines in a trivial follow-up if this change goes through, and then 
> remove the forwarding headers in Support, to cut the dependency you want to 
> remove.)

(There is a non-zero probability that the patch may miss something and get 
reverted. By creating a forwarding header we don't risk causing too much churn 
to the many files.)
For a large-scaling refactoring

>> Our official build system CMake doesn't do layering checking for headers 
>> (https://llvm.org/docs/CodingStandards.html#library-layering).
>>
>> Our unofficial build system Bazel supports layering checking 
>> . You may edit 
>> `utils/bazel/llvm-project-overlay/llvm/BUILD.bazel` and see whether bazel 
>> reports a circular dependency. I think this patch is fine, but just in case.
>
> I did the following:
>
> - Add the forwarding header
> - Update `BUILD.bazel` (I only had to add the `TargetParser` dependency to 
> `llvm-tblgen` to make this work; should I add this change to this patch?)
> - Run `bazel build '@llvm-project//llvm:all'` (using `clang` from `main`).
>
> This worked fine. Is this what you meant with the circular dependency check? 
> (I'm not familiar with bazel so I might be missing something.)

Thank you for verification. Then I think this is good. `layering_check` is the 
default, so this verifies that we are good.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D150549/new/

https://reviews.llvm.org/D150549

___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[PATCH] D150549: Move SubtargetFeature.h from MC to TargetParser

2023-05-17 Thread Job Noorman via Phabricator via cfe-commits
jobnoorman added a comment.

In D150549#4347056 , @MaskRay wrote:

> This seems fine, but please consider making `MC/SubtargetFeature.h` a 
> forwarding header temporarily.

To be clear: do you want me to check-in this forwarding header or should I just 
do it locally for the tests below? If the former, what exactly is the purpose 
of adding this header?

> Our official build system CMake doesn't do layering checking for headers 
> (https://llvm.org/docs/CodingStandards.html#library-layering).
>
> Our unofficial build system Bazel supports layering checking 
> . You may edit 
> `utils/bazel/llvm-project-overlay/llvm/BUILD.bazel` and see whether bazel 
> reports a circular dependency. I think this patch is fine, but just in case.

I did the following:

- Add the forwarding header
- Update `BUILD.bazel` (I only had to add the `TargetParser` dependency to 
`llvm-tblgen` to make this work; should I add this change to this patch?)
- Run `bazel build '@llvm-project//llvm:all'` (using `clang` from `main`).

This worked fine. Is this what you meant with the circular dependency check? 
(I'm not familiar with bazel so I might be missing something.)


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D150549/new/

https://reviews.llvm.org/D150549

___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[PATCH] D150549: Move SubtargetFeature.h from MC to TargetParser

2023-05-16 Thread Fangrui Song via Phabricator via cfe-commits
MaskRay added a comment.

This seems fine, but please consider making `MC/SubtargetFeature.h` a 
forwarding header temporarily.

Our official build system CMake doesn't do layering checking for headers 
(https://llvm.org/docs/CodingStandards.html#library-layering).

Our unofficial build system Bazel supports layering checking 
. You may edit 
`utils/bazel/llvm-project-overlay/llvm/BUILD.bazel` and see whether bazel 
reports a circular dependency. I think this patch is fine, but just in case.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D150549/new/

https://reviews.llvm.org/D150549

___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[PATCH] D150549: Move SubtargetFeature.h from MC to TargetParser

2023-05-16 Thread Lang Hames via Phabricator via cfe-commits
lhames added a comment.

FWIW I'm in favor of this: as @jobnoorman mentioned it'd eliminate JITLink's 
library dependence on MC.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D150549/new/

https://reviews.llvm.org/D150549

___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[PATCH] D150549: Move SubtargetFeature.h from MC to TargetParser

2023-05-15 Thread Job Noorman via Phabricator via cfe-commits
jobnoorman created this revision.
jobnoorman added reviewers: chandlerc, grosbach, andreadb, MaskRay, 
craig.topper.
Herald added subscribers: bviyer, asb, luke, Moerafaat, zero9178, bzcheeseman, 
pmatos, sdasgup3, wenzhicui, wrengr, ormris, foad, cota, teijeong, frasercrmck, 
rdzhabarov, tatianashp, msifontes, jurahul, Kayjukh, grosul1, Joonsoo, kerbowa, 
liufengdb, aartbik, mgester, arpith-jacob, csigg, antiagainst, shauheen, 
rriddle, mehdi_amini, luismarques, apazos, sameer.abuasal, s.egerton, Jim, 
jocewei, PkmX, the_o, brucehoult, MartinMosbeck, rogfer01, steven_wu, 
atanasyan, edward-jones, zzheng, jrtc27, gbedwell, niosHD, sabuasal, simoncook, 
johnrusso, rbar, fedor.sergeev, hiraditya, arichardson, sbc100, jvesely, 
sdardis, dylanmckay, jyknight, arsenm.
Herald added a project: All.
jobnoorman requested review of this revision.
Herald added subscribers: llvm-commits, openmp-commits, cfe-commits, 
pcwang-thead, stephenneuendorffer, nicolasvasilache, aheejin.
Herald added projects: clang, OpenMP, MLIR, LLVM.

SubtargetFeature.h is currently part of MC while it doesn't depend on
anything in MC. Since some LLVM components might have the need to work
with target features without necessarily needing MC, it might be
worthwhile to move SubtargetFeature.h to a different location. This will
reduce the dependencies of said components.

Note that I choose TargetParser as the destination because that's where
Triple lives and SubtargetFeatures feels related to that. Suggestions
for alternative locations are welcome.

This issues came up during a JITLink review (D149522 
). JITLink would
like to avoid a dependency on MC while still needing to store target
features.

I'm not entirely sure who should review this patch so please add more
reviewers if necessary.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D150549

Files:
  clang/lib/CodeGen/BackendUtil.cpp
  clang/lib/Driver/ToolChains/AVR.cpp
  llvm/include/llvm/ExecutionEngine/Orc/JITTargetMachineBuilder.h
  llvm/include/llvm/MC/MCParser/MCTargetAsmParser.h
  llvm/include/llvm/MC/MCSubtargetInfo.h
  llvm/include/llvm/MC/SubtargetFeature.h
  llvm/include/llvm/Object/COFF.h
  llvm/include/llvm/Object/ELFObjectFile.h
  llvm/include/llvm/Object/GOFFObjectFile.h
  llvm/include/llvm/Object/MachO.h
  llvm/include/llvm/TargetParser/SubtargetFeature.h
  llvm/lib/CodeGen/CommandFlags.cpp
  llvm/lib/ExecutionEngine/TargetSelect.cpp
  llvm/lib/LTO/LTOBackend.cpp
  llvm/lib/LTO/LTOCodeGenerator.cpp
  llvm/lib/LTO/LTOModule.cpp
  llvm/lib/LTO/ThinLTOCodeGenerator.cpp
  llvm/lib/MC/CMakeLists.txt
  llvm/lib/MC/MCSubtargetInfo.cpp
  llvm/lib/MC/SubtargetFeature.cpp
  llvm/lib/Object/ELFObjectFile.cpp
  llvm/lib/Object/WasmObjectFile.cpp
  llvm/lib/Object/XCOFFObjectFile.cpp
  llvm/lib/Target/AArch64/AsmParser/AArch64AsmParser.cpp
  llvm/lib/Target/AArch64/Utils/AArch64BaseInfo.h
  llvm/lib/Target/AMDGPU/MCTargetDesc/R600MCCodeEmitter.cpp
  llvm/lib/Target/AMDGPU/MCTargetDesc/R600MCTargetDesc.cpp
  llvm/lib/Target/AMDGPU/MCTargetDesc/SIMCCodeEmitter.cpp
  llvm/lib/Target/ARM/ARMTargetTransformInfo.cpp
  llvm/lib/Target/ARM/ARMTargetTransformInfo.h
  llvm/lib/Target/ARM/AsmParser/ARMAsmParser.cpp
  llvm/lib/Target/ARM/Disassembler/ARMDisassembler.cpp
  llvm/lib/Target/ARM/MCTargetDesc/ARMInstPrinter.cpp
  llvm/lib/Target/ARM/Utils/ARMBaseInfo.h
  llvm/lib/Target/AVR/MCTargetDesc/AVRELFStreamer.cpp
  llvm/lib/Target/BPF/Disassembler/BPFDisassembler.cpp
  llvm/lib/Target/Hexagon/MCTargetDesc/HexagonMCCodeEmitter.h
  llvm/lib/Target/LoongArch/MCTargetDesc/LoongArchBaseInfo.h
  llvm/lib/Target/Mips/AsmParser/MipsAsmParser.cpp
  llvm/lib/Target/RISCV/MCTargetDesc/RISCVBaseInfo.h
  llvm/lib/Target/RISCV/MCTargetDesc/RISCVMatInt.h
  llvm/lib/Target/Sparc/MCTargetDesc/SparcMCCodeEmitter.cpp
  llvm/lib/Target/TargetMachineC.cpp
  llvm/lib/TargetParser/CMakeLists.txt
  llvm/lib/TargetParser/SubtargetFeature.cpp
  llvm/tools/llc/llc.cpp
  llvm/tools/llvm-jitlink/llvm-jitlink.h
  llvm/tools/llvm-mc-assemble-fuzzer/llvm-mc-assemble-fuzzer.cpp
  llvm/tools/llvm-mc-disassemble-fuzzer/llvm-mc-disassemble-fuzzer.cpp
  llvm/tools/opt/opt.cpp
  llvm/unittests/tools/llvm-mca/MCATestBase.h
  llvm/utils/TableGen/DecoderEmitter.cpp
  llvm/utils/TableGen/SubtargetEmitter.cpp
  mlir/lib/ExecutionEngine/ExecutionEngine.cpp
  openmp/libomptarget/plugins-nextgen/common/PluginInterface/JIT.cpp

Index: openmp/libomptarget/plugins-nextgen/common/PluginInterface/JIT.cpp
===
--- openmp/libomptarget/plugins-nextgen/common/PluginInterface/JIT.cpp
+++ openmp/libomptarget/plugins-nextgen/common/PluginInterface/JIT.cpp
@@ -23,7 +23,6 @@
 #include "llvm/IR/LegacyPassManager.h"
 #include "llvm/IRReader/IRReader.h"
 #include "llvm/InitializePasses.h"
-#include "llvm/MC/SubtargetFeature.h"
 #include "llvm/MC/TargetRegistry.h"
 #include "llvm/Object/IRObjectFile.h"
 #include