[PATCH] D84201: [LangRef] Add integer wrapping operand bundles.

Florian Hahn via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Jul 20 21:16:31 PDT 2020


fhahn created this revision.
fhahn added reviewers: anemet, arsenm, reames, jdoerfert, SjoerdMeijer, lebedev.ri.
Herald added subscribers: hiraditya, wdng.
Herald added a project: LLVM.
fhahn updated this revision to Diff 279346.
fhahn added a comment.

Add example.


arsenm added a comment.

I don't understand how this is easier than adding the flags to calls?


This patch introduces new nuw and nsw operand bundles, to indicate
no-unsigned-wrap and no-signed-wrap for the computation of the result of
a call.

Initially, functions that want to use it need to opt-in, as there are
many cases where the bundle probably makes little sense. This mirrors
fast-math flags, which can be specified directly for calls returning
floating point values. Adding nuw/nsw as operand bundles is very
lightweight. If there are a lot of users, it might make sense to
consider adding the flags directly to calls, but I think operand bundles
allow us to make progress quickly and see how widely useful this
actually is.

Tot start with, llvm.matrix.multiply will use it, but other candidates
are the integer reduction intrinsics.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D84201

Files:
  llvm/docs/LangRef.rst
  llvm/include/llvm/IR/LLVMContext.h
  llvm/lib/IR/LLVMContext.cpp
  llvm/lib/IR/Verifier.cpp
  llvm/test/Bitcode/operand-bundles-bc-analyzer.ll
  llvm/test/Verifier/operand-bundles.ll

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D84201.279346.patch
Type: text/x-patch
Size: 11171 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20200721/c5b0e52b/attachment-0001.bin>


More information about the llvm-commits mailing list