The only interesting test change is in @PR31262, where the following fold is now performed, while it previously was not: https://alive2.llvm.org/ce/z/a5Qmr6 llvm/test/Transforms/InstSimplify/ConstProp/gep.ll has not been updated, because there is a tradeoff between folding and inrange preservation there that we may want to discuss. Updates have been performed using: https://gist.github.com/nikic/98357b71fd67756b0f064c9517b62a34
13 lines
336 B
LLVM
13 lines
336 B
LLVM
; RUN: opt < %s -instcombine -S | grep "ret i32 0"
|
|
; PR4424
|
|
declare void @ext()
|
|
|
|
define i32 @foo(i32 %ptr) {
|
|
entry:
|
|
%zero = sub i32 %ptr, %ptr ; <i32> [#uses=1]
|
|
%div_zero = sdiv i32 %zero, ptrtoint (ptr getelementptr (i32, ptr null,
|
|
i32 1) to i32) ; <i32> [#uses=1]
|
|
ret i32 %div_zero
|
|
}
|
|
|