Skip to content
Commit b49b964b authored by Benjamin Kramer's avatar Benjamin Kramer
Browse files

InstCombine: Turn umul_with_overflow into mul nuw if we can prove that it cannot overflow.

This happens a lot in clang-compiled C++ code because it adds overflow checks to operator new[]:
  unsigned *foo(unsigned n) { return new unsigned[n]; }
We can optimize away the overflow check on 64 bit targets because (uint64_t)n*4 cannot overflow.

llvm-svn: 127418
parent 258a605f
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment