[PATCH] D66635: [Attributor] Clamp operator to extend known state
Hideto Ueno via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Mon Aug 26 23:08:03 PDT 2019
This revision was automatically updated to reflect the committed changes.
Closed by commit rGc395c9172fcb: [Attributor] Clamp operator to extend known state (authored by uenoku).
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D66635/new/
https://reviews.llvm.org/D66635
Files:
llvm/include/llvm/Transforms/IPO/Attributor.h
Index: llvm/include/llvm/Transforms/IPO/Attributor.h
===================================================================
--- llvm/include/llvm/Transforms/IPO/Attributor.h
+++ llvm/include/llvm/Transforms/IPO/Attributor.h
@@ -940,6 +940,13 @@
return *this;
}
+ /// "Clamp" this state with \p R. The result is the maximum of the known
+ /// information but not more than what was assumed before.
+ IntegerState operator+=(const IntegerState &R) {
+ takeKnownMaximum(R.Known);
+ return *this;
+ }
+
/// Make this the minimum, known and assumed, of this state and \p R.
IntegerState operator&=(const IntegerState &R) {
Known = std::min(Known, R.Known);
@@ -1445,6 +1452,13 @@
return *this;
}
+ /// See IntegerState::operator+=
+ DerefState operator+=(const DerefState &R) {
+ DerefBytesState += R.DerefBytesState;
+ GlobalState += R.GlobalState;
+ return *this;
+ }
+
/// See IntegerState::operator&=
DerefState operator&=(const DerefState &R) {
DerefBytesState &= R.DerefBytesState;
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D66635.217312.patch
Type: text/x-patch
Size: 1044 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20190827/d950cb06/attachment.bin>
More information about the llvm-commits
mailing list