[llvm] [X86][GlobalISel] Enable G_BUILD_VECTOR and G_CONSTANT_POOL (PR #92844)

Evgenii Kudriashov via llvm-commits llvm-commits at lists.llvm.org
Wed May 22 19:42:33 PDT 2024


================
@@ -505,6 +505,9 @@ bool X86PassConfig::addRegBankSelect() {
 
 bool X86PassConfig::addGlobalInstructionSelect() {
   addPass(new InstructionSelect(getOptLevel()));
+  // Add GlobalBaseReg in case there is no SelectionDAG passes afterwards
+  if (isGlobalISelAbortEnabled())
----------------
e-kud wrote:

I don't know what is better actually. The problem is that this pass is added by SelectionDAG
```cpp
bool X86PassConfig::addInstSelector() {
  // Install an instruction selector.
  addPass(createX86ISelDag(getX86TargetMachine(), getOptLevel()));
  // For ELF, cleanup any local-dynamic TLS accesses.
  if (TM->getTargetTriple().isOSBinFormatELF() &&
      getOptLevel() != CodeGenOptLevel::None)
    addPass(createCleanupLocalDynamicTLSPass());
  addPass(createX86GlobalBaseRegPass());
  addPass(createX86ArgumentStackSlotPass());
  return false;
}
```
I see three options:
1) Add the same pass twice, however one is enough
2) Add only once depending on which selector is the last (this was implemented)
3) Extract this pass from selectors in general pipeline (I haven't tried), but it looks like this pass fixes instruction selection and should go close to it.

https://github.com/llvm/llvm-project/pull/92844


More information about the llvm-commits mailing list