<div dir="ltr">I think Craig's point was that moving machine passes to the new PM hasn't even started. MachineFunctions, MachineModuleInfo, none of it is going to work.<div><br></div><div>But you also don't need it to work. `-fexperimental-new-pass-manager` only enables the new PM for the IR pipeline. The machine passes and all of the code generator are handled independently.</div></div><br><div class="gmail_quote"><div dir="ltr">On Tue, Jan 8, 2019 at 10:52 AM Leonard Chan via llvm-dev <<a href="mailto:llvm-dev@lists.llvm.org">llvm-dev@lists.llvm.org</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">I made a second MachineFunctionPass that can run on new PM and made it<br>
similar to the MachineFunctionPass for legacy PM. It seemed that the<br>
only required analysis used by it was MachineModuleInfo which I also<br>
made a new PM analysis for by separating it into 2 classes: 1 that<br>
holds the meta information specific to a module, and 1 that's the pass<br>
which holds an instance to the first class. The new PM analysis holds<br>
an instance of this first class also. I'm not sure though if there are<br>
new PM equivalents for the addPreserved analyses that<br>
MachineFunctionPass has under it's getAnalysisUsage.<br>
<br>
I can't figure out though how to port ShadowCallStack specifically,<br>
assuming I completed all the necessary work for enabling<br>
MachineFunctionPass in new PM, but I imagine that I may have missed a<br>
few things that I didn't account for. I can share what I have<br>
currently if you would like to see.<br>
<br>
- Leonard<br>
<br>
On Tue, Jan 8, 2019 at 10:37 AM Craig Topper <<a href="mailto:craig.topper@gmail.com" target="_blank">craig.topper@gmail.com</a>> wrote:<br>
><br>
> Isn't ShadowCallStack a MachineFunctionPass? Machine IR doesn't use the new PM yet.<br>
><br>
> ~Craig<br>
><br>
><br>
> On Tue, Jan 8, 2019 at 10:30 AM Leonard Chan via llvm-dev <<a href="mailto:llvm-dev@lists.llvm.org" target="_blank">llvm-dev@lists.llvm.org</a>> wrote:<br>
>><br>
>> Hi all,<br>
>><br>
>> I'm in the process of trying to port ShadowCallStack from the legacy<br>
>> pass manager to the new one. I ran into an issue though where it seems<br>
>> I cannot link against anything I added in ShadowCallStack.cpp when<br>
>> trying to build c-index-test (via just running ninja check-all). I<br>
>> think the reason for this is because nothing under lib/Target/X86/ is<br>
>> a part of any library compiled with c-index-test (if I'm reading the<br>
>> CMake correctly). I imagine this would also mean I wouldn't be able to<br>
>> successfully build other binaries like clang.<br>
>><br>
>> What I want to know is if there is a proper way to link against code<br>
>> under lib/Target/X86/ (as a part of some shared library or through<br>
>> some other means) such that i could use it with the new pass manager.<br>
>><br>
>> These are some other thoughts I had attempting to find a possible solution:<br>
>> - I could not find an instance of classes under lib/Target/X86/ (or<br>
>> any other target for that matter) that are used or exposed by anything<br>
>> outside of lib/Target/<br>
>> - The only things that seem exposed under lib/Target/ are a few files<br>
>> packed into libLLVMTarget.a and none of it is linked against source<br>
>> files under llvm/Target/<TARGET><br>
>> - If ShadowCallStack is meant to be a pass that should eventually work<br>
>> for any target, at some point it could be pulled out from the X86<br>
>> directory and also be included in libLLVMTarget.a, but I'm not sure<br>
>> how the CMake dependency hierarchy would support this.<br>
>><br>
>> Thanks,<br>
>> Leonard<br>
>> _______________________________________________<br>
>> LLVM Developers mailing list<br>
>> <a href="mailto:llvm-dev@lists.llvm.org" target="_blank">llvm-dev@lists.llvm.org</a><br>
>> <a href="http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-dev" rel="noreferrer" target="_blank">http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-dev</a><br>
_______________________________________________<br>
LLVM Developers mailing list<br>
<a href="mailto:llvm-dev@lists.llvm.org" target="_blank">llvm-dev@lists.llvm.org</a><br>
<a href="http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-dev" rel="noreferrer" target="_blank">http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-dev</a><br>
</blockquote></div>