[llvm] [TableGen][GISel] Import frameindex correctly (PR #120921)

Sergei Barannikov via llvm-commits llvm-commits at lists.llvm.org
Sun Dec 22 21:17:38 PST 2024


================
@@ -1248,10 +1244,6 @@ Expected<action_iterator> GlobalISelEmitter::importExplicitUseRenderer(
       DstMIBuilder.addRenderer<CopyRenderer>(Dst.getName());
       return InsertPt;
     }
-    if (Dst.getOperator()->getName() == "tframeindex") {
----------------
s-barannikov wrote:

I'm not sure. Technically, yes, it would match the behavior of SelectionDAG.
On the other hand, there are no strict equivalent of `frameindex` / `tframeindex` in GISel. There is just one `G_FRAME_INDEX`, which behaves more like `G_CONSTANT` in that it is a separate instruction rather than just a flavor of machine operand. The same is true for G_GLOBAL_VALUE, G_CONSTANT_POOL, maybe some others.

Adding CopyRenderer is the default behavior that should be taken if a node doesn't require a special treatment. That is, the check above and the removed check are just whitelisting supported leaf-like nodes. So, if we want to allow this node, the check should be kept. If we want to make it clear that the node is unsupported, it should be removed. I have no strong preference.


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


More information about the llvm-commits mailing list