Use TBAA metadata to tell LLVM about the (lack of) aliasing between attribute #132

Open
opened 2021-12-13 19:30:52 +08:00 by sb10q · 0 comments
Owner

From https://github.com/m-labs/artiq/issues/624

Test case ported to NAC3:

from numpy import int64
from min_artiq import *

@nac3
class Demo:
    core: Kernel[Core]
    led0: Kernel[TTLOut]
    optt: Kernel[float]
    t_mu: Kernel[int64]

    def __init__(self):
        self.core = Core()
        self.led0 = TTLOut(self.core, 18)
        self.optt = 0.0
        self.t_mu = int64(0)

    @kernel
    def set_time_kernel(self, t: float):
        self.optt = t
        self.t_mu = self.core.seconds_to_mu(self.optt)

    @kernel
    def run(self):
        for t in [20.*us, 15.*us, 10.*us, 5.*us, 2.*us, 1.*us]:
            self.set_time_kernel(t)
            self.core.reset()
            for _ in range(10000):
                self.led0.pulse(self.optt)


if __name__ == "__main__":
    Demo().run()
From https://github.com/m-labs/artiq/issues/624 Test case ported to NAC3: ```python from numpy import int64 from min_artiq import * @nac3 class Demo: core: Kernel[Core] led0: Kernel[TTLOut] optt: Kernel[float] t_mu: Kernel[int64] def __init__(self): self.core = Core() self.led0 = TTLOut(self.core, 18) self.optt = 0.0 self.t_mu = int64(0) @kernel def set_time_kernel(self, t: float): self.optt = t self.t_mu = self.core.seconds_to_mu(self.optt) @kernel def run(self): for t in [20.*us, 15.*us, 10.*us, 5.*us, 2.*us, 1.*us]: self.set_time_kernel(t) self.core.reset() for _ in range(10000): self.led0.pulse(self.optt) if __name__ == "__main__": Demo().run() ```
sb10q added the
low-priority
label 2021-12-13 20:19:38 +08:00
Sign in to join this conversation.
No Milestone
No Assignees
1 Participants
Notifications
Due Date
The due date is invalid or out of range. Please use the format 'yyyy-mm-dd'.

No due date set.

Dependencies

No dependencies set.

Reference: M-Labs/nac3#132
No description provided.