Files
clang-p2996/llvm/test/Transforms/InstSimplify/ConstProp/gep-alias.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

18 lines
773 B
LLVM

; RUN: opt -instcombine -S -o - %s | FileCheck %s
; Test that we don't replace an alias with its aliasee when simplifying GEPs.
; In this test case the transformation is invalid because it replaces the
; reference to the symbol "b" (which refers to whichever instance of "b"
; was chosen by the linker) with a reference to "a" (which refers to the
; specific instance of "b" in this module).
target datalayout = "e-m:e-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-unknown-linux-gnu"
@a = internal global [3 x i8*] zeroinitializer
@b = linkonce_odr alias [3 x i8*], [3 x i8*]* @a
define i8** @f() {
; CHECK: ret i8** getelementptr ([3 x i8*], [3 x i8*]* @b, i64 0, i64 1)
ret i8** getelementptr ([3 x i8*], [3 x i8*]* @b, i64 0, i64 1)
}