[PATCH] D53067: [AArch64] Swap comparison operands if that enables some folding.
Sjoerd Meijer via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Thu Oct 11 00:29:34 PDT 2018
SjoerdMeijer added inline comments.
================
Comment at: lib/Target/AArch64/AArch64ISelLowering.cpp:1802
+ EVT VT = Op.getValueType();
+ if ((VT == MVT::i32 && Shift <= 31) || (VT == MVT::i64 && Shift <= 63))
+ return 1;
----------------
Had a quick first look, so sorry for some question about testing.... If the shift amount is in the range [0,31] and [0,64], are the edge cases tested (also values just outside this range)? Also, can `Shift` be negative here?
================
Comment at: lib/Target/AArch64/AArch64ISelLowering.cpp:1879
+ !isLegalArithImmed(cast<ConstantSDNode>(RHS)->getZExtValue())) {
+ SDValue TheLHS = isCMN(LHS, CC) ? LHS.getOperand(1) : LHS;
+
----------------
Nit, feel free to ignore: perhaps the example can be given in terms of ISD nodes because that's what we're transforming here. And then `TheLHS` can perhaps be given a more meaningful name.
Repository:
rL LLVM
https://reviews.llvm.org/D53067
More information about the llvm-commits
mailing list