Commit ca12d1d
authored
[SystemZ] Improve CCMask optimization (#171137)
This commit addresses a shortcoming in the implementation of
`combineBR_CCMASK` and `combineSELECT_CCMASK`. In cases where
`combineCCMask` was able to reduce the ccmask going into the select or
branch to either true (`ccvalid`) or false (`0`), a trivial instruction
would be emitted (i.e. either a select that would only ever select one
side, or a conditional branch with `true` or `false` as the branch
condition).
This led under certain circumstances to, e.g., `BRC` instructions being
emitted that triggered an assert in the AsmPrinter meant to exclude such
branch conditions.
For the select case, this commit introduces an early bailout that simply
returns the value that would "always" be selected. For the branch case,
the commit introduces an additional guard that prevents the DAGCombine
from taking effect, thereby preventing the illegal instruction from
being emitted.1 parent 29611f4 commit ca12d1d
File tree
2 files changed
+41
-1
lines changed- llvm
- lib/Target/SystemZ
- test/CodeGen/SystemZ
2 files changed
+41
-1
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
8887 | 8887 | | |
8888 | 8888 | | |
8889 | 8889 | | |
8890 | | - | |
| 8890 | + | |
| 8891 | + | |
| 8892 | + | |
| 8893 | + | |
| 8894 | + | |
| 8895 | + | |
8891 | 8896 | | |
8892 | 8897 | | |
8893 | 8898 | | |
| |||
8974 | 8979 | | |
8975 | 8980 | | |
8976 | 8981 | | |
| 8982 | + | |
| 8983 | + | |
| 8984 | + | |
| 8985 | + | |
| 8986 | + | |
| 8987 | + | |
| 8988 | + | |
8977 | 8989 | | |
8978 | 8990 | | |
8979 | 8991 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
0 commit comments