[PATCH] D63163: [GlobalISel][AArch64] Fold G_SUB into G_ICMP when it's safe to do so

Amara Emerson via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Jun 11 14:12:49 PDT 2019


aemerson added inline comments.


================
Comment at: llvm/lib/Target/AArch64/AArch64InstructionSelector.cpp:2967
+                                             MachineRegisterInfo &MRI) const {
+  assert(I.getOpcode() == TargetOpcode::G_ICMP && "Expected G_ICMP");
+  // We want to find this sort of thing:
----------------
This function generates semantically incorrect GMIR and then relies on the caller to fix and select it. I would rather we also modify the opcode in this function to `ANDS[WX]rr` and then have the caller check the return value to see if it needs to modify the opc. That way, on entry and exit we have semantically correct, if only partially selected, MIR.


CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D63163/new/

https://reviews.llvm.org/D63163





More information about the llvm-commits mailing list