During icmp lowering it can happen that a constant value can be larger than expected (see the code around the change).
APInt::getMinSignedBits() must be checked again as the shift before can change the constant sign to positive.
I'm not sure it is the best fix possible though.
Details
Details
Diff Detail
Diff Detail
- Repository
- rL LLVM
Event Timeline
lib/CodeGen/SelectionDAG/TargetLowering.cpp | ||
---|---|---|
1727 ↗ | (On Diff #24120) | If it less than 64 you can fit the value in int64_t. If not you cannot. It's all about C++ types, not LLVM types. |
Comment Actions
LGTM.
lib/CodeGen/SelectionDAG/TargetLowering.cpp | ||
---|---|---|
1727 ↗ | (On Diff #24120) | Okay, thanks. It is that NewC.getSExtValue() gives the int64_t. |