It's simpler to do this at codegen time than to do ad-hoc constant
folding of machine instructions in SIFoldOperands.
Details
Diff Detail
- Repository
- rG LLVM Github Monorepo
Event Timeline
The only codegen diffs I saw across several thousand graphics shaders were three instances of:
- s_pack_ll_b32_b16 s3, s2, 0 + s_and_b32 s3, 0xffff, s2
Can this appear later in the codegen? It also does not cover global isel, so part in the operand folding probably needs to remain in addition to patterns.
It doesn't cover globalisel because build_vector patterns don't work now (and we use G_BUILD_VECTOR_TRUNC in these cases instead).
This kind of thing should not really be a problem in globalisel.
I doubt it, and I haven't found any cases where that happens.
It also does not cover global isel, so part in the operand folding probably needs to remain in addition to patterns.
The whole point of instruction selection is to select the best instructions. I really don't think any instruction selector should rely on having this kind of folding run later.
This needs a move to materialize the constant?