This updates NewGVN test cases that were running "opt -basic-aa -newgvn ..." to run "opt -passes=newgvn ..." instead. The pipeline will be more similar to what we used to have with legacy PM by doing it this way. The compatility mode that we've been using for awhile during transition from legacy PM to new PM, i.e. using the legacy syntax together with new PM, has resulted in a pipeline such as -passes='function(require<basic-aa>),function(newgvn)' but running the analysis in a separate function pass manager seem overly complicated for these tests. Another difference is that we will get the default aa-pipeline instead of only running basic-aa. That might be a bit questioned (given that the tests originally specified basic-aa). The output is however identival for all the test cases modified here regardless of using basic-aa or the default aa-pipeline. This is also another small step towards removal of the support for using the legacy PM syntax in opt. Differential Revision: https://reviews.llvm.org/D118340
45 lines
1.4 KiB
LLVM
45 lines
1.4 KiB
LLVM
; RUN: opt -passes=newgvn -S < %s | FileCheck %s
|
|
target datalayout = "e-m:x-p:32:32-i64:64-f80:32-n8:16:32-a:0:32-S32"
|
|
target triple = "i686-pc-windows-msvc"
|
|
|
|
%eh.ThrowInfo = type { i32, i8*, i8*, i8* }
|
|
%struct.A = type { i32* }
|
|
|
|
@"_TI1?AUA@@" = external constant %eh.ThrowInfo
|
|
|
|
define i8 @f() personality i32 (...)* @__CxxFrameHandler3 {
|
|
entry:
|
|
%b = alloca i8
|
|
%c = alloca i8
|
|
store i8 42, i8* %b
|
|
store i8 13, i8* %c
|
|
invoke void @_CxxThrowException(i8* %b, %eh.ThrowInfo* nonnull @"_TI1?AUA@@")
|
|
to label %unreachable unwind label %catch.dispatch
|
|
|
|
catch.dispatch: ; preds = %entry
|
|
%cs1 = catchswitch within none [label %catch] unwind to caller
|
|
|
|
catch: ; preds = %catch.dispatch
|
|
%catchpad = catchpad within %cs1 [i8* null, i32 64, i8* null]
|
|
store i8 5, i8* %b
|
|
catchret from %catchpad to label %try.cont
|
|
|
|
try.cont: ; preds = %catch
|
|
%load_b = load i8, i8* %b
|
|
%load_c = load i8, i8* %c
|
|
%add = add i8 %load_b, %load_c
|
|
ret i8 %add
|
|
|
|
unreachable: ; preds = %entry
|
|
unreachable
|
|
}
|
|
; CHECK-LABEL: define i8 @f(
|
|
; CHECK: %[[load_b:.*]] = load i8, i8* %b
|
|
; CHECK-NEXT: %[[load_c:.*]] = load i8, i8* %c
|
|
; CHECK-NEXT: %[[add:.*]] = add i8 %[[load_b]], %[[load_c]]
|
|
; CHECK-NEXT: ret i8 %[[add]]
|
|
|
|
declare i32 @__CxxFrameHandler3(...)
|
|
|
|
declare x86_stdcallcc void @_CxxThrowException(i8*, %eh.ThrowInfo*)
|