mirror of
https://github.com/python/cpython.git
synced 2025-08-04 17:08:35 +00:00
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:
parent
a9e66a7c50
commit
8dd8b5c2f0
9 changed files with 313 additions and 198 deletions
|
@ -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)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue