[PATCH] D13612: [IR] Add a `makeNoWrapRegion` method to `ConstantRange`

Nick Lewycky via llvm-commits llvm-commits at lists.llvm.org
Mon Oct 12 17:00:35 PDT 2015


nlewycky added inline comments.

================
Comment at: lib/IR/ConstantRange.cpp:138-139
@@ +137,4 @@
+
+  assert((NoWrapKind == OBO::NoSignedWrap ||
+          NoWrapKind == OBO::NoUnsignedWrap) && "NoWrapKind invalid!");
+
----------------
sanjoy wrote:
> nlewycky wrote:
> > Please sink this below the test for BinOp being Add. It's not a misuse of the API to call it with OBO::Exact or some other flag if the BinOp is not an add.
> But the API is called `makeNoWrapRegion`, so I'd say calling it with `OBO::Exact` or other flags unrelated to wrapping is a misuse.
> 
> (I don't have a very strong opinion on this, and will change it if you insist.
Oh, good point. I was imagining generalizing this function for all the optimization flags, but right now it's clearly labelled for wrapping. We can change that later when it's required.


http://reviews.llvm.org/D13612





More information about the llvm-commits mailing list