[PATCH] D72475: [WIP] Build assume from call

Tyker via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Sun Jan 12 10:57:34 PST 2020


Tyker updated this revision to Diff 237552.
Tyker marked 5 inline comments as done.
Tyker added a comment.

fixed comments.

> Next steps (in no particular order):
> 
> - Teach passes sensitive to uses, especially instcombine, to ignore uses in an llvm.assume.
> - Teach passes, e.g., the Attributor, to use the information provided this way.
> - Emit llvm.assume when we move/delete call instructions.
> - Perform some experiments.
> - Revisit the list to get agreement.

I agree with the tasks.
But i think that we also need to build an API to query those new assumes before using them. First to have "good names" instead of indexes in the operand bundle and also because we don't want users to directly depend on the representation. If at some point we want to group knowledge by attributes.
example: for

  call void @func(i32* nonnull %P1, i32* nonnull %P)

build

  call void @llvm.assume(i1 true) [ "nonnull"(i32* %P1, i32* %P)]

instead of

  call void @llvm.assume(i1 true) [ "nonnull"(i32* %P1), "nonnull"(i32* %P)]

this change will be harder if passes access the operand bundle element directly.


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

https://reviews.llvm.org/D72475

Files:
  llvm/include/llvm/IR/Attributes.h
  llvm/include/llvm/Transforms/Utils/AssumeBuilder.h
  llvm/lib/IR/Attributes.cpp
  llvm/lib/IR/Core.cpp
  llvm/lib/Passes/PassBuilder.cpp
  llvm/lib/Passes/PassRegistry.def
  llvm/lib/Transforms/Utils/AssumeBuilder.cpp
  llvm/lib/Transforms/Utils/CMakeLists.txt
  llvm/test/Transforms/Util/assume-builder.ll

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D72475.237552.patch
Type: text/x-patch
Size: 15397 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20200112/672bfbcd/attachment.bin>


More information about the llvm-commits mailing list