inducer / pytato

Lazily evaluated arrays in Python
Other
8 stars 16 forks source link

Code generation for concatenate should be tree-of-ifs, not chain-of-ifs #495

Open inducer opened 2 months ago

inducer commented 2 months ago

https://github.com/inducer/pytato/blob/5aa8aa3a18c50fa5db4bae0e3fe87dcade8b1b78/pytato/transform/lower_to_index_lambda.py#L140-L186

cc @majosm

kaushikcfd commented 2 months ago

IIUC, you are proposing we have a switch-case node in the IR?

inducer commented 2 months ago

No, not at all. I'm just proposing that we organize the generated If nodes...

image

kaushikcfd commented 2 months ago

Makes sense, thanks!