MIPS64R6 compact branch support. As the MIPS LLVM backend uses distinct
MachineInstrs for certain 32 and 64 bit instructions (e.g. BEQ & BEQ64) that
map to the same operation, extend compact branch support for the
corresponding 64bit branches.
Details
Diff Detail
Event Timeline
lib/Target/Mips/Mips64r6InstrInfo.td | ||
---|---|---|
138–139 | We shouldn't be using isCodeGenOnly to avoid decoder conflicts and should use DecoderNamespace instead. One thing to be careful of is that some encodings like BGEC_ENC already has a DecoderNamespace to handle the unusual shapes (such as the rs < rt conditions) in the encoding table (see DecodeDisambiguates and DecodeDisambiguatedBy). |
The code change looks correct to me but there's some bugs in the test cases.
test/CodeGen/Mips/compactbranches/beqc-bnec-register-constraint.ll | ||
---|---|---|
17 ↗ | (On Diff #60660) | It doesn't make much functional difference in this case but can you add a ':' so that we match the label instead of a nearby directive. Likewise for the other CHECK-LABEL's |
test/CodeGen/Mips/compactbranches/compact-branches-64.ll | ||
6 ↗ | (On Diff #60660) | The various checking directives can match in the wrong function at the moment. Could you add some CHECK-LABEL directives to prevent this? |
11 ↗ | (On Diff #60660) | There aren't any RUN lines that enable the CHECK prefix (it's only the default when --check-prefix isn't given). |
15–16 ↗ | (On Diff #60660) | There aren't any RUN directives that specify the 'STATIC' prefix. |
40 ↗ | (On Diff #60660) | This one is missing a ':' |
63 ↗ | (On Diff #60660) | The whitespace between the 'CHECK' and ':' disables this check |
187 ↗ | (On Diff #60660) | There are no RUN directives that enable STATIC64 |
test/CodeGen/Mips/compactbranches/no-beqzc-bnezc.ll | ||
10–57 ↗ | (On Diff #60660) | This block isn't doing what you expect. It's checking that the two *-NOT's don't occur between the first two 'f' characters in the output. One of them will probably match the 'f' in the '.file' directive and it's quite likely that both occur before the 'f:' label on the first function |
71 ↗ | (On Diff #60660) | f1 -> f4 |
89 ↗ | (On Diff #60660) | f2 -> f5 |
test/CodeGen/Mips/compactbranches/compact-branches-64.ll | ||
---|---|---|
12 ↗ | (On Diff #61667) | The CHECK prefix is still disabled so we're not actually performing these checks |
We shouldn't be using isCodeGenOnly to avoid decoder conflicts and should use DecoderNamespace instead. One thing to be careful of is that some encodings like BGEC_ENC already has a DecoderNamespace to handle the unusual shapes (such as the rs < rt conditions) in the encoding table (see DecodeDisambiguates and DecodeDisambiguatedBy).