lyh552506 / miniC-compiler

for gpt5.0 group
MIT License
4 stars 2 forks source link

functions needed from frontend #1

Closed lyh552506 closed 5 months ago

lyh552506 commented 6 months ago

1.deal with the User* ->GetParents 2.delete a block 3.inserting a instruction anywhere in the block

RicoAfoat commented 6 months ago

Do you mean:

  1. To know where the value is defined? (params, global and defined in basicblocks)
  2. Delete a BasicBlock and modify relevant branch inst?(Condition branch -> UnCondition branch)
  3. Duplicated with #9
lyh552506 commented 6 months ago
  1. now we only have GetParents function in User class ,which is inherit from list_node<BasicBlock,User> , when i do constantprop... sometimes i need to update the val in phi , and so i need this val and its corresponding block , that means we should let value class also have GetParents function
  2. in lib/CFG.hpp Function class :void InsertBlock(BasicBlock pred,BasicBlock succ,BasicBlock* insert) //TODO
RicoAfoat commented 6 months ago
  1. now we only have GetParents function in User class ,which is inherit from list_node<BasicBlock,User> , when i do constantprop... sometimes i need to update the val in phi , and so i need this val and its corresponding block , that means we should let value class also have GetParents function
  2. in lib/CFG.hpp Function class :void InsertBlock(BasicBlock pred,BasicBlock succ,BasicBlock* insert) //TODO
  1. It will be horrible if we maintain a parent information in value, for it will change a huge piece of code and it is not neccessary. Could we use some alternative way such as trying to case it to a user of something like that? Another alternative is to convert a value to a user, which is much easier.
  2. Solved in draft, which needs to merge https://github.com/lyh552506/SB-compiler/pull/15 first, for using of RSUW api