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

Florian Hahn via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Jul 21 06:44:45 PDT 2020


fhahn updated this revision to Diff 279507.
fhahn marked an inline comment as done.
fhahn added a comment.

Improve wording.

In D84201#2163328 <https://reviews.llvm.org/D84201#2163328>, @arsenm wrote:

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


The main advantages IMO of the bundle approach IMO are

1. no need to modify the IR directly, which might be quite controversial
2. adding the flags directly to calls means all calls need to pay some cost (a few extra bits somewhere)
3. the integer wrapping flags are probably much less useful for calls than the fast-math flags. The fast-math flags describe a property of the result value (e.g does not contain signed zeroes) which is useful to know when using the result of the call, whereas the wrapping flags mostly describe how the result is computed (without overflow), which is not too helpful to know about at the call site, but helpful when lowering certain intrinsics.

Hence I think the bundles are more lightweight than adding the flags directly to start with. If they prove useful for a large range of calls, it should be easy to auto-upgrade the existing uses to flags on the instruction and we would have a solid data point to argue for adding them directly to calls. Does that make sense?


Repository:
  rG LLVM Github Monorepo

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

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.279507.patch
Type: text/x-patch
Size: 11302 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20200721/48fb51a4/attachment-0001.bin>


More information about the llvm-commits mailing list