[PATCH] D57983: [ConstantRange] Shl of ConstantRanges considers full-set shifting to last bit position

Nikita Popov via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Sat Mar 30 08:21:55 PDT 2019


nikic added inline comments.


================
Comment at: lib/IR/ConstantRange.cpp:1011
+  // zero return return the original range.
+  if (!Other.isWrappedSet() && Other_umax.isNullValue())
+    return *this;
----------------
The !isWrappedSet() doesn't really make sense to me here. Other_umax (which is the inclusive unsigned maximum) for a wrapped set will always be MaxValue, so this check seems redundant.


================
Comment at: unittests/IR/ConstantRangeTest.cpp:57
 ConstantRange ConstantRangeTest::Some(APInt(16, 0xa), APInt(16, 0xaaa));
+ConstantRange ConstantRangeTest::Some2(APInt(16, 0xfff), APInt(16, 0x8000));
 ConstantRange ConstantRangeTest::Wrap(APInt(16, 0xaaa), APInt(16, 0xa));
----------------
I'd suggest moving this into the shl test, as it is only used there.


Repository:
  rL LLVM

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

https://reviews.llvm.org/D57983





More information about the llvm-commits mailing list