[llvm-dev] Querying IRTranslator value mapping results
Quentin Colombet via llvm-dev
llvm-dev at lists.llvm.org
Wed Jul 21 09:56:50 PDT 2021
Hi Alex,
I’ve already pointed this out in https://reviews.llvm.org/D101538 <https://reviews.llvm.org/D101538>, but I suggest that you look at how DBG_VALUEs are generated. You may be able to design something that fit your needs by mimicking that or just piggybacking on the debug information.
See https://llvm.org/docs/SourceLevelDebugging.html#how-variable-location-metadata-is-transformed-during-codegen <https://llvm.org/docs/SourceLevelDebugging.html#how-variable-location-metadata-is-transformed-during-codegen> for more details.
Cheers,
-Quentin
> On Jul 19, 2021, at 8:13 AM, Bezzubikov, Aleksandr via llvm-dev <llvm-dev at lists.llvm.org <mailto:llvm-dev at lists.llvm.org>> wrote:
>
> Gentle ping
>
> Thanks,
> Alex
>
> From: Aleksandr Bezzubikov <zuban32s at gmail.com <mailto:zuban32s at gmail.com>>
> Sent: Monday, July 12, 2021 5:25 PM
> To: llvm-dev at lists.llvm.org <mailto:llvm-dev at lists.llvm.org>; quentin.colombet at gmail.com <mailto:quentin.colombet at gmail.com>; jay.foad at gmail.com <mailto:jay.foad at gmail.com>; Matthew.Arsenault at amd.com <mailto:Matthew.Arsenault at amd.com>
> Cc: Bezzubikov, Aleksandr <aleksandr.bezzubikov at intel.com <mailto:aleksandr.bezzubikov at intel.com>>
> Subject: Querying IRTranslator value mapping results
>
> Hi llvm-dev,
>
> I have the following problem - I want to generate a target instruction which denotes LLVM type of a value and its argument should be the value's vreg. Correct me if I'm wrong, the only stage I can do that at is IRTranslator since later we don't have any access to LLVM values at all, but IRTranslator's VMap is private and no other way to access such info exists.
>
> In this review https://reviews.llvm.org/D101538 <https://reviews.llvm.org/D101538> it was already discussed that overriding translate() methods is not good enough, can you suggest other ways of coping with that?
>
> I thought about extending GISelObserver with a new event, something like 'VRegCreated(Value*,VReg), what do you think? Or perhaps some TTI hook called within translate/getOrCreateVRegs.
>
> I've tried approaches with target pseudo intrinsics and extra IR passes, but still everything depends on missing the external (relatively to the IRTranslator) way to obtain the info about Value->Vreg mapping.
>
> Thanks,
> Alex
> _______________________________________________
> LLVM Developers mailing list
> llvm-dev at lists.llvm.org <mailto:llvm-dev at lists.llvm.org>
> https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-dev <https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-dev>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20210721/1312f489/attachment.html>
More information about the llvm-dev
mailing list