This is an archive of the discontinued LLVM Phabricator instance.

[GlobalISel] Add G_ROTR and G_ROTL opcodes for rotates
ClosedPublic

Authored by aemerson on Mar 25 2021, 2:54 PM.

Diff Detail

Event Timeline

aemerson created this revision.Mar 25 2021, 2:54 PM
aemerson requested review of this revision.Mar 25 2021, 2:54 PM
aemerson updated this revision to Diff 333442.Mar 25 2021, 3:38 PM
paquette added inline comments.Mar 25 2021, 3:49 PM
llvm/lib/CodeGen/MachineVerifier.cpp
1586
def G_ROTR : GenericInstruction {
  let OutOperandList = (outs type0:$dst);
  let InOperandList = (ins type0:$src1, type1:$src2);
  let hasSideEffects = false;
}

IIUC $dst and $src1 have the same type, so this check shouldn't be necessary?

aemerson updated this revision to Diff 333462.Mar 25 2021, 4:42 PM
This revision is now accepted and ready to land.Mar 25 2021, 5:21 PM
This revision was landed with ongoing or failed builds.Mar 25 2021, 5:24 PM
This revision was automatically updated to reflect the committed changes.
foad added inline comments.Mar 26 2021, 4:48 AM
llvm/lib/CodeGen/MachineVerifier.cpp
1581–1582

Why are these different from G_SHL etc, which don't have any special checking here?

aemerson added inline comments.Mar 26 2021, 9:49 AM
llvm/lib/CodeGen/MachineVerifier.cpp
1581–1582

We don't allow vector shifts to have scalar shift values right? Seems like an oversight on the G_SHL verifiers.