Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Armv7m: Fix stm/ldm #159

Open
wants to merge 3 commits into
base: main
Choose a base branch
from
Open

Conversation

dop-amin
Copy link
Collaborator

  • stm was using the wrong registers to write to the reg list
  • stm/ldm did not set obj.address so the selftest failed because the pointer could not be indentified
  • Add an example to use/not use the splitting on the same piece of code to actually trigger ldm+stm

* stm was using the wrong registers to write to the reg list
* stm/ldm did not set obj.address so the selftest failed because the pointer could not be indentified
* Add an example to use/not use the splitting on the same piece of code to actually trigger ldm+stm
@mkannwischer
Copy link
Collaborator

* Example: add_kyber_m7 (dry run only)...
  File "/home/runner/work/slothy/slothy/example.py", line 2978, in <module>
    main()
  File "/home/runner/work/slothy/slothy/example.py", line 2971, in main
    run_example(e, debug=args.debug, dry_run=args.dry_run,
  File "/home/runner/work/slothy/slothy/example.py", line 2967, in run_example
    ex.run(**kwargs)
  File "/home/runner/work/slothy/slothy/example.py", line 165, in run
    self.core(slothy, *self.extra_args)
  File "/home/runner/work/slothy/slothy/example.py", line 2330, in core
    slothy.fusion_loop("1", ssa=False)
  File "/home/runner/work/slothy/slothy/slothy/core/slothy.py", line 462, in fusion_loop
    SourceLine.apply_indentation(self._fusion_core(pre, body, post, logger, **kwargs), indentation) + \
                                 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/runner/work/slothy/slothy/slothy/core/slothy.py", line 414, in _fusion_core
    dfg.apply_fusion_cbs()
  File "/home/runner/work/slothy/slothy/slothy/core/dataflow.py", line 579, in apply_fusion_cbs
    return self.apply_cbs(fusion_cb, logger, one_a_time=True)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/runner/work/slothy/slothy/slothy/core/dataflow.py", line 519, in apply_cbs
    if cb(t):
       ^^^^^
  File "/home/runner/work/slothy/slothy/slothy/core/dataflow.py", line 578, in fusion_cb
    return t.inst.global_fusion_cb(t, log=logger.info)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/runner/work/slothy/slothy/slothy/targets/arm_v7m/arch_v7m.py", line 2005, in core
    ptr = inst.args_in_out[0]
          ~~~~~~~~~~~~~~~~^^^

I'm not sure why this is failing now. Is something rewriting those arguments? args_in_out[0] does look correct to me....

@dop-amin
Copy link
Collaborator Author

In my PR I set the obj.addr correctly in order for the selftest to recognize the pointer.
This will trigger ldm being affected by fixup.
This will make inst.args_in_out empty.
This makes the fusion fail as inst.args_in_out is used there.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants