; This testcase can be simplified by "realizing" that alloca can never return
; null.
-; RUN: opt < %s -instcombine -simplifycfg -simplifycfg-require-and-preserve-domtree=1 -S | FileCheck %s
+; RUN: opt < %s -passes=instcombine,simplifycfg -simplifycfg-require-and-preserve-domtree=1 -S | FileCheck %s
; CHECK-NOT: br
declare i32 @bitmap_clear(...)
-; RUN: opt < %s -instcombine -mem2reg -simplifycfg -simplifycfg-require-and-preserve-domtree=1 | \
+; RUN: opt < %s -passes=instcombine,mem2reg,simplifycfg -simplifycfg-require-and-preserve-domtree=1 | \
; RUN: llvm-dis | grep -v store | not grep "i32 1"
; Test to make sure that instcombine does not accidentally propagate the load
-; RUN: opt < %s -simplifycfg -simplifycfg-require-and-preserve-domtree=1 -instcombine -S | grep 0x7FF8000000000000 | count 12
-; RUN: opt < %s -simplifycfg -simplifycfg-require-and-preserve-domtree=1 -instcombine -S | grep "0\.0" | count 3
-; RUN: opt < %s -simplifycfg -simplifycfg-require-and-preserve-domtree=1 -instcombine -S | grep "3\.5" | count 1
+; RUN: opt < %s -passes=simplifycfg,instcombine -simplifycfg-require-and-preserve-domtree=1 -S | grep 0x7FF8000000000000 | count 12
+; RUN: opt < %s -passes=simplifycfg,instcombine -simplifycfg-require-and-preserve-domtree=1 -S | grep "0\.0" | count 3
+; RUN: opt < %s -passes=simplifycfg,instcombine -simplifycfg-require-and-preserve-domtree=1 -S | grep "3\.5" | count 1
;
; ModuleID = 'apf.c'
-; RUN: opt < %s -simplifycfg -simplifycfg-require-and-preserve-domtree=1 -instcombine -S | grep 0x3FB99999A0000000 | count 2
-; RUN: opt < %s -simplifycfg -simplifycfg-require-and-preserve-domtree=1 -instcombine -S | grep 0xBFB99999A0000000 | count 2
+; RUN: opt < %s -passes=simplifycfg,instcombine -simplifycfg-require-and-preserve-domtree=1 -S | grep 0x3FB99999A0000000 | count 2
+; RUN: opt < %s -passes=simplifycfg,instcombine -simplifycfg-require-and-preserve-domtree=1 -S | grep 0xBFB99999A0000000 | count 2
; check constant folding for 'frem'. PR 3316.
; ModuleID = 'tt.c'
-; RUN: opt < %s -inline -instcombine -function-attrs | llvm-dis
+; RUN: opt < %s -passes=inline,instcombine,function-attrs | llvm-dis
;
; Check that nocapture attributes are added when run after an SCC pass.
; PR3520
; NOTE: Assertions have been autogenerated by utils/update_test_checks.py
-; RUN: opt -instcombine -instcombine-infinite-loop-threshold=2 -S < %s | FileCheck %s
+; RUN: opt -passes=instcombine -instcombine-infinite-loop-threshold=2 -S < %s | FileCheck %s
; <rdar://problem/8606771>
define i32 @main(i32 %argc) {
; NOTE: Assertions have been autogenerated by utils/update_test_checks.py
-; RUN: opt < %s -mtriple=amdgcn-amd-amdhsa -instcombine -S | FileCheck %s
+; RUN: opt < %s -mtriple=amdgcn-amd-amdhsa -passes=instcombine -S | FileCheck %s
; Optimize the intrinsic away if the argument is uniform.
define i32 @test_constant() {
; NOTE: Assertions have been autogenerated by utils/update_test_checks.py
-; RUN: opt -S -inline -instcombine %s | FileCheck %s --check-prefixes=CHECK,CHECK-INLINE
-; RUN: opt -S -instcombine %s | FileCheck %s --check-prefixes=CHECK,CHECK-NOINLINE
+; RUN: opt -S -passes=inline,instcombine %s | FileCheck %s --check-prefixes=CHECK,CHECK-INLINE
+; RUN: opt -S -passes=instcombine %s | FileCheck %s --check-prefixes=CHECK,CHECK-NOINLINE
define ptr @widen_align_from_allocalign_callsite() {
; CHECK-LABEL: @widen_align_from_allocalign_callsite(
ret ptr %call
}
-; -inline is able to make my_aligned_alloc_3's arguments disappear and directly
+; -passes=inline is able to make my_aligned_alloc_3's arguments disappear and directly
; call my_aligned_alloc_2, but the latter has no allocalign so the alignment just
; disappears. This is conservatively correct but undesirable because we can't
; figure out the `align 128` on the return value once the call is directly on
ret i32 %t4
}
-; FIXME: This test should only need -instsimplify (ValueTracking / computeKnownBits), not -passes=instcombine.
+; FIXME: This test should only need -passes=instsimplify (ValueTracking / computeKnownBits), not -passes=instcombine.
define <2 x i32> @PR24942(<2 x i32> %x) {
; CHECK-LABEL: @PR24942(
-; RUN: opt < %s -loop-unroll -instcombine -S | FileCheck %s
+; RUN: opt < %s -passes=loop-unroll,instcombine -S | FileCheck %s
; This test is a worst-case scenario for bitreversal/byteswap detection.
; After loop unrolling (the unrolled loop is unreadably large so it has been kept
-; RUN: opt < %s -instcombine -simplifycfg -simplifycfg-require-and-preserve-domtree=1 -S |\
+; RUN: opt < %s -passes=instcombine,simplifycfg -simplifycfg-require-and-preserve-domtree=1 -S |\
; RUN: not grep "call void @abort"
@b_rec.0 = external global i32 ; <ptr> [#uses=2]
-; RUN: opt < %s -instcombine -always-inline -S | FileCheck %s
+; RUN: opt < %s -passes='function(instcombine),always-inline' -S | FileCheck %s
define internal void @foo(ptr) alwaysinline {
ret void
; NOTE: Assertions have been autogenerated by utils/update_test_checks.py
-; RUN: opt -S -instcombine %s | FileCheck %s
+; RUN: opt -S -passes=instcombine %s | FileCheck %s
; Treatment of operation with unused result.
-; RUN: opt -verify -instcombine < %s
+; RUN: opt -passes=verify,instcombine < %s
%Foo = type <{ i8, x86_fp80 }>
define i8 @t(ptr %arg) {
; or into
; x ^ (~y)
-; While -reassociate does handle this simple pattern, it does not handle
+; While -passes=reassociate does handle this simple pattern, it does not handle
; the more complicated motivating pattern.
; ============================================================================ ;
; Test that -disable-simplify-libcalls is wired up correctly.
;
-; RUN: opt < %s -instcombine -disable-simplify-libcalls -S | FileCheck %s
+; RUN: opt < %s -passes=instcombine -disable-simplify-libcalls -S | FileCheck %s
; RUN: opt < %s -passes=instcombine -disable-simplify-libcalls -S | FileCheck %s
target datalayout = "e-p:64:64:64-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:64:64-f32:32:32-f64:64:64-v64:64:64-v128:128:128-a0:0:64-s0:64:64-f80:128:128-n8:16:32:64-S128"
; Hand-reduced from this example.
; -g -O -mllvm -disable-llvm-optzns -gno-column-info
-; plus opt -sroa -instcombine -inline
+; plus opt -sroa -passes=instcombine -inline
; #include <stdio.h>
;
-; RUN: opt < %s -inline -instcombine -S | FileCheck %s
+; RUN: opt < %s -passes=inline,instcombine -S | FileCheck %s
; This test case exposed a bug in instcombine where the early
; DCE of a call wasn't recognized as changing the IR.
-; RUN: opt -passes=instcombine -S %s | FileCheck %s
+; RUN: opt -passes=instcombine -S %s | FileCheck %s
target datalayout = "e-p:32:32:32-p1:16:16:16-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:32:64-f32:32:32-f64:32:64-v64:64:64-v128:128:128-a0:0:64-f80:128:128"
target triple = "i386-apple-darwin9.6"
; NOTE: Assertions have been autogenerated by utils/update_test_checks.py
-; RUN: opt -S -instcombine %s | FileCheck %s
+; RUN: opt -S -passes=instcombine %s | FileCheck %s
@var = external global i32, align 4
; sub %y, (xor %x, -1)
; Transform it to:
; add (add %x, 1), %y
-; We prefer this form because that is what -reassociate would produce.
+; We prefer this form because that is what -passes=reassociate would produce.
;------------------------------------------------------------------------------;
; Scalar tests
; NOTE: Assertions have been autogenerated by utils/update_test_checks.py
-; RUN: opt -S -instcombine -opaque-pointers < %s | FileCheck %s
+; RUN: opt -S -passes=instcombine -opaque-pointers < %s | FileCheck %s
@g = global [16 x i16] zeroinitializer
;
; RUN: opt < %s -passes=instcombine -S | FileCheck %s
; RUN: opt < %s -passes='require<profile-summary>,function(instcombine)' -pgso -S | FileCheck %s -check-prefix=PGSO
-; RUN: opt < %s -instcombine -pgso=false -S | FileCheck %s -check-prefix=NPGSO
+; RUN: opt < %s -passes=instcombine -pgso=false -S | FileCheck %s -check-prefix=NPGSO
%struct._IO_FILE = type { i32, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, i32, i32, i32, i16, i8, [1 x i8], ptr, i64, ptr, ptr, ptr, ptr, i32, i32, [40 x i8] }
%struct._IO_marker = type { ptr, ptr, i32 }
-; RUN: opt -S -passes=verify < %s | FileCheck %s
+; RUN: opt -passes=verify -S < %s | FileCheck %s
target triple = "x86_64-unknown-linux-gnu"
-; RUN: opt < %s -inline -instcombine -S | FileCheck %s
+; RUN: opt < %s -passes=inline,instcombine -S | FileCheck %s
; PR22857: http://llvm.org/bugs/show_bug.cgi?id=22857
; The inliner should not add an edge to an intrinsic and
; NOTE: Assertions have been autogenerated by utils/update_test_checks.py
-; RUN: opt < %s -passes=instcombine -S | FileCheck %s
+; RUN: opt < %s -passes=instcombine -S | FileCheck %s
define void @test1(ptr %a, ptr readnone %a_end, ptr %b.i64) {
; CHECK-LABEL: @test1(
-; RUN: opt < %s -passes=instcombine -S | FileCheck %s
+; RUN: opt < %s -passes=instcombine -S | FileCheck %s
define void @test1(float* %a, float* readnone %a_end, i32* %b.i) {
; CHECK-LABEL: @test1
%a.addr.03 = phi float* [ %incdec.ptr, %for.body ], [ %a, %for.body.preheader ]
%b.addr.02 = phi i64 [ %add.int, %for.body ], [ %b, %for.body.preheader ]
; CHECK: %a.addr.03 = phi float* [ %incdec.ptr, %for.body ], [ %a, %for.body.preheader ]
-; CHECK-NOT: phi i64
+; CHECK-NOT: phi i64
%tmp = inttoptr i64 %b.addr.02 to float*
; CHECK-NOT: inttoptr
%tmp1 = load float, float* %tmp, align 4
%mul.i = fmul float %tmp1, 4.200000e+01
store float %mul.i, float* %a.addr.03, align 4
%add = getelementptr inbounds float, float* %tmp, i64 1
-; CHECK: %add =
+; CHECK: %add =
%add.int = ptrtoint float* %add to i64
; CHECK-NOT: ptrtoint
%incdec.ptr = getelementptr inbounds float, float* %a.addr.03, i64 1
-; CHECK: %incdec.ptr =
+; CHECK: %incdec.ptr =
%cmp = icmp ult float* %incdec.ptr, %a_end
br i1 %cmp, label %for.body, label %for.end
; NOTE: Assertions have been autogenerated by utils/update_test_checks.py
-; RUN: opt < %s -passes=instcombine -S | FileCheck %s
+; RUN: opt < %s -passes=instcombine -S | FileCheck %s
define void @test(ptr %a, ptr readnone %a_end, i64 %b) unnamed_addr {
; CHECK-LABEL: @test(
; NOTE: Assertions have been autogenerated by utils/update_test_checks.py
-; RUN: opt < %s -passes=instcombine -S | FileCheck %s
+; RUN: opt < %s -passes=instcombine -S | FileCheck %s
define void @test(ptr %a, ptr readnone %a_end, i64 %b, ptr %bf) unnamed_addr {
; CHECK-LABEL: @test(
; NOTE: Assertions have been autogenerated by utils/update_test_checks.py
-; RUN: opt < %s -passes=instcombine -S | FileCheck %s
+; RUN: opt < %s -passes=instcombine -S | FileCheck %s
define void @test(ptr %a, ptr readnone %a_end, i64 %b, ptr %bf) unnamed_addr {
; CHECK-LABEL: @test(
-; RUN: opt < %s -passes=instcombine -S
+; RUN: opt < %s -passes=instcombine -S
; no crash
%A = type { %B }
declare void @lazy() unnamed_addr #2 align 2
attributes #0 = { inlinehint sanitize_memory uwtable}
-attributes #1 = { nobuiltin }
-attributes #2 = { sanitize_memory uwtable }
+attributes #1 = { nobuiltin }
+attributes #2 = { sanitize_memory uwtable }
attributes #3 = { builtin }
; NOTE: Assertions have been autogenerated by utils/update_test_checks.py
-; RUN: opt < %s -passes=instcombine -S | FileCheck %s
+; RUN: opt < %s -passes=instcombine -S | FileCheck %s
define void @matching_phi(i64 %a, ptr %b, i1 %cond) {
; CHECK-LABEL: @matching_phi(
-; RUN: opt < %s -passes=instcombine -S | FileCheck %s
+; RUN: opt < %s -passes=instcombine -S | FileCheck %s
; PR45033: Don't try to insert a cast into a catchswich block.
; NOTE: Assertions have been autogenerated by utils/update_test_checks.py
-; RUN: opt < %s -instcombine -instcombine-infinite-loop-threshold=2 -S | FileCheck %s
+; RUN: opt < %s -passes=instcombine -instcombine-infinite-loop-threshold=2 -S | FileCheck %s
declare void @llvm.dbg.declare(metadata, metadata, metadata)
declare void @llvm.lifetime.start.p0(i64, ptr nocapture)
; Check that the instcombine result is the same with/without debug info.
; This is a regression test for a function taken from malloc-free-delete.ll.
-; RUN: opt < %s -instcombine -S > %t.no_dbg.ll
-; RUN: opt < %s -debugify-each -instcombine -S > %t.ll
+; RUN: opt < %s -passes=instcombine -S > %t.no_dbg.ll
+; RUN: opt < %s -debugify-each -passes=instcombine -S > %t.ll
; RUN: diff %t.no_dbg.ll %t.ll
declare void @free(ptr)
; NOTE: Assertions have been autogenerated by utils/update_test_checks.py
-; RUN: opt < %s -instcombine -instcombine-infinite-loop-threshold=3 -S | FileCheck %s
+; RUN: opt < %s -passes=instcombine -instcombine-infinite-loop-threshold=3 -S | FileCheck %s
@var_7 = external global i8, align 1
@var_1 = external global i32, align 4
; RUN: opt -passes=instcombine -S < %s | FileCheck %s
-; RUN: opt -debugify-each -instcombine -S < %s | FileCheck %s
+; RUN: opt -debugify-each -passes=instcombine -S < %s | FileCheck %s
; These are both direct calls, but make sure instcombine leaves the casts
; alone.
-; RUN: opt < %s -inline -instcombine -S | FileCheck %s
+; RUN: opt < %s -passes=inline,instcombine -S | FileCheck %s
; PR21403: http://llvm.org/bugs/show_bug.cgi?id=21403
; When the call to sqrtf is replaced by an intrinsic call to fabs,
-; it should not cause a problem in CGSCC.
+; it should not cause a problem in CGSCC.
define float @bar(float %f) #0 {
%mul = fmul fast float %f, %f
-; RUN: opt -instcombine -instcombine-code-sinking=0 -S < %s | FileCheck %s
+; RUN: opt -passes=instcombine -instcombine-code-sinking=0 -S < %s | FileCheck %s
define i32 @test(i1 %C, i32 %A, i32 %B) {
; CHECK-LABEL: @test(
; We need this pipeline because to trigger dominator info verification
; we have to compute the dominator before libcalls-shrinkwrap and
; have a pass which requires the dominator tree after.
-; RUN: opt -libcalls-shrinkwrap -instcombine -verify-dom-info %s
+; RUN: opt -passes=libcalls-shrinkwrap,instcombine -verify-dom-info %s
define void @main() {
%_tmp31 = call float @acosf(float 2.000000e+00)
; NOTE: Assertions have been autogenerated by utils/update_test_checks.py
-; RUN: opt -S -instcombine < %s | FileCheck %s
+; RUN: opt -S -passes=instcombine < %s | FileCheck %s
target datalayout = "p:8:8"
; transform.
;
; RUN: opt < %s -disable-output -debug-pass-manager 2>&1 -aa-pipeline=basic-aa,globals-aa \
-; RUN: -passes='require<globals-aa>,function(require<aa>,instcombine),function(require<aa>)' \
+; RUN: -passes='require<globals-aa>,function(require<aa>,instcombine),function(require<aa>)' \
; RUN: | FileCheck %s --check-prefix=AA
; AA: Running analysis: GlobalsAA
; AA: Running analysis: AAManager
; AA-NOT: Running analysis: BasicAA
;
; RUN: opt < %s -disable-output -debug-pass-manager 2>&1 \
-; RUN: -passes='require<domtree>,instcombine,require<domtree>' \
+; RUN: -passes='require<domtree>,instcombine,require<domtree>' \
; RUN: | FileCheck %s --check-prefix=DT
; DT: Running analysis: DominatorTreeAnalysis
; DT: Running pass: InstCombinePass on test
; NOTE: Assertions have been autogenerated by utils/update_test_checks.py UTC_ARGS: --function-signature --scrub-attributes
; Check that we can fold operations with (gep null) inputs.
; Note: the LLParser already does some constant folding, check that output first:
-; RUN: opt -S -passes=verify < %s | FileCheck %s --check-prefixes=ALL,LLPARSER
+; RUN: opt -passes=verify -S < %s | FileCheck %s --check-prefixes=ALL,LLPARSER
; We should be able to fold almost everything in InstSimplify other than the final test which requries InstCombine
; RUN: opt -S -passes=instsimplify < %s | FileCheck %s --allow-unused-prefixes --check-prefixes=ALL,CHECK,INTEGRAL,INSTSIMPLIFY,INTEGRAL-INSTSIMPLIFY
; RUN: opt -S -passes=instcombine < %s | FileCheck %s --allow-unused-prefixes --check-prefixes=ALL,CHECK,INTEGRAL,INSTCOMBINE,INTEGRAL-INSTCOMBINE
; NOTE: Assertions have been autogenerated by utils/update_test_checks.py
-; RUN: opt < %s -instcombine -inline -S | FileCheck %s
+; RUN: opt < %s -passes='function(instcombine),cgscc(inline)' -S | FileCheck %s
; PR3142
define i32 @a(i32 %X) {
-; RUN: opt < %s -debugify -instcombine -S | FileCheck %s
+; RUN: opt < %s -passes=debugify,instcombine -S | FileCheck %s
declare i32 @escape(i32)
; Test that the strto* library call simplifiers works correctly.
;
-; RUN: opt < %s -instcombine -inferattrs -S | FileCheck %s
+; RUN: opt < %s -passes='function(instcombine),inferattrs' -S | FileCheck %s
target datalayout = "e-p:32:32:32-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:32:64-f32:32:32-f64:32:64-v64:64:64-v128:128:128-a0:0:64-f80:128:128"
; NOTE: Assertions have been autogenerated by utils/update_test_checks.py
-; RUN: opt -S -instcombine -verify < %s | FileCheck %s
+; RUN: opt -S -passes=instcombine,verify < %s | FileCheck %s
define <vscale x 4 x i32> @alloca(<vscale x 4 x i32> %z) {
; CHECK-LABEL: @alloca(
; NOTE: Assertions have been autogenerated by utils/update_test_checks.py
-; RUN: opt < %s -instcombine -S -verify | FileCheck %s
+; RUN: opt < %s -passes=instcombine,verify -S | FileCheck %s
define <2 x i8> @constprop_load_bitcast(ptr %ptr) {
; CHECK-LABEL: @constprop_load_bitcast(