Shall we print nothing when there is no side effect in Evaluate for CodeGenC?

IMHO, this is_const function shall be replaced with a function that checks if there is no side-effect in the evaluated op.

image

@tqchen @ziheng @ajtulloch

If this a constant value. then the expression does not have side effects

That is right. However, there are lots of other situations that do not have side effect which can be ignored when generate code, e.g. const1 + const2. So, I would like to say that the above code is definitely correct but I am wondering if it is the best.

I am new to TVM source code, correct me if I am wrong. :slight_smile: I think only expressions that contains call sub-expressions have side-effects which can be detected by structual induction.