Thomas A.M. Bernard wrote: > Well I found another way to solve the problem by updating the dce for > not taking out my instructions. > > I inserted "setallocate" as a native operator in the back-end which > comes from a GIMPLE node and map to the RTL pattern. Earlier in the > discussion, it's been discussed that the dce was taking out the > instruction when flag -O1 was engaged. To solve that, in > 'tree-ssa-dce.c', I flagged this node with the function, > "mark_stmt_necessary". And it works fine so far. The instruction is not > omitted anymore by the dce :-)
Do not add it as a GIMPLE node. Add it as a builtin function, so that the tree-level DCE will treat like every other call and not remove it. IOW, do not add new kinds of node. Use builtins for trees, and unspecs for RTL. Paolo