[PATCH] [NVPTX] Emit .pragma "nounroll" for loops marked with nounroll

Jingyue Wu jingyue at google.com
Sat Jan 17 23:43:19 PST 2015


Hi jholewinski, meheff, eliben,

CUDA driver can unroll loops when jit-compiling PTX. To prevent CUDA
driver from unrolling a loop marked with llvm.loop.unroll.disable is not
unrolled by CUDA driver, we need to emit .pragma "nounroll" at the
header of that loop.

This patch also extracts getting unroll metadata from loop ID metadata
into a shared helper function.

http://reviews.llvm.org/D7041

Files:
  include/llvm/CodeGen/AsmPrinter.h
  include/llvm/Transforms/Utils/UnrollLoop.h
  lib/Target/NVPTX/NVPTXAsmPrinter.cpp
  lib/Target/NVPTX/NVPTXAsmPrinter.h
  lib/Transforms/Scalar/LoopUnrollPass.cpp
  lib/Transforms/Utils/LoopUnroll.cpp
  test/CodeGen/NVPTX/nounroll.ll

EMAIL PREFERENCES
  http://reviews.llvm.org/settings/panel/emailpreferences/
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D7041.18356.patch
Type: text/x-patch
Size: 8802 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20150118/c026b130/attachment.bin>


More information about the llvm-commits mailing list