GH-135379: Support limited scalar replacement for replicated uops in the JIT code generator. (GH-135563)

* Use it to support efficient specializations of COPY and SWAP in the JIT.
This commit is contained in:
Mark Shannon 2025-06-17 13:43:09 +01:00 committed by GitHub
parent a9e66a7c50
commit 8dd8b5c2f0
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
9 changed files with 313 additions and 198 deletions

View file

@ -379,9 +379,13 @@ class Parser(PLexer):
while anno := self.expect(lx.ANNOTATION):
if anno.text == "replicate":
self.require(lx.LPAREN)
times = self.require(lx.NUMBER)
stop = self.require(lx.NUMBER)
start_text = "0"
if self.expect(lx.COLON):
start_text = stop.text
stop = self.require(lx.NUMBER)
self.require(lx.RPAREN)
annotations.append(f"replicate({times.text})")
annotations.append(f"replicate({start_text}:{stop.text})")
else:
annotations.append(anno.text)
tkn = self.expect(lx.INST)