[PATCH] D131959: [AMDGPU] Fix SDST operand of V_DIV_SCALE to always be VCC
Stanislav Mekhanoshin via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Fri Sep 9 10:18:51 PDT 2022
rampitec added a comment.
In D131959#3779567 <https://reviews.llvm.org/D131959#3779567>, @Pierre-vh wrote:
> I got rid of the pass. I tried using a glued node
>
> CurDAG->SelectNodeTo(N, Opc, CurDAG->getVTList(VT, MVT::i1, MVT::Glue), Ops);
> SDValue CopyFromReg = CurDAG->getCopyFromReg(CurDAG->getEntryNode(), SL, TRI->getVCC(), MVT::i1, SDValue(N, 2));
> CurDAG->ReplaceAllUsesOfValueWith(SDValue(N, 1), CopyFromReg);
>
> and that doesn't work, it doesn't crash but it messes up scheduling tool much and we end up with things like this:
>
> v_div_scale_f32 v2, vcc, v0, v1, v0
> s_mov_b64 s[0:1], vcc
> v_div_scale_f32 v3, vcc, v1, v1, v0
> s_mov_b64 vcc, s[0:1]
>
> Instead of just swapping the div_scales.
>
> If I fix it later in `finalizeLowering` when we change the implicit VCC to a VCC_LO, then it works fine.
Did you change AMDGPUdiv_scale to produce glue? So that you have something to glue this copy to?
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D131959/new/
https://reviews.llvm.org/D131959
More information about the llvm-commits
mailing list