[PATCH] D131959: [AMDGPU] Fix SDST operand of V_DIV_SCALE to always be VCC

Pierre van Houtryve via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri Sep 9 02:15:01 PDT 2022


Pierre-vh added a comment.

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.


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