[PATCH] D150179: [GlobalISel] Hide hoisted constants behind G_BITCAST to prevent folding.

Amara Emerson via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue May 9 10:06:17 PDT 2023


aemerson added a comment.

In D150179#4328938 <https://reviews.llvm.org/D150179#4328938>, @arsenm wrote:

> Seems like this is another one of those DAG workaround passes we ideally wouldn't need to keep running

I thought so too, but reading its documentation more I think the problem it's solving is actually agnostic to selectors. That is, the core issue isn't that DAG can only see basic blocks, but one of balancing CSE & register pressure. We could stop running this IR pass (which does exist as IR due to SDAG's nature), but we'd just need to implement something similar in the GISel pipeline anyway.



================
Comment at: llvm/test/CodeGen/AArch64/GlobalISel/irtranslator-hoisted-constants.ll:29
+entry:
+  %hc = bitcast i32 100000 to i32
+  br label %cont
----------------
arsenm wrote:
> Also add some vector cases?
Good point, constant hoisting doesn't touch vector constants so we can avoid this bitcast trickery for those.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D150179



More information about the llvm-commits mailing list