[PATCH] D101538: [GlobalISel][IRTranslator] Make translate() methods virtual.

Aleksandr Bezzubikov via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Jul 8 17:08:04 PDT 2021


zuban32 added a comment.

@qcolombet @arsenm @foad this change is already abandoned, but my question seems directly related to it.

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. And we've already discussed here that overriding translate() methods is not good enough, what other ways of coping with that can you suggest?

I thought about extending GISelObserver with 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.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D101538



More information about the llvm-commits mailing list