llvm-project/llvm/lib/Transforms
Sanjay Patel c1e0184317 [InstCombine] reduce even more unsigned saturated add with 'not' op
We want to use the sum in the icmp to allow matching with
m_UAddWithOverflow and eliminate the 'not'. This is discussed
in D51929 and is another step towards solving PR14613:
https://bugs.llvm.org/show_bug.cgi?id=14613

  Name: uaddsat, -1 fval
  %notx = xor i32 %x, -1
  %a = add i32 %x, %y
  %c = icmp ugt i32 %notx, %y
  %r = select i1 %c, i32 %a, i32 -1
  =>
  %a = add i32 %x, %y
  %c2 = icmp ugt i32 %y, %a
  %r = select i1 %c2, i32 -1, i32 %a

  Name: uaddsat, -1 fval + ult
  %notx = xor i32 %x, -1
  %a = add i32 %x, %y
  %c = icmp ult i32 %y, %notx
  %r = select i1 %c, i32 %a, i32 -1
  =>
  %a = add i32 %x, %y
  %c2 = icmp ugt i32 %y, %a
  %r = select i1 %c2, i32 -1, i32 %a

https://rise4fun.com/Alive/nTp

llvm-svn: 354393
2019-02-19 22:14:21 +00:00
..
AggressiveInstCombine Update the file headers across all of the LLVM projects in the monorepo 2019-01-19 08:50:56 +00:00
Coroutines [opaque pointer types] Pass value type to LoadInst creation. 2019-02-01 20:44:24 +00:00
Hello Update the file headers across all of the LLVM projects in the monorepo 2019-01-19 08:50:56 +00:00
IPO [HotColdSplit] Schedule splitting late to fix perf regression 2019-02-15 18:46:44 +00:00
InstCombine [InstCombine] reduce even more unsigned saturated add with 'not' op 2019-02-19 22:14:21 +00:00
Instrumentation [Instrumentation][NFC] Fix warning. 2019-02-14 12:10:49 +00:00
ObjCARC [opaque pointer types] Pass function type for CallBase::setCalledFunction. 2019-02-01 20:44:54 +00:00
Scalar [NFC] API for signaling that the current loop is being deleted 2019-02-19 11:14:05 +00:00
Utils [CodeExtractor] Do not lift lifetime.end markers for region inputs 2019-02-15 18:46:58 +00:00
Vectorize [MemorySSA & LoopPassManager] Add remaining book keeping [NFCI]. 2019-02-12 23:48:02 +00:00
CMakeLists.txt Another try to commit 323321 (aggressive instruction combine). 2018-01-25 12:06:32 +00:00
LLVMBuild.txt Update the file headers across all of the LLVM projects in the monorepo 2019-01-19 08:50:56 +00:00