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

Not Staging Return Value of IfThenElse #271

Open
mattfel1 opened this issue Sep 28, 2019 · 0 comments
Open

Not Staging Return Value of IfThenElse #271

mattfel1 opened this issue Sep 28, 2019 · 0 comments

Comments

@mattfel1
Copy link
Member

I'm not sure why it isn't staging the if branch's return of raw, or why it at least doesn't crash because the branches return different types (Void and I16). This eventually causes a crash in a post-unrolling TransientCleanup pass. I'm going to just rewrite the app for now, but it should at least have a rule in the sanity check if one branch of the IfThenElse/Switch doesn't return the correct type?

The app has:

      val raw = fifo.deq()
      val data = if (condition) {reg := raw; raw} else reg.value

Which becomes:

                    x21 = IfThenElse(x18,Block(x16),Block(x20)) {
                     - Name: data
                     - Type: Fix[TRUE,_16,_0]
                     - SrcCtx: DownUpSample.scala:106:29
                     - class spatial.metadata.control.ScopeCtrl: ScopeCtrl(x25 (scope: 0, 0))
                     - class spatial.metadata.control.ParentCtrl: ParentCtrl(x25 (stage: -1))
                     - class argon.Effects: (unique=true, reads={x15}, writes={x15})
                     - class argon.Consumers: Consumers(Set(x23, x25))
                     - class spatial.metadata.control.Children: Children(ArrayBuffer())
                     - class spatial.metadata.control.DefiningBlk: DefiningBlk(x25 (block: 0))
                     - class spatial.metadata.access.ReadUses: ReadUses(Set(x16, x20))
                     - class spatial.metadata.control.ControlLevel: ControlLevel(InnerControl)
                     - class argon.ShallowAliases: ShallowAliases(Set(x21))
                     - class argon.DeepAliases: DeepAliases(Set())
                    binds: 
                      block 0: Block(x16) {
                        effects:  (reads={x15}, writes={x15})
                          x19 = RegWrite(x15,x16,Set())
                           - Type: Void
                           - SrcCtx: DownUpSample.scala:106:29
                           - class argon.Effects: (reads={x15}, writes={x15})
                           - class argon.Consumers: Consumers(Set(x21))
                           - class spatial.metadata.control.DefiningBlk: DefiningBlk(x21 (block: 0))
                           - class spatial.metadata.access.ReadUses: ReadUses(Set(x16))
                           - class argon.ShallowAliases: ShallowAliases(Set(x19))
                           - class argon.DeepAliases: DeepAliases(Set())
                      } // End of x21 block #0
                      block 1: Block(x20) {
                        effects:  (unique=true, reads={x15})
                          x20 = RegRead(x15)
                           - Type: Fix[TRUE,_16,_0]
                           - SrcCtx: DownUpSample.scala:106:29
                           - class argon.Effects: (unique=true, reads={x15})
                           - class argon.Consumers: Consumers(Set(x21))
                           - class spatial.metadata.control.DefiningBlk: DefiningBlk(x21 (block: 1))
                           - class spatial.metadata.access.ReadUses: ReadUses(Set(x20))
                           - class argon.ShallowAliases: ShallowAliases(Set(x20))
                           - class argon.DeepAliases: DeepAliases(Set())
                      } // End of x21 block #1
                    } // End of x21
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

No branches or pull requests

1 participant