mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-08-05 13:26:55 +00:00
Add 'umax' similar to 'smax' SCEV. Closes PR2003.
Parse reversed smax and umax as smin and umin and express them with negative or binary-not SCEVs (which are really just subtract under the hood). Parse 'xor %x, -1' as (-1 - %x). Remove dead code (ConstantInt::get always returns a ConstantInt). Don't use getIntegerSCEV(-1, Ty). The first value is an int, then it gets passed into a uint64_t. Instead, create the -1 directly from ConstantInt::getAllOnesValue(). git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@47360 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
17
test/Analysis/ScalarEvolution/2008-02-15-UMax.ll
Normal file
17
test/Analysis/ScalarEvolution/2008-02-15-UMax.ll
Normal file
@@ -0,0 +1,17 @@
|
||||
; RUN: llvm-as < %s | opt -analyze -scalar-evolution | grep umax
|
||||
; PR2003
|
||||
|
||||
define i32 @foo(i32 %n) {
|
||||
entry:
|
||||
br label %header
|
||||
header:
|
||||
%i = phi i32 [ 100, %entry ], [ %i.inc, %next ]
|
||||
%cond = icmp ult i32 %i, %n
|
||||
br i1 %cond, label %next, label %return
|
||||
next:
|
||||
%i.inc = add i32 %i, 1
|
||||
br label %header
|
||||
return:
|
||||
ret i32 %i
|
||||
}
|
||||
|
Reference in New Issue
Block a user