Drasil icon indicating copy to clipboard operation
Drasil copied to clipboard

Introduced `LitValue` for expanded literal value handling

Open Xinlu-Y opened this issue 1 year ago • 1 comments

As discussed in #1867, smartAdd and smartSub are currently using literal integer values as SValue to perform simple optimizations. By creating a new datatype LitValue, we could extend support to more simple types of literal values (such as floats, doubles, and strings, which I believe would be useful) for addition and subtraction operations.

However, after making these changes, I noticed that the generated test code for listSlice has been altered. This change seems to occur specifically when the step is a variable and the issue arises from how I'm handling the return value of valueInt in the instances of ValueElim. image The problem might stem from how these values are being unpacked and interpreted in the context of listSlice which remains somewhat puzzling to me.

Xinlu-Y avatar Aug 24 '24 04:08 Xinlu-Y

Looking at this code again, I don't think this is quite the right approach -- it loses too much type information. I think the 'static' information should be tracked in a different way. Most likely abandoning this PR and re-starting will be the easiest way forward.

JacquesCarette avatar Aug 27 '24 00:08 JacquesCarette