[PATCH] Refactor sameNoopInput (determining tail-call legitimacy)

Tim Northover t.p.northover at gmail.com
Wed Jul 31 05:31:37 PDT 2013


  Following Stephen's suggestion, I've added a TargetLowering function "allowTruncateForTailCalls" to replace the isTruncateFree call. Only three targets defined this before, so to be on the safe side I've only considered those three:

  * X86 allows all truncates from 64-bit downwards (and relies on the previous code weeding out zeroext/signext attributes).
  * MSP430 didn't support tail calls anyway, so I left it at the default "nope".
  * Hexagon seems like it would allow truncates from i32 in general, and from i64 in its current guise. I've limited it to i32 due to fragility concerns.

  This patch may have to change further if Nick's proposed weakening of the "no zeroext/signext" rule is accepted. I'll update it (with more tests) if that happens before this is committed.

http://llvm-reviews.chandlerc.com/D1216

CHANGE SINCE LAST DIFF
  http://llvm-reviews.chandlerc.com/D1216?vs=2999&id=3103#toc

Files:
  include/llvm/Target/TargetLowering.h
  lib/CodeGen/Analysis.cpp
  lib/Target/Hexagon/HexagonISelLowering.cpp
  lib/Target/Hexagon/HexagonISelLowering.h
  lib/Target/X86/X86ISelLowering.cpp
  lib/Target/X86/X86ISelLowering.h
  test/CodeGen/Hexagon/tail-call-trunc.ll
  test/CodeGen/X86/returned-trunc-tail-calls.ll
  test/CodeGen/X86/tail-call-legality.ll
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D1216.2.patch
Type: text/x-patch
Size: 28032 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20130731/80d1201b/attachment.bin>


More information about the llvm-commits mailing list