Commit 44c89c3
committed
[GlobalISel] Allow per-lane truncating/extending G_STORE/G_LOAD semantics
The semantics of vector G_STORE is currently not well defined. The docs
have diverged with the implementation on whether vector G_STORE/G_LOAD
instructions have per-lane truncating/extending behavior. The docs say
G_LOAD/G_STORE is not per-lane truncating/extending. This diverges from
the SelectionDAG semantics and also does not match our current
implementation in some cases. One case I am aware of is
llvm#121169.
We do require some implementation of these semantics for handling cases
like in the above PR, e.g. storing a <8 x s8> register into a <8 x s1>
bitfield. I would like to discuss which route we want to take.
1. Allow per-lane truncating/extending G_STORE/G_LOAD semantics like
SelectionDAG. If we do not have a good reason to diverge from
SelectionDAG here, this probably is the default option, as it would
make it more straightforward to port patterns and lowering code from
SDAG. However, I think we would need to tighten down the MemDesc
legality rules, because they currently only check the size of the
memory type.
I have drafted the documentation changes for this route in this PR,
but I am not familiar with scalable vectors in GISel, so I would
appreciate some input on how they are supposed to behave with
extending/truncating stores.
2. Add new opcodes.
3. Other ideas?1 parent 16d1054 commit 44c89c3
1 file changed
+23
-8
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
861 | 861 | | |
862 | 862 | | |
863 | 863 | | |
864 | | - | |
865 | | - | |
866 | | - | |
| 864 | + | |
| 865 | + | |
| 866 | + | |
| 867 | + | |
| 868 | + | |
| 869 | + | |
| 870 | + | |
| 871 | + | |
| 872 | + | |
| 873 | + | |
867 | 874 | | |
868 | 875 | | |
869 | 876 | | |
| |||
889 | 896 | | |
890 | 897 | | |
891 | 898 | | |
892 | | - | |
893 | | - | |
894 | | - | |
895 | | - | |
896 | | - | |
| 899 | + | |
| 900 | + | |
| 901 | + | |
| 902 | + | |
| 903 | + | |
| 904 | + | |
| 905 | + | |
| 906 | + | |
| 907 | + | |
| 908 | + | |
| 909 | + | |
| 910 | + | |
| 911 | + | |
897 | 912 | | |
898 | 913 | | |
899 | 914 | | |
| |||
0 commit comments