Basic constant handling folds, for both scalars and vectors
Details
Diff Detail
- Repository
- rL LLVM
Event Timeline
I think we'd do better by making a helper for the common code rather than duplicating. These things tend to diverge because someone will come along later and add a fold for 1 opcode but forget to add the corresponding fold for its sibling. This might've already happened because we allow vectors for the signed ops, but not the unsigned ops...or that's the planned follow-up?
I'm happy to fold this into a generalized version of visitUADDO/visitUSUBO once D58965 has landed.
Ah, I'm getting the order of the patches mixed up. Are we missing tests for when the flag result is unused, or is that already covered elsewhere?
On scalars we do have some tests that cover this. For vectors I haven't thought of a good way to test this yet as expansion strips it away if its not used.
Code/tests look correct, so LGTM. Please do refactor to reduce duplication once the other patches are committed.