[PATCH] D151945: Introduce G_CONSTANT_FOLD_BARRIER and use it to prevent constant folding hoisted constants.

Amara Emerson via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri Jun 9 11:19:06 PDT 2023


aemerson added inline comments.


================
Comment at: llvm/lib/Target/AArch64/GISel/AArch64LegalizerInfo.cpp:85
+  getActionDefinitionsBuilder(
+      {G_IMPLICIT_DEF, G_FREEZE, G_CONSTANT_FOLD_BARRIER})
       .legalFor({p0, s8, s16, s32, s64})
----------------
arsenm wrote:
> aemerson wrote:
> > Pierre-vh wrote:
> > > Will other targets (e.g. AMDGPU) need this?
> > Maybe, but I'd like to leave that to AMDGPU maintainers to decide how to legalize this. I'm not even sure of constant hoisting is used for AMDGPU.
> It's a bit obnoxious to have to add this to every target's legalize rules. Should probably have a default lower action that just deletes it.
Yes, agreed. Default rules have been something I've wanted for ages.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D151945



More information about the llvm-commits mailing list