This is an archive of the discontinued LLVM Phabricator instance.

[GC][NFC] Move GCStrategy from CodeGen to IR
ClosedPublic

Authored by mkazantsev on Apr 15 2021, 6:49 AM.

Details

Summary

We want it to be available in analyzes so that we could use the
CodeGen notion in middle-end passes (for example, to check if
a GC may free some particular pointer).

This is a preparatory patch that simply moves the files around.

Diff Detail

Event Timeline

mkazantsev created this revision.Apr 15 2021, 6:49 AM
mkazantsev requested review of this revision.Apr 15 2021, 6:49 AM
Herald added a project: Restricted Project. · View Herald TranscriptApr 15 2021, 6:49 AM
mkazantsev planned changes to this revision.Apr 15 2021, 10:15 PM

It's neded in IR, not even in analysis...

mkazantsev retitled this revision from [GC][NFC] Move GCStrategy from CodeGen to Analysis to [GC][NFC] Move GCStrategy from CodeGen to IR.

Max, thank for you doing this. I think this is a really good idea.

I had tried this once before and ran into trouble with the build bots. Have you built this with both static and dynamic build modes? I forget which one bit me last time, but we had to revert for some reason. You can probably find the reverting commit by looking at history.

I vaguely remember the problem being something about the registery mechanism and circular build dependencies, but its been a very long time since I've thought about this.

If you can confirm that problem no longer exists, this will be an easy LGTM.

llvm/include/llvm/CodeGen/LinkAllCodegenComponents.h
17

Remember to sort the headers.

mkazantsev planned changes to this revision.Apr 18 2021, 11:03 PM

No idea how to check this. I'll better start with getting rid of these static initializers which look like unneeded complication.

mkazantsev abandoned this revision.Apr 19 2021, 8:32 AM
mkazantsev reclaimed this revision.Apr 30 2021, 2:01 AM
mkazantsev planned changes to this revision.

Planning to do this, need to address Philip's concern.

mkazantsev requested review of this revision.May 12 2021, 12:41 AM

I made a default build and dynamic build with options

-DLLVM_BUILD_LLVM_DYLIB=On
-DLLVM_LINK_LLVM_DYLIB=On

And also clang&polly build with these options. All of them passed make check tests. So I hope it should work.

Let's try it out.

reames accepted this revision.May 12 2021, 8:03 AM

LGTM

Please wait several days after landing this before landing follow up changes. I'm half expecting we'll have to revert.

This revision is now accepted and ready to land.May 12 2021, 8:03 AM

Okay, thanks Philip!

This revision was landed with ongoing or failed builds.May 12 2021, 10:32 PM
This revision was automatically updated to reflect the committed changes.