Commit 4928eff
committed
[RISCV] Add an implementation of findRepresentativeClass to assign i32 to GPRRegClass for RV64.
This is an alternative fix for #81192. This allows the SelectionDAG
scheduler to be able to find a register class for i32 on RV64. The
default implementation of findRepresentativeClass only works for
legal types which i32 is not for RV64.
I wanted to remove i32 from the GPR register class to fix the issue,
but we need to be able to write some i32 patterns for GISel. And now
it looks like I need to add i16 to GPR. I had tried to use manual
instruction selection for some cases in GISel in #116111, but I got
some feedback recommending the use of patterns.
I did some investigation of why tablegen uses i32 in output patterns
on RV64. It appears it comes down to ForceArbitraryInstResultType
that just picks a type for the output pattern when the isel pattern
isn't specific enough. I believe it picks the smallest type(lowested
numbered) to resolve the conflict.1 parent 5a2888d commit 4928eff
File tree
2 files changed
+21
-0
lines changed- llvm/lib/Target/RISCV
2 files changed
+21
-0
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
21996 | 21996 | | |
21997 | 21997 | | |
21998 | 21998 | | |
| 21999 | + | |
| 22000 | + | |
| 22001 | + | |
| 22002 | + | |
| 22003 | + | |
| 22004 | + | |
| 22005 | + | |
| 22006 | + | |
| 22007 | + | |
| 22008 | + | |
| 22009 | + | |
| 22010 | + | |
| 22011 | + | |
| 22012 | + | |
| 22013 | + | |
| 22014 | + | |
| 22015 | + | |
| 22016 | + | |
21999 | 22017 | | |
22000 | 22018 | | |
22001 | 22019 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1051 | 1051 | | |
1052 | 1052 | | |
1053 | 1053 | | |
| 1054 | + | |
| 1055 | + | |
| 1056 | + | |
1054 | 1057 | | |
1055 | 1058 | | |
1056 | 1059 | | |
| |||
0 commit comments