[llvm] [SDAG][ISel][TableGen][LoongArch] Report error for trivial bitcasts when there are predicate calls (PR #116075)
Yingwei Zheng via llvm-commits
llvm-commits at lists.llvm.org
Thu Nov 14 08:14:12 PST 2024
dtcxzyw wrote:
> > > No tests fail if you just delete the bitconvert from the pattern
> >
> >
> > >
> >
> >
> > >
> >
> >
> > > diff --git a/llvm/lib/Target/LoongArch/LoongArchLSXInstrInfo.td b/llvm/lib/Target/LoongArch/LoongArchLSXInstrInfo.td
> >
> >
> > > index 250896cbbe5f..2caf7e0d1908 100644
> >
> >
> > > --- a/llvm/lib/Target/LoongArch/LoongArchLSXInstrInfo.td
> >
> >
> > > +++ b/llvm/lib/Target/LoongArch/LoongArchLSXInstrInfo.td
> >
> >
> > > @@ -75,7 +75,7 @@ class VecCond<SDPatternOperator OpNode, ValueType TyNode,
> >
> >
> > > }
> >
> >
> > >
> >
> >
> > > def vsplat_imm_eq_1 : PatFrags<(ops), [(build_vector),
> >
> >
> > > * ```
> > > (bitconvert (v4i32 (build_vector)))], [{
> > > ```
> >
> >
> > > * ```
> > > ], [{
> > > ```
> >
> >
> > > APInt Imm;
> >
> >
> > > EVT EltTy = N->getValueType(0).getVectorElementType();
> >
> >
> > >
> >
> >
> > >
> >
> >
> > I agree, I must have been foolish at that time.
>
> The pattern was added before build_vector lowering was added. Maybe it used to be needed?
```
[5653/12011] Building MipsGenDAGISel.inc...
FAILED: lib/Target/Mips/MipsGenDAGISel.inc /var/lib/buildkite-agent/builds/linux-56-59b8f5d88-fkcjf-1/llvm-project/github-pull-requests/build/lib/Target/Mips/MipsGenDAGISel.inc
cd /var/lib/buildkite-agent/builds/linux-56-59b8f5d88-fkcjf-1/llvm-project/github-pull-requests/build && /var/lib/buildkite-agent/builds/linux-56-59b8f5d88-fkcjf-1/llvm-project/github-pull-requests/build/bin/llvm-tblgen -gen-dag-isel -I /var/lib/buildkite-agent/builds/linux-56-59b8f5d88-fkcjf-1/llvm-project/github-pull-requests/llvm/lib/Target/Mips -I/var/lib/buildkite-agent/builds/linux-56-59b8f5d88-fkcjf-1/llvm-project/github-pull-requests/build/include -I/var/lib/buildkite-agent/builds/linux-56-59b8f5d88-fkcjf-1/llvm-project/github-pull-requests/llvm/include -I /var/lib/buildkite-agent/builds/linux-56-59b8f5d88-fkcjf-1/llvm-project/github-pull-requests/llvm/lib/Target -omit-comments /var/lib/buildkite-agent/builds/linux-56-59b8f5d88-fkcjf-1/llvm-project/github-pull-requests/llvm/lib/Target/Mips/Mips.td --write-if-changed -o lib/Target/Mips/MipsGenDAGISel.inc -d lib/Target/Mips/MipsGenDAGISel.inc.d
error: (bitconvert:{ *:[v4i32] } (build_vector:{ *:[v4i32] }))<<P:Predicate_vsplati64_imm_eq_1>>
trivial bitconvert node should not have predicate calls
[5654/12011] Building MipsGenInstrInfo.inc...
FAILED: lib/Target/Mips/MipsGenInstrInfo.inc /var/lib/buildkite-agent/builds/linux-56-59b8f5d88-fkcjf-1/llvm-project/github-pull-requests/build/lib/Target/Mips/MipsGenInstrInfo.inc
cd /var/lib/buildkite-agent/builds/linux-56-59b8f5d88-fkcjf-1/llvm-project/github-pull-requests/build && /var/lib/buildkite-agent/builds/linux-56-59b8f5d88-fkcjf-1/llvm-project/github-pull-requests/build/bin/llvm-tblgen -gen-instr-info -I /var/lib/buildkite-agent/builds/linux-56-59b8f5d88-fkcjf-1/llvm-project/github-pull-requests/llvm/lib/Target/Mips -I/var/lib/buildkite-agent/builds/linux-56-59b8f5d88-fkcjf-1/llvm-project/github-pull-requests/build/include -I/var/lib/buildkite-agent/builds/linux-56-59b8f5d88-fkcjf-1/llvm-project/github-pull-requests/llvm/include -I /var/lib/buildkite-agent/builds/linux-56-59b8f5d88-fkcjf-1/llvm-project/github-pull-requests/llvm/lib/Target /var/lib/buildkite-agent/builds/linux-56-59b8f5d88-fkcjf-1/llvm-project/github-pull-requests/llvm/lib/Target/Mips/Mips.td --write-if-changed -o lib/Target/Mips/MipsGenInstrInfo.inc -d lib/Target/Mips/MipsGenInstrInfo.inc.d
error: (bitconvert:{ *:[v4i32] } (build_vector:{ *:[v4i32] }))<<P:Predicate_vsplati64_imm_eq_1>>
trivial bitconvert node should not have predicate calls
[5655/12011] Building MipsGenFastISel.inc...
FAILED: lib/Target/Mips/MipsGenFastISel.inc /var/lib/buildkite-agent/builds/linux-56-59b8f5d88-fkcjf-1/llvm-project/github-pull-requests/build/lib/Target/Mips/MipsGenFastISel.inc
cd /var/lib/buildkite-agent/builds/linux-56-59b8f5d88-fkcjf-1/llvm-project/github-pull-requests/build && /var/lib/buildkite-agent/builds/linux-56-59b8f5d88-fkcjf-1/llvm-project/github-pull-requests/build/bin/llvm-tblgen -gen-fast-isel -I /var/lib/buildkite-agent/builds/linux-56-59b8f5d88-fkcjf-1/llvm-project/github-pull-requests/llvm/lib/Target/Mips -I/var/lib/buildkite-agent/builds/linux-56-59b8f5d88-fkcjf-1/llvm-project/github-pull-requests/build/include -I/var/lib/buildkite-agent/builds/linux-56-59b8f5d88-fkcjf-1/llvm-project/github-pull-requests/llvm/include -I /var/lib/buildkite-agent/builds/linux-56-59b8f5d88-fkcjf-1/llvm-project/github-pull-requests/llvm/lib/Target /var/lib/buildkite-agent/builds/linux-56-59b8f5d88-fkcjf-1/llvm-project/github-pull-requests/llvm/lib/Target/Mips/Mips.td --write-if-changed -o lib/Target/Mips/MipsGenFastISel.inc -d lib/Target/Mips/MipsGenFastISel.inc.d
error: (bitconvert:{ *:[v4i32] } (build_vector:{ *:[v4i32] }))<<P:Predicate_vsplati64_imm_eq_1>>
trivial bitconvert node should not have predicate calls
[5656/12011] Building MipsGenGlobalISel.inc...
FAILED: lib/Target/Mips/MipsGenGlobalISel.inc /var/lib/buildkite-agent/builds/linux-56-59b8f5d88-fkcjf-1/llvm-project/github-pull-requests/build/lib/Target/Mips/MipsGenGlobalISel.inc
cd /var/lib/buildkite-agent/builds/linux-56-59b8f5d88-fkcjf-1/llvm-project/github-pull-requests/build && /var/lib/buildkite-agent/builds/linux-56-59b8f5d88-fkcjf-1/llvm-project/github-pull-requests/build/bin/llvm-tblgen -gen-global-isel -I /var/lib/buildkite-agent/builds/linux-56-59b8f5d88-fkcjf-1/llvm-project/github-pull-requests/llvm/lib/Target/Mips -I/var/lib/buildkite-agent/builds/linux-56-59b8f5d88-fkcjf-1/llvm-project/github-pull-requests/build/include -I/var/lib/buildkite-agent/builds/linux-56-59b8f5d88-fkcjf-1/llvm-project/github-pull-requests/llvm/include -I /var/lib/buildkite-agent/builds/linux-56-59b8f5d88-fkcjf-1/llvm-project/github-pull-requests/llvm/lib/Target /var/lib/buildkite-agent/builds/linux-56-59b8f5d88-fkcjf-1/llvm-project/github-pull-requests/llvm/lib/Target/Mips/Mips.td --write-if-changed -o lib/Target/Mips/MipsGenGlobalISel.inc -d lib/Target/Mips/MipsGenGlobalISel.inc.d
error: (bitconvert:{ *:[v4i32] } (build_vector:{ *:[v4i32] }))<<P:Predicate_vsplati64_imm_eq_1>>
trivial bitconvert node should not have predicate calls
```
I guess these patterns in LoongArch backend are copied from the MIPS backend.
https://github.com/llvm/llvm-project/pull/116075
More information about the llvm-commits
mailing list