[PATCH] D55375: [AArch64] Refactor the scheduling predicates

Andrea Di Biagio via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Dec 6 12:43:06 PST 2018


andreadb accepted this revision.
andreadb added a comment.
This revision is now accepted and ready to land.

I only have one question. Otherwise, the new predicates LGTM (their logic seems to match what you wrote in the code comments).



================
Comment at: llvm/lib/Target/AArch64/AArch64SchedPredicates.td:354
+                                              [CheckZeroOperand<1>,
+                                               CheckZeroOperand<2>]>>>],
+                                       MCReturnStatement<FalsePred>>>;
----------------
I am not familiar with aarch64. So, apologies if what I am about to ask is silly...

The comment at line 347 suggest that you want to match a `MOVI Vd, #0, LSL #0`.

My question is: is the check for operand #2 correct? Is that check equivalent to checking for the presence of a LSL #0? If so, then fine.

This is the tablegen'd definition:

```
bool AArch64InstrInfo::isZeroFPIdiom(const MachineInstr &MI) {
  switch(MI.getOpcode()) {
  case AArch64::MOVIv8b_ns:
  case AArch64::MOVIv16b_ns:
  case AArch64::MOVID:
  case AArch64::MOVIv2d_ns:
    return MI.getOperand(1).getImm() == 0;
  case AArch64::MOVIv4i16:
  case AArch64::MOVIv8i16:
  case AArch64::MOVIv2i32:
  case AArch64::MOVIv4i32:
    return (
      MI.getOperand(1).getImm() == 0
      && MI.getOperand(2).getImm() == 0
    );
  default:
    return false;
  } // end of switch-stmt
}
```


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

https://reviews.llvm.org/D55375





More information about the llvm-commits mailing list