[PATCH] propagate IR-level fast-math-flags to DAG nodes
Sanjay Patel
spatel at rotateright.com
Thu Apr 9 08:04:07 PDT 2015
================
Comment at: include/llvm/CodeGen/SelectionDAGNodes.h:971-977
@@ +970,9 @@
+
+ void setHasNoUnsignedWrap(bool b) {
+ Flags = (Flags & ~NoUnsignedWrap) | (b ? NoUnsignedWrap : 0);
+ }
+
+ void setHasNoSignedWrap(bool b) {
+ Flags = (Flags & ~NoSignedWrap) | (b ? NoSignedWrap : 0);
+ }
+
----------------
andreadb wrote:
> This is ok. However, what about having something like this?
>
> ```
> setNoUnsignedWrap() {
> Flags |= NoUnsignedWrap;
> }
>
> clearNoUnsignedWrap() {
> Flags ^= NoUnsignedWrap;
> }
> ```
>
> Also it is a shame that most of this code is repeated in 'class SDNodeWithFlags'. I wonder if there is a better design that allows to delegate the 'bit manipulation part' as much as possible to 'SDNodeFlags'...
I agree completely, but I didn't see an immediate solution, so I just went with the lazy approach: copy and paste!
I'm open to any suggestions for improvement on the interface, and eventually (soon) I would unify the IR and SDNode versions of the flags, so we get the benefits in both places.
http://reviews.llvm.org/D8900
EMAIL PREFERENCES
http://reviews.llvm.org/settings/panel/emailpreferences/
More information about the llvm-commits
mailing list