[PATCH] D44096: [X86] Make X86 PseudoI instructions llvm isPseudo.

Craig Topper via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Mar 5 09:52:46 PST 2018


craig.topper added a comment.

The isPseudo flag is supposed to refer to instructions that are expand by the ExpandPostRAPseudos pass.

While PseudoI class in X86 just means that instruction lacks encoding information. There are at least 3 reasons for this that I know of. The instruction is marked as usesCustomInserter=1 which means it will be replaced shortly after isel. Its handled by the ExpandPostRAPseudos in X86InstrInfo.cpp. And the third reason is that its mutated by the switch in X86MCInstLower::Lower.

If we set isPseudo on the third group, then we end up calling expandPostRAPseudos on them and assume it won't do anything to them and wont' error for an unexpected instruction. I believe we don't check for unexpected instruction because the target independent instructions like COPY, SUBREG_TO_REG, EXTRACT_SUBREG, and INSERT_SUBREG all call X86InstrInfo::expandPostRAPseudos to give the X86 backend a chance to handle them, but X86 doesn't want to.

What is your motivation here? Are you planning to use the flag for something else?


Repository:
  rL LLVM

https://reviews.llvm.org/D44096





More information about the llvm-commits mailing list