Files
clang-p2996/llvm/test/Transforms/InstSimplify/ConstProp/freeze.ll
Arthur Eubanks 486ed88533 [ConstProp] Remove ConstantPropagation
As discussed in
http://lists.llvm.org/pipermail/llvm-dev/2020-July/143801.html.

Currently no users outside of unit tests.

Replace all instances in tests of -constprop with -instsimplify.
Notable changes in tests:
* vscale.ll - @llvm.sadd.sat.nxv16i8 is evaluated by instsimplify, use a fake intrinsic instead
* InsertElement.ll - insertelement undef is removed by instsimplify in @insertelement_undef
llvm/test/Transforms/ConstProp moved to llvm/test/Transforms/InstSimplify/ConstProp

Reviewed By: lattner, nikic

Differential Revision: https://reviews.llvm.org/D85159
2020-08-26 15:51:30 -07:00

29 lines
723 B
LLVM

; NOTE: Assertions have been autogenerated by utils/update_test_checks.py
; RUN: opt < %s -instsimplify -S | FileCheck %s
@g = external global i16, align 1
@g2 = external global i16, align 1
define i64 @ptrdiff1() {
; CHECK-LABEL: @ptrdiff1(
; CHECK-NEXT: ret i64 sub (i64 ptrtoint (i16* @g to i64), i64 ptrtoint (i16* @g2 to i64))
;
%i = ptrtoint i16* @g to i64
%i2 = ptrtoint i16* @g2 to i64
%diff = sub i64 %i, %i2
%r = freeze i64 %diff
ret i64 %r
}
define i64 @ptrdiff2() {
; CHECK-LABEL: @ptrdiff2(
; CHECK-NEXT: ret i64 -2
;
%i = ptrtoint i16* @g to i64
%gep = getelementptr i16, i16* @g, i64 1
%i2 = ptrtoint i16* %gep to i64
%diff = sub i64 %i, %i2
%r = freeze i64 %diff
ret i64 %r
}