Go to file
Florian Hahn 22a44bca40 [SCCP] Propagate integer range info for parameters in IPSCCP.
Summary:
This updates the SCCP solver to use of the ValueElement lattice for 
parameters, which provides integer range information. The range
information is used to remove unneeded icmp instructions.

For the following function, f() can be optimized to `ret i32 2` with
this change

  source_filename = "sccp.c"
  target datalayout = "e-m:e-i64:64-f80:128-n8:16:32:64-S128"
  target triple = "x86_64-unknown-linux-gnu"
  
  ; Function Attrs: norecurse nounwind readnone uwtable
  define i32 @main() local_unnamed_addr #0 {
  entry:
    %call = tail call fastcc i32 @f(i32 1)
    %call1 = tail call fastcc i32 @f(i32 47)
    %add3 = add nsw i32 %call, %call1
    ret i32 %add3
  }
  
  ; Function Attrs: noinline norecurse nounwind readnone uwtable
  define internal fastcc i32 @f(i32 %x) unnamed_addr #1 {
  entry:
    %c1 = icmp sle i32 %x, 100
  
    %cmp = icmp sgt i32 %x, 300
    %. = select i1 %cmp, i32 1, i32 2
    ret i32 %.
  }
  
  attributes #1 = { noinline }



Reviewers: davide, sanjoy, efriedma, dberlin

Reviewed By: davide, dberlin

Subscribers: mcrosier, gberry, mssimpso, dberlin, llvm-commits

Differential Revision: https://reviews.llvm.org/D36656

llvm-svn: 315288
2017-10-10 09:32:38 +00:00
clang Fix small nits in clang-refactor doc. 2017-10-10 09:00:56 +00:00
clang-tools-extra Revert "Revert r315214 since diff -Z isn't portable, this is breaking:" 2017-10-10 09:08:47 +00:00
compiler-rt [ubsan] Fix Asan internal alloc corruption in PR33221 test. 2017-10-09 22:52:13 +00:00
debuginfo-tests Revert r313600 due to bot failures on Green Dragon. 2017-09-19 14:51:37 +00:00
libclc Implement mem_fence on ptx 2017-10-09 19:43:04 +00:00
libcxx Remove unneeded typename from test 2017-10-10 07:42:19 +00:00
libcxxabi Fix ASAN build with older compiler-rt versions. 2017-09-14 22:37:34 +00:00
libunwind [docs] Mention that SjLj works on any OS on the archs where supported by the compiler 2017-10-06 19:14:07 +00:00
lld [ELF] - Improve "has non-ABS reloc" error. 2017-10-10 07:55:07 +00:00
lldb Update ABISysV_arm64::RegisterIsVolatile to accept registers prefixed with r 2017-10-09 17:49:32 +00:00
llgo irgen: Create functions instead of global variables for builtin hash and equal algorithms. 2017-06-04 22:11:28 +00:00
llvm [SCCP] Propagate integer range info for parameters in IPSCCP. 2017-10-10 09:32:38 +00:00
openmp KMP_HW_SUBSET vs KMP_PLACE_THREADS rival envirables fix 2017-10-06 19:23:19 +00:00
parallel-libs [Axccel] Remove -Wno-missing-braces in build 2016-12-19 21:34:07 +00:00
polly Rename OptimizationDiagnosticInfo.h to OptimizationRemarkEmitter.h 2017-10-09 23:49:08 +00:00