As @alexey-bataev noticed, with the current cost model we account for
the cost of constant materialisation through the user's instruction
cost.
For straight line code this is usually fine, but inside a loop these
constants are usually hoisted out by LICM.
They should probably not be accounted for in these cases.
Details
Details
Diff Detail
Diff Detail
- Repository
- rG LLVM Github Monorepo
Event Timeline
Comment Actions
The cost model will probably need a bit of reworking, and I'm not sure if these constant materialisation costs will end up being factored out of getInstructionCost or if there will be some other interface, so these tests are not that useful as it stands.