[PATCH] D122951: [RISCV][SelectionDAG] Add a hook to sign extend i32 ConstantInt operands of phis on RV64.

Fraser Cormack via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Apr 4 02:26:04 PDT 2022


frasercrmck added inline comments.


================
Comment at: llvm/include/llvm/CodeGen/TargetLowering.h:2682
+  /// a larger type.
+  virtual bool signExtendConstant(Type *Ty) const { return false; }
+
----------------
The comment about "this" constant is a little incongruous as no constant is provided. Even if RISC-V doesn't need it, I can imagine situations where targets may choose to sign-extend some specific constants and not others, so it may make sense to pass the Constant to this API.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D122951



More information about the llvm-commits mailing list