[PATCH] D122051: [RISCV] The immediate version of sgt/ugt lowering to slti/sltiu + xori
LiqinWeng via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Sat Mar 26 21:28:58 PDT 2022
Miss_Grape added inline comments.
================
Comment at: llvm/lib/Target/RISCV/RISCVInstrInfo.td:355
+// A 12-bit signed immediate sub one and exlcude zero
+def simm12_sub1_exc0 : PatLeaf<(imm), [{
+ if (!N->hasOneUse())
----------------
craig.topper wrote:
> Use `simm12_sub1_nonzero` that's consistent with `simm5_plus1_nonzero` from RISCVInstrInfoV.td
done
================
Comment at: llvm/lib/Target/RISCV/RISCVInstrInfo.td:360
+ int64_t Imm = N->getSExtValue();
+ return (Imm >= -2049 && Imm < 0) || ( Imm > 0 && Imm <= 2046);
+}]>;
----------------
craig.topper wrote:
> There's an extra space before the third use of `Imm`
done
================
Comment at: llvm/test/CodeGen/RISCV/i32-icmp.ll:1
; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py
; RUN: llc -mtriple=riscv32 -verify-machineinstrs < %s \
----------------
craig.topper wrote:
> Is there a similar test file for rv64?
I have add i64-icmp.ll test, and just test sgt/ugt. I will resubmit a new patch for anthor icmp tests
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D122051/new/
https://reviews.llvm.org/D122051
More information about the llvm-commits
mailing list