[PATCH] D21739: [TLI] Add functions determining if int parameters/returns should be zeroext/signext.

Hal Finkel via llvm-commits llvm-commits at lists.llvm.org
Thu Nov 10 11:30:42 PST 2016


hfinkel added inline comments.


================
Comment at: lib/Analysis/TargetLibraryInfo.cpp:428
+  // Mips, on the other hand, needs signext on i32 parameters corresponding
+  // to both signed and unsigned ints.
+  if (T.getArch() == Triple::mips || T.getArch() == Triple::mipsel ||
----------------
sdardis wrote:
> hfinkel wrote:
> > To be clear, they sign extend even unsigned numbers?
> Yes. The N64 and N32 ABIs requires that 32 bit integer parameters are sign extended, even unsigned numbers.
Ah, okay. In that case, I'll change my suggested interface to be something more direct, how about...

  Attribute::AttrKind getExtAttrForI32Param(bool Signed = true) const { ... }

and then the user code can look like this:

  if (auto AK = TLI->getExtAttrForI32Param())
    F->addAttribute(n, AK)



Repository:
  rL LLVM

https://reviews.llvm.org/D21739





More information about the llvm-commits mailing list