Page MenuHomePhabricator

[globalisel][tablegen] Import stores and allow GISel to automatically substitute zero regs like WZR/XZR/$zero.
Needs ReviewPublic

Authored by dsanders on Oct 20 2017, 4:46 PM.



This patch enables the import of stores. Unfortunately, doing so by itself,
loses an optimization where storing 0 to memory makes use of WZR/XZR.

To mitigate this, this patch also introduces a new feature that allows register
classes to nominate a zero register. When this is done, GlobalISel will
substitute (G_CONSTANT 0) with the nominated register automatically

Event Timeline

dsanders created this revision.Oct 20 2017, 4:46 PM

There's two patches in one here and I'm going to try and extract the stores portion of the patch and commit that separately if I can find a reasonable way to do so without causing regressions. The main purpose of this review is to determine whether we agree it's safe to allow the new GIZeroRegister on GPR32/GPR64/GPR32all/GPR64all. I think it's probably ok, but I don't feel I have sufficient knowledge of AArch64 to make such a sweeping change without someone more familiar with it giving it the go ahead.

dsanders updated this revision to Diff 119912.Oct 23 2017, 12:23 PM

Reduce patch to just the bit about applying this to GPR32/GPR64/GPR32all/
GPR64all. I found a way to constrain the original to just the relevant stores.