efriedma added subscribers: reames, efriedma.
efriedma added inline comments.


================
Comment at: llvm/lib/IR/ConstantRange.cpp:724
     auto BW = getBitWidth();
-    APInt Min = APInt::getMinValue(BW).zextOrSelf(ResultBitWidth);
-    APInt Max = APInt::getMaxValue(BW).zextOrSelf(ResultBitWidth);
+    APInt Min = APInt::getMinValue(BW);
+    APInt Max = APInt::getMaxValue(BW);
----------------
Making the bitwidth of the result here not equal to ResultBitWidth seems 
suspect.

I think there should just be an `if (ResultBitWidth < BW) return 
getFull(ResultBitWidth);` here.  Then a simple conversion just works.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D125557

_______________________________________________
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to