mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-08-04 06:26:28 +00:00
[ConstantFolding] Support folding loads from a GlobalAlias
The MSVC ABI requires that we generate an alias for the vtable which means looking through a GlobalAlias which cannot be overridden improves our ability to devirtualize. Found while investigating PR20801. Patch by Andrew Zhogin! Differential Revision: http://reviews.llvm.org/D11306 git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@242955 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
11
test/Transforms/SCCP/global-alias-constprop.ll
Normal file
11
test/Transforms/SCCP/global-alias-constprop.ll
Normal file
@@ -0,0 +1,11 @@
|
||||
; RUN: opt < %s -sccp -S | FileCheck %s
|
||||
|
||||
@0 = private unnamed_addr constant [2 x i32] [i32 -1, i32 1]
|
||||
@"\01??_7A@@6B@" = unnamed_addr alias getelementptr inbounds ([2 x i32], [2 x i32]* @0, i32 0, i32 1)
|
||||
|
||||
; CHECK: ret i32 1
|
||||
|
||||
define i32 @main() {
|
||||
%a = load i32, i32* @"\01??_7A@@6B@"
|
||||
ret i32 %a
|
||||
}
|
Reference in New Issue
Block a user