summaryrefslogtreecommitdiffstats
path: root/llvm/test/Transforms/InstCombine/compare-abs-nonzero.ll
blob: 49cd688bda027e565917a5b797b330ac16a6b16d (plain)
1
2
3
4
5
6
7
8
9
10
; RUN: opt < %s -instcombine -S | grep -v {select}

define zeroext i1 @cmpabs(i64 %val) nounwind uwtable readnone ssp {
entry:
  %sub = sub nsw i64 0, %val
  %cmp = icmp slt i64 %val, 0
  %sub.val = select i1 %cmp, i64 %sub, i64 %val
  %tobool = icmp ne i64 %sub.val, 0
  ret i1 %tobool
}
OpenPOWER on IntegriCloud