id
stringlengths 10
66
| text
stringlengths 1
641k
| source
stringclasses 1
value | added
stringdate 2025-04-01 17:48:26
2025-04-01 17:51:04
| metadata
dict |
---|---|---|---|---|
commitpackft-llvm-155
|
; If the result of an instruction is only used outside of the loop, sink
; the instruction to the exit blocks instead of executing it on every
; iteration of the loop.
;
; RUN: llvm-as < %s | opt -licm | llvm-dis | grep -C1 mul | grep Out:
int %test(int %N) {
Entry:
br label %Loop
Loop:
%N_addr.0.pn = phi int [ %dec, %Loop ], [ %N, %Entry ]
%tmp.6 = mul int %N, %N_addr.0.pn
%dec = add int %N_addr.0.pn, -1
%tmp.1 = setne int %N_addr.0.pn, 1
br bool %tmp.1, label %Loop, label %Out
Out:
ret int %tmp.6
}
Make the test a bit harder so that we test to ensure that _both_ instructions are sunk
; If the result of an instruction is only used outside of the loop, sink
; the instruction to the exit blocks instead of executing it on every
; iteration of the loop.
;
; RUN: llvm-as < %s | opt -licm | llvm-dis | grep -C1 mul | grep Out:
int %test(int %N) {
Entry:
br label %Loop
Loop:
%N_addr.0.pn = phi int [ %dec, %Loop ], [ %N, %Entry ]
%tmp.6 = mul int %N, %N_addr.0.pn
%tmp.7 = sub int %tmp.6, %N
%dec = add int %N_addr.0.pn, -1
%tmp.1 = setne int %N_addr.0.pn, 1
br bool %tmp.1, label %Loop, label %Out
Out:
ret int %tmp.7
}
|
Data Provenance Initiative
|
2025-04-01T17:48:26.624246
|
{
"license": [
"Apache 2 License - https://www.apache.org/licenses/LICENSE-2.0",
"BSD 2-Clause",
"BSD 3-Clause",
"MIT License",
"MIT License"
],
"license_url": "https://opensource.org/licenses/MIT",
"language": [
"English",
"LLVM"
],
"url": "https://github.com/bigcode-project/octopack",
"dataset_id": "commitpackft-llvm",
"response": ""
}
|
commitpackft-llvm-156
|
; The %A getelementptr instruction should be eliminated here
; RUN: if as < %s | opt -instcombine -die | dis | grep getelementptr | grep '%A'
; RUN: then exit 1
; RUN: else exit 0
; RUN: fi
implementation
int *"foo1"(int * %I) { ; Test noop elimination
%A = getelementptr int* %I, uint 0
ret int * %A
}
int* %foo2(int* %I) { ; Test noop elimination
%A = getelementptr int* %I
ret int* %A
}
int* %foo3(int * %I) { ; Test that two array indexing geps fold
%A = getelementptr int* %I, uint 17
%B = getelementptr int* %A, uint 4
ret int* %B
}
int* %foo4({int} *%I) { ; Test that two getelementptr insts fold
%A = getelementptr {int}* %I, uint 1
%B = getelementptr {int}* %A, uint 0, ubyte 0
ret int* %B
}
Add new testcase for gep instruction -> get constexpr promotion
; The %A getelementptr instruction should be eliminated here
; RUN: if as < %s | opt -instcombine -die | dis | grep getelementptr | grep '%A'
; RUN: then exit 1
; RUN: else exit 0
; RUN: fi
%Global = constant [10 x sbyte] c"helloworld"
implementation
int *"foo1"(int * %I) { ; Test noop elimination
%A = getelementptr int* %I, uint 0
ret int * %A
}
int* %foo2(int* %I) { ; Test noop elimination
%A = getelementptr int* %I
ret int* %A
}
int* %foo3(int * %I) { ; Test that two array indexing geps fold
%A = getelementptr int* %I, uint 17
%B = getelementptr int* %A, uint 4
ret int* %B
}
int* %foo4({int} *%I) { ; Test that two getelementptr insts fold
%A = getelementptr {int}* %I, uint 1
%B = getelementptr {int}* %A, uint 0, ubyte 0
ret int* %B
}
sbyte * %foo5() {
; This should be turned into a constexpr instead of being an instruction
%A = getelementptr [10 x sbyte]* %Global, uint 0, uint 4
ret sbyte* %A
}
|
Data Provenance Initiative
|
2025-04-01T17:48:26.624250
|
{
"license": [
"Apache 2 License - https://www.apache.org/licenses/LICENSE-2.0",
"BSD 2-Clause",
"BSD 3-Clause",
"MIT License",
"MIT License"
],
"license_url": "https://opensource.org/licenses/MIT",
"language": [
"English",
"LLVM"
],
"url": "https://github.com/bigcode-project/octopack",
"dataset_id": "commitpackft-llvm",
"response": ""
}
|
commitpackft-llvm-157
|
; RUN: llvm-as < %s | opt -instcombine | llvm-dis | grep sub &&
; RUN: llvm-as < %s | opt -instcombine | llvm-dis | grep add
<4 x float> %test(<4 x float> %tmp26, <4 x float> %tmp53) {
; (X+Y)-Y != X for fp vectors.
%tmp64 = add <4 x float> %tmp26, %tmp53
%tmp75 = sub <4 x float> %tmp64, %tmp53
ret <4 x float> %tmp75
}
Update this test to use llvm-update.
; RUN: llvm-upgrade < %s | llvm-as | opt -instcombine | llvm-dis | grep sub &&
; RUN: llvm-upgrade < %s | llvm-as | opt -instcombine | llvm-dis | grep add
<4 x float> %test(<4 x float> %tmp26, <4 x float> %tmp53) {
; (X+Y)-Y != X for fp vectors.
%tmp64 = add <4 x float> %tmp26, %tmp53
%tmp75 = sub <4 x float> %tmp64, %tmp53
ret <4 x float> %tmp75
}
|
Data Provenance Initiative
|
2025-04-01T17:48:26.624254
|
{
"license": [
"Apache 2 License - https://www.apache.org/licenses/LICENSE-2.0",
"BSD 2-Clause",
"BSD 3-Clause",
"MIT License",
"MIT License"
],
"license_url": "https://opensource.org/licenses/MIT",
"language": [
"English",
"LLVM"
],
"url": "https://github.com/bigcode-project/octopack",
"dataset_id": "commitpackft-llvm",
"response": ""
}
|
commitpackft-llvm-158
|
; This test makes sure that these instructions are properly eliminated.
;
; RUN: if as < %s | opt -instcombine -dce | dis | grep phi
; RUN: then exit 1
; RUN: else exit 0
; RUN: fi
implementation
int "test1"(int %A) {
BB0: br label %BB1
BB1:
%B = phi int [%A, %BB0] ; Combine away one argument PHI nodes
ret int %B
}
Make the testcase more interesting so that DCE does not eliminate it. Use DIE instead of DCE anyway
; This test makes sure that these instructions are properly eliminated.
;
; RUN: if as < %s | opt -instcombine -die | dis | grep phi
; RUN: then exit 1
; RUN: else exit 0
; RUN: fi
implementation
int "test1"(int %A, bool %b) {
BB0: br bool %b, label %BB1, label %BB2
BB1:
%B = phi int [%A, %BB0] ; Combine away one argument PHI nodes
ret int %B
BB2:
ret int %A
}
|
Data Provenance Initiative
|
2025-04-01T17:48:26.624258
|
{
"license": [
"Apache 2 License - https://www.apache.org/licenses/LICENSE-2.0",
"BSD 2-Clause",
"BSD 3-Clause",
"MIT License",
"MIT License"
],
"license_url": "https://opensource.org/licenses/MIT",
"language": [
"English",
"LLVM"
],
"url": "https://github.com/bigcode-project/octopack",
"dataset_id": "commitpackft-llvm",
"response": ""
}
|
commitpackft-llvm-159
|
; R UN: llc < %s -march=x86-64 | FileCheck %s
; R UN: llc < %s -march=x86 | FileCheck %s
; C HECK: _memcpy
define void @foo([40000 x i32] *%P) nounwind {
call void @bar([40000 x i32] * byval align 1 %P)
ret void
}
declare void @bar([40000 x i32] *%P )
Tweak test to work on Linux.
; RUN: llc < %s -march=x86-64 | FileCheck %s
; RUN: llc < %s -march=x86 | FileCheck %s
; CHECK: memcpy
define void @foo([40000 x i32] *%P) nounwind {
call void @bar([40000 x i32] * byval align 1 %P)
ret void
}
declare void @bar([40000 x i32] *%P )
|
Data Provenance Initiative
|
2025-04-01T17:48:26.624263
|
{
"license": [
"Apache 2 License - https://www.apache.org/licenses/LICENSE-2.0",
"BSD 2-Clause",
"BSD 3-Clause",
"MIT License",
"MIT License"
],
"license_url": "https://opensource.org/licenses/MIT",
"language": [
"English",
"LLVM"
],
"url": "https://github.com/bigcode-project/octopack",
"dataset_id": "commitpackft-llvm",
"response": ""
}
|
commitpackft-llvm-160
|
; RUN: llvm-as < %s | llc -march=x86 -mattr=sse2 -disable-mmx -o %t -f
; RUN: grep divdi3 %t | count 2
; Test case for r63760 where we generate a legalization assert that an illegal
; type has been inserted by LegalizeDAG after LegalizeType has run. With sse2,
; v2i64 is a legal type but with mmx disabled, i64 is an illegal type. When
; legalizing the divide in LegalizeDAG, we scalarize the vector divide and make
; two 64 bit divide library calls which introduces i64 nodes that needs to be
; promoted.
define <2 x i64> @test_long_div(<2 x i64> %num, <2 x i64> %div) {
%div.r = sdiv <2 x i64> %num, %div
ret <2 x i64> %div.r
}
Make the grep line in this test more specific, to avoid unintended matches.
; RUN: llvm-as < %s | llc -march=x86 -mattr=sse2 -disable-mmx -o %t -f
; RUN: grep {call.*divdi3} %t | count 2
; Test case for r63760 where we generate a legalization assert that an illegal
; type has been inserted by LegalizeDAG after LegalizeType has run. With sse2,
; v2i64 is a legal type but with mmx disabled, i64 is an illegal type. When
; legalizing the divide in LegalizeDAG, we scalarize the vector divide and make
; two 64 bit divide library calls which introduces i64 nodes that needs to be
; promoted.
define <2 x i64> @test_long_div(<2 x i64> %num, <2 x i64> %div) {
%div.r = sdiv <2 x i64> %num, %div
ret <2 x i64> %div.r
}
|
Data Provenance Initiative
|
2025-04-01T17:48:26.624266
|
{
"license": [
"Apache 2 License - https://www.apache.org/licenses/LICENSE-2.0",
"BSD 2-Clause",
"BSD 3-Clause",
"MIT License",
"MIT License"
],
"license_url": "https://opensource.org/licenses/MIT",
"language": [
"English",
"LLVM"
],
"url": "https://github.com/bigcode-project/octopack",
"dataset_id": "commitpackft-llvm",
"response": ""
}
|
commitpackft-llvm-161
|
; This testcase ensures that redundant loads are preserved when they are not
; allowed to be eliminated.
; RUN: as < %s | dis > Output/%s.before
; RUN: as < %s | opt -load-vn -gcse | dis > Output/%s.after
; RUN: echo some output
; RUN: diff Output/%s.before Output/%s.after
;
int "test1"(int* %P) {
%A = load int* %P
store int 1, int * %P
%B = load int* %P
%C = add int %A, %B
ret int %C
}
int "test2"(int* %P) {
%A = load int* %P
br label %BB2
BB2:
store int 5, int * %P
br label %BB3
BB3:
%B = load int* %P
%C = add int %A, %B
ret int %C
}
Fix testcase to work with store forwarding
; This testcase ensures that redundant loads are preserved when they are not
; allowed to be eliminated.
; RUN: as < %s | opt -load-vn -gcse | dis | grep sub
;
int %test1(int* %P) {
%A = load int* %P
store int 1, int* %P
%B = load int* %P
%C = sub int %A, %B
ret int %C
}
int %test2(int* %P) {
%A = load int* %P
br label %BB2
BB2:
store int 5, int* %P
br label %BB3
BB3:
%B = load int* %P
%C = sub int %A, %B
ret int %C
}
|
Data Provenance Initiative
|
2025-04-01T17:48:26.624270
|
{
"license": [
"Apache 2 License - https://www.apache.org/licenses/LICENSE-2.0",
"BSD 2-Clause",
"BSD 3-Clause",
"MIT License",
"MIT License"
],
"license_url": "https://opensource.org/licenses/MIT",
"language": [
"English",
"LLVM"
],
"url": "https://github.com/bigcode-project/octopack",
"dataset_id": "commitpackft-llvm",
"response": ""
}
|
commitpackft-llvm-162
|
; RUN: llvm-as < %s | llc -march=x86 | grep 18446744073709551615 | count 14
; RUN: llvm-as < %s | llc -march=ppc32 | grep 4294967295 | count 28
; These static initializers are too big to hand off to assemblers
; as monolithic blobs.
@x = global i128 -1
@y = global i256 -1
@z = global i512 -1
Add a target triple; apparently LLVM doesn't use 64-bit data directives on darwin.
; RUN: llvm-as < %s | llc -march=x86 -mtriple=i686-pc-linux-gnu | grep 18446744073709551615 | count 14
; RUN: llvm-as < %s | llc -march=ppc32 | grep 4294967295 | count 28
; These static initializers are too big to hand off to assemblers
; as monolithic blobs.
@x = global i128 -1
@y = global i256 -1
@z = global i512 -1
|
Data Provenance Initiative
|
2025-04-01T17:48:26.624274
|
{
"license": [
"Apache 2 License - https://www.apache.org/licenses/LICENSE-2.0",
"BSD 2-Clause",
"BSD 3-Clause",
"MIT License",
"MIT License"
],
"license_url": "https://opensource.org/licenses/MIT",
"language": [
"English",
"LLVM"
],
"url": "https://github.com/bigcode-project/octopack",
"dataset_id": "commitpackft-llvm",
"response": ""
}
|
commitpackft-llvm-163
|
; Instcombine was missing a test that caused it to make illegal transformations
; sometimes. In this case, it transforms the sub into an add:
; RUN: if as < %s | opt -instcombine | dis | grep add
; RUN: then exit 1
; RUN: else exit 0
; RUN: fi
;
int "test"(int %i, int %j) {
%A = mul int %i, %j
%B = sub int 2, %A
ret int %B
}
Make sure there is SOME output always so the test is not rerun when unneccesary.
; Instcombine was missing a test that caused it to make illegal transformations
; sometimes. In this case, it transforms the sub into an add:
; RUN: echo foo
; RUN: if as < %s | opt -instcombine | dis | grep add
; RUN: then exit 1
; RUN: else exit 0
; RUN: fi
;
int "test"(int %i, int %j) {
%A = mul int %i, %j
%B = sub int 2, %A
ret int %B
}
|
Data Provenance Initiative
|
2025-04-01T17:48:26.624278
|
{
"license": [
"Apache 2 License - https://www.apache.org/licenses/LICENSE-2.0",
"BSD 2-Clause",
"BSD 3-Clause",
"MIT License",
"MIT License"
],
"license_url": "https://opensource.org/licenses/MIT",
"language": [
"English",
"LLVM"
],
"url": "https://github.com/bigcode-project/octopack",
"dataset_id": "commitpackft-llvm",
"response": ""
}
|
commitpackft-llvm-164
|
; RUN: llc -march amdgcn %s -filetype=obj
; RUN: llc -march amdgcn <%s | FileCheck %s
define amdgpu_kernel void @f() {
; CHECK: ; divergent unreachable
call void @llvm.amdgcn.unreachable()
ret void
}
declare void @llvm.amdgcn.unreachable()
Fix test from polluting the source tree
; RUN: llc -march amdgcn %s -filetype=obj -o /dev/null
; RUN: llc -march amdgcn <%s | FileCheck %s
define amdgpu_kernel void @f() {
; CHECK: ; divergent unreachable
call void @llvm.amdgcn.unreachable()
ret void
}
declare void @llvm.amdgcn.unreachable()
|
Data Provenance Initiative
|
2025-04-01T17:48:26.624282
|
{
"license": [
"Apache 2 License - https://www.apache.org/licenses/LICENSE-2.0",
"BSD 2-Clause",
"BSD 3-Clause",
"MIT License",
"MIT License"
],
"license_url": "https://opensource.org/licenses/MIT",
"language": [
"English",
"LLVM"
],
"url": "https://github.com/bigcode-project/octopack",
"dataset_id": "commitpackft-llvm",
"response": ""
}
|
commitpackft-llvm-165
|
; RUN: llvm-as < %s | llvm-dis > %t1.ll
; RUN: llvm-as %t1.ll -o - | llvm-dis > %t2.ll
; RUN: diff %t1.ll %t2.ll
; XFAIL: *
%union.anon = type union { i8, i32, float }
@union1 = constant union { i32, i8 } { i32 4 }
@union2 = constant union { i32, i8 } insertvalue(union { i32, i8 } undef, i32 4, 0)
define void @"Unions" () {
ret void
}
Revert r98666 too; it's checkin-without-testing day!
; RUN: llvm-as < %s | llvm-dis > %t1.ll
; RUN: llvm-as %t1.ll -o - | llvm-dis > %t2.ll
; RUN: diff %t1.ll %t2.ll
%union.anon = type union { i8, i32, float }
@union1 = constant union { i32, i8 } { i32 4 }
@union2 = constant union { i32, i8 } insertvalue(union { i32, i8 } undef, i32 4, 0)
define void @"Unions" () {
ret void
}
|
Data Provenance Initiative
|
2025-04-01T17:48:26.624285
|
{
"license": [
"Apache 2 License - https://www.apache.org/licenses/LICENSE-2.0",
"BSD 2-Clause",
"BSD 3-Clause",
"MIT License",
"MIT License"
],
"license_url": "https://opensource.org/licenses/MIT",
"language": [
"English",
"LLVM"
],
"url": "https://github.com/bigcode-project/octopack",
"dataset_id": "commitpackft-llvm",
"response": ""
}
|
commitpackft-llvm-166
|
; RUN: llc < %s -march=x86 | FileCheck %s
; This should not load or store the top part of *P.
define void @test(i64* %P) nounwind {
; CHECK-LABEL: test:
; CHECK: movl 4(%esp), %[[REGISTER:.*]]
; CHECK-NOT: 4(%[[REGISTER]])
; CHECK: ret
%tmp1 = load i64, i64* %P, align 8 ; <i64> [#uses=1]
%tmp2 = xor i64 %tmp1, 1 ; <i64> [#uses=1]
store i64 %tmp2, i64* %P, align 8
ret void
}
Fix old testcase for dead store to match the original intent.
; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py
; RUN: llc < %s -mtriple=i686-pc-linux-gnu | FileCheck %s
; FIXME: This should not load or store the top part of *P.
define void @test(i64* %P) nounwind {
; CHECK-LABEL: test:
; CHECK: # BB#0:
; CHECK-NEXT: movl {{[0-9]+}}(%esp), %eax
; CHECK-NEXT: movl (%eax), %ecx
; CHECK-NEXT: movl 4(%eax), %edx
; CHECK-NEXT: xorl $1, %ecx
; CHECK-NEXT: orl $2, %ecx
; CHECK-NEXT: movl %edx, 4(%eax)
; CHECK-NEXT: movl %ecx, (%eax)
; CHECK-NEXT: retl
%tmp1 = load i64, i64* %P, align 8
%tmp2 = xor i64 %tmp1, 1
%tmp3 = or i64 %tmp2, 2
store i64 %tmp3, i64* %P, align 8
ret void
}
|
Data Provenance Initiative
|
2025-04-01T17:48:26.624289
|
{
"license": [
"Apache 2 License - https://www.apache.org/licenses/LICENSE-2.0",
"BSD 2-Clause",
"BSD 3-Clause",
"MIT License",
"MIT License"
],
"license_url": "https://opensource.org/licenses/MIT",
"language": [
"English",
"LLVM"
],
"url": "https://github.com/bigcode-project/octopack",
"dataset_id": "commitpackft-llvm",
"response": ""
}
|
commitpackft-llvm-167
|
; REQUIRES: x86
; RUN: llvm-as %s -o %t1.o
; RUN: ld.lld -m elf_x86_64 %t1.o %t1.o -o %t.so -shared
target datalayout = "e-m:e-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-unknown-linux-gnu"
; Should not encounter a duplicate symbol error for @.str
@.str = private unnamed_addr constant [4 x i8] c"Hey\00", align 1
; Should not encounter a duplicate symbol error for @llvm.global_ctors
@llvm.global_ctors = appending global [1 x { i32, void ()*, i8* }] [{ i32, void ()*, i8* } { i32 65535, void ()* @ctor, i8* null }]
define internal void @ctor() {
ret void
}
Add a useful test case.
; REQUIRES: x86
; RUN: llvm-as %s -o %t1.o
; RUN: ld.lld -m elf_x86_64 %t1.o %t1.o -o %t.so -shared
target datalayout = "e-m:e-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-unknown-linux-gnu"
; Should not encounter a duplicate symbol error for @.str
@.str = private unnamed_addr constant [4 x i8] c"Hey\00", align 1
; Should not encounter a duplicate symbol error for @llvm.global_ctors
@llvm.global_ctors = appending global [1 x { i32, void ()*, i8* }] [{ i32, void ()*, i8* } { i32 65535, void ()* @ctor, i8* null }]
define internal void @ctor() {
ret void
}
; Should not try to merge a declaration into the combined module.
declare i32 @llvm.ctpop.i32(i32)
|
Data Provenance Initiative
|
2025-04-01T17:48:26.624293
|
{
"license": [
"Apache 2 License - https://www.apache.org/licenses/LICENSE-2.0",
"BSD 2-Clause",
"BSD 3-Clause",
"MIT License",
"MIT License"
],
"license_url": "https://opensource.org/licenses/MIT",
"language": [
"English",
"LLVM"
],
"url": "https://github.com/bigcode-project/octopack",
"dataset_id": "commitpackft-llvm",
"response": ""
}
|
commitpackft-llvm-168
|
; PR1318
; RUN: llvm-as < %s > %t.bc &&
; RUN: opt -load=%llvmlibsdir/LLVMHello%shlibext -hello \
; RUN: -disable-output %t.bc 2>&1 | grep Hello
@junk = global i32 0
define i32* @somefunk() {
ret i32* @junk
}
Simplify this test and correct redirection for Tcl exec.
; PR1318
; RUN: llvm-as < %s | opt -load=%llvmlibsdir/LLVMHello%shlibext -hello \
; RUN: -disable-output - |& grep Hello
@junk = global i32 0
define i32* @somefunk() {
ret i32* @junk
}
|
Data Provenance Initiative
|
2025-04-01T17:48:26.624296
|
{
"license": [
"Apache 2 License - https://www.apache.org/licenses/LICENSE-2.0",
"BSD 2-Clause",
"BSD 3-Clause",
"MIT License",
"MIT License"
],
"license_url": "https://opensource.org/licenses/MIT",
"language": [
"English",
"LLVM"
],
"url": "https://github.com/bigcode-project/octopack",
"dataset_id": "commitpackft-llvm",
"response": ""
}
|
commitpackft-llvm-169
|
; Verify that auto-upgrading intrinsics works with Lazy loaded bitcode
; Do setup work for all below tests: generate bitcode and combined index
; RUN: opt -module-summary %s -o %t.bc
; RUN: llvm-lto -thinlto-action=thinlink -o %t3.bc %t.bc %p/Inputs/autoupgrade.bc
; RUN: llvm-lto -thinlto-action=import %t.bc -thinlto-index=%t3.bc -o - | llvm-bcanalyzer -dump | FileCheck %s
; We can't use llvm-dis here, because it would do the autoupgrade itself.
; CHECK-NOT: 'llvm.invariant.start'
; CHECK: record string = 'llvm.invariant.start.p0i8'
; CHECK-NOT: 'llvm.invariant.start'
target datalayout = "e-m:o-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-apple-macosx10.11.0"
define i32 @main() #0 {
entry:
call void (...) @globalfunc1()
ret i32 0
}
declare void @globalfunc1(...) #1
Replace test from using llvm-lto to use llvm-link (NFC)
; Verify that auto-upgrading intrinsics works with Lazy loaded bitcode
; Do setup work for all below tests: generate bitcode and combined index
; RUN: opt -module-summary %s -o %t.bc
; We can't use llvm-dis here, because it would do the autoupgrade itself.
; RUN: llvm-link -summary-index=%t3.bc \
; RUN: -import=globalfunc1:%p/Inputs/autoupgrade.bc %t.bc \
; RUN: | llvm-bcanalyzer -dump | FileCheck %s
; CHECK-NOT: 'llvm.invariant.start'
; CHECK: record string = 'llvm.invariant.start.p0i8'
; CHECK-NOT: 'llvm.invariant.start'
target datalayout = "e-m:o-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-apple-macosx10.11.0"
define i32 @main() #0 {
entry:
call void (...) @globalfunc1()
ret i32 0
}
declare void @globalfunc1(...) #1
|
Data Provenance Initiative
|
2025-04-01T17:48:26.624300
|
{
"license": [
"Apache 2 License - https://www.apache.org/licenses/LICENSE-2.0",
"BSD 2-Clause",
"BSD 3-Clause",
"MIT License",
"MIT License"
],
"license_url": "https://opensource.org/licenses/MIT",
"language": [
"English",
"LLVM"
],
"url": "https://github.com/bigcode-project/octopack",
"dataset_id": "commitpackft-llvm",
"response": ""
}
|
commitpackft-llvm-170
|
; RUN: llvm-upgrade < %s | llvm-as | llc -march=arm &&
; RUN: llvm-upgrade < %s | llvm-as | llc -march=arm | grep align.*1 | wc | grep 1 &&
; RUN: llvm-upgrade < %s | llvm-as | llc -march=arm | grep align.*2 | wc | grep 2 &&
; RUN: llvm-upgrade < %s | llvm-as | llc -march=arm | grep align.*3 | wc | grep 2
%a = global bool true
%b = global sbyte 1
%c = global short 2
%d = global int 3
%e = global long 4
%f = global float 5.0
%g = global double 6.0
Make it work for both Linux and Mac OS.
; RUN: llvm-upgrade < %s | llvm-as | llc -march=arm &&
; RUN: llvm-upgrade < %s | llvm-as | llc -march=arm | grep align.*1 | wc | grep 1 &&
; RUN: llvm-upgrade < %s | llvm-as | llc -mtriple=arm-linux | grep align.*2 | wc | grep 2 &&
; RUN: llvm-upgrade < %s | llvm-as | llc -mtriple=arm-linux | grep align.*3 | wc | grep 2
; RUN: llvm-upgrade < %s | llvm-as | llc -mtriple=arm-apple-darwin | grep align.*2 | wc | grep 4
%a = global bool true
%b = global sbyte 1
%c = global short 2
%d = global int 3
%e = global long 4
%f = global float 5.0
%g = global double 6.0
|
Data Provenance Initiative
|
2025-04-01T17:48:26.624305
|
{
"license": [
"Apache 2 License - https://www.apache.org/licenses/LICENSE-2.0",
"BSD 2-Clause",
"BSD 3-Clause",
"MIT License",
"MIT License"
],
"license_url": "https://opensource.org/licenses/MIT",
"language": [
"English",
"LLVM"
],
"url": "https://github.com/bigcode-project/octopack",
"dataset_id": "commitpackft-llvm",
"response": ""
}
|
commitpackft-llvm-171
|
; RUN: llvm-upgrade < %s | llvm-as | opt -loop-unroll -disable-output
void @sal__math_float_manipulator_7__math__joint_array_dcv_ops__Omultiply__3([6 x float]* %agg.result) {
entry:
%tmp282911 = zext i8 0 to i32 ; <i32> [#uses=1]
br label %cond_next
cond_next: ; preds = %cond_next, %entry
%indvar = phi i8 [ 0, %entry ], [ %indvar.next, %cond_next ] ; <i8> [#uses=1]
%indvar.next = add i8 %indvar, 1 ; <i8> [#uses=2]
%exitcond = icmp eq i8 %indvar.next, 7 ; <i1> [#uses=1]
br i1 %exitcond, label %bb27, label %cond_next
bb27: ; preds = %cond_next
%tmp282911.lcssa = phi i32 [ %tmp282911, %cond_next ] ; <i32> [#uses=0]
ret void
}
Add PR number for reference.
; PR 1334
; RUN: llvm-upgrade < %s | llvm-as | opt -loop-unroll -disable-output
void @sal__math_float_manipulator_7__math__joint_array_dcv_ops__Omultiply__3([6 x float]* %agg.result) {
entry:
%tmp282911 = zext i8 0 to i32 ; <i32> [#uses=1]
br label %cond_next
cond_next: ; preds = %cond_next, %entry
%indvar = phi i8 [ 0, %entry ], [ %indvar.next, %cond_next ] ; <i8> [#uses=1]
%indvar.next = add i8 %indvar, 1 ; <i8> [#uses=2]
%exitcond = icmp eq i8 %indvar.next, 7 ; <i1> [#uses=1]
br i1 %exitcond, label %bb27, label %cond_next
bb27: ; preds = %cond_next
%tmp282911.lcssa = phi i32 [ %tmp282911, %cond_next ] ; <i32> [#uses=0]
ret void
}
|
Data Provenance Initiative
|
2025-04-01T17:48:26.624309
|
{
"license": [
"Apache 2 License - https://www.apache.org/licenses/LICENSE-2.0",
"BSD 2-Clause",
"BSD 3-Clause",
"MIT License",
"MIT License"
],
"license_url": "https://opensource.org/licenses/MIT",
"language": [
"English",
"LLVM"
],
"url": "https://github.com/bigcode-project/octopack",
"dataset_id": "commitpackft-llvm",
"response": ""
}
|
commitpackft-llvm-172
|
; RUN: llc < %s -march=x86 -relocation-model=pic -disable-fp-elim -unwind-tables | FileCheck %s
; <rdar://problem/7383328>
@.str = private constant [12 x i8] c"hello world\00", align 1 ; <[12 x i8]*> [#uses=1]
define hidden void @func() nounwind ssp {
entry:
%0 = call i32 @puts(i8* getelementptr inbounds ([12 x i8]* @.str, i64 0, i64 0)) nounwind ; <i32> [#uses=0]
br label %return
return: ; preds = %entry
ret void
}
declare i32 @puts(i8*)
define hidden i32 @main() nounwind ssp {
entry:
%retval = alloca i32 ; <i32*> [#uses=1]
%"alloca point" = bitcast i32 0 to i32 ; <i32> [#uses=0]
call void @func() nounwind
br label %return
return: ; preds = %entry
%retval1 = load i32* %retval ; <i32> [#uses=1]
ret i32 %retval1
}
; CHECK: .private_extern _func.eh
; CHECK: .private_extern _main.eh
Fix test to work on every platform.
; RUN: llc < %s -mtriple=i386-apple-darwin9 -relocation-model=pic -disable-fp-elim -unwind-tables | FileCheck %s
; <rdar://problem/7383328>
@.str = private constant [12 x i8] c"hello world\00", align 1 ; <[12 x i8]*> [#uses=1]
define hidden void @func() nounwind ssp {
entry:
%0 = call i32 @puts(i8* getelementptr inbounds ([12 x i8]* @.str, i64 0, i64 0)) nounwind ; <i32> [#uses=0]
br label %return
return: ; preds = %entry
ret void
}
declare i32 @puts(i8*)
define hidden i32 @main() nounwind ssp {
entry:
%retval = alloca i32 ; <i32*> [#uses=1]
%"alloca point" = bitcast i32 0 to i32 ; <i32> [#uses=0]
call void @func() nounwind
br label %return
return: ; preds = %entry
%retval1 = load i32* %retval ; <i32> [#uses=1]
ret i32 %retval1
}
; CHECK: .private_extern _func.eh
; CHECK: .private_extern _main.eh
|
Data Provenance Initiative
|
2025-04-01T17:48:26.624313
|
{
"license": [
"Apache 2 License - https://www.apache.org/licenses/LICENSE-2.0",
"BSD 2-Clause",
"BSD 3-Clause",
"MIT License",
"MIT License"
],
"license_url": "https://opensource.org/licenses/MIT",
"language": [
"English",
"LLVM"
],
"url": "https://github.com/bigcode-project/octopack",
"dataset_id": "commitpackft-llvm",
"response": ""
}
|
commitpackft-llvm-173
|
; RUN: llvm-as %s -o - | llvm-dis > %t1.ll
; RUN: llvm-as %t1.ll -o - | llvm-dis > %t2.ll
; RUN: diff %t1.ll %t2.ll
uint %test_extractelement(<4 x uint> %V) {
%R = extractelement <4 x uint> %V, uint 1
ret uint %R
}
Test case for the insertelement operation.
; RUN: llvm-as %s -o - | llvm-dis > %t1.ll
; RUN: llvm-as %t1.ll -o - | llvm-dis > %t2.ll
; RUN: diff %t1.ll %t2.ll
uint %test_extractelement(<4 x uint> %V) {
%R = extractelement <4 x uint> %V, uint 1
ret uint %R
}
<4 x uint> %test_insertelement(<4 x uint> %V) {
%R = insertelement <4 x uint> %V, uint 0, uint 0
ret <4 x uint> %R
}
|
Data Provenance Initiative
|
2025-04-01T17:48:26.624318
|
{
"license": [
"Apache 2 License - https://www.apache.org/licenses/LICENSE-2.0",
"BSD 2-Clause",
"BSD 3-Clause",
"MIT License",
"MIT License"
],
"license_url": "https://opensource.org/licenses/MIT",
"language": [
"English",
"LLVM"
],
"url": "https://github.com/bigcode-project/octopack",
"dataset_id": "commitpackft-llvm",
"response": ""
}
|
commitpackft-llvm-174
|
; RUN: opt < %s -functionattrs -S | FileCheck %s
declare i8* @fopen(i8*, i8*)
; CHECK: declare noalias i8* @fopen(i8* nocapture, i8* nocapture) [[G0:#[0-9]]]
declare i8 @strlen(i8*)
; CHECK: declare i8 @strlen(i8* nocapture) [[G1:#[0-9]]]
declare i32* @realloc(i32*, i32)
; CHECK: declare noalias i32* @realloc(i32* nocapture, i32) [[G0]]
; Test deliberately wrong declaration
declare i32 @strcpy(...)
; CHECK: declare i32 @strcpy(...)
declare i32 @gettimeofday(i8*, i8*)
; CHECK: declare i32 @gettimeofday(i8* nocapture, i8* nocapture) [[G0]]
; CHECK: attributes [[G0]] = { nounwind }
; CHECK: attributes [[G1]] = { nounwind readonly }
Change the gettimeofday test to only test on a posix platform.
; RUN: opt < %s -functionattrs -S | FileCheck %s
; RUN: opt < %s -mtriple=x86_64-apple-macosx10.8.0 -functionattrs -S | FileCheck -check-prefix=POSIX %s
declare i8* @fopen(i8*, i8*)
; CHECK: declare noalias i8* @fopen(i8* nocapture, i8* nocapture) [[G0:#[0-9]]]
declare i8 @strlen(i8*)
; CHECK: declare i8 @strlen(i8* nocapture) [[G1:#[0-9]]]
declare i32* @realloc(i32*, i32)
; CHECK: declare noalias i32* @realloc(i32* nocapture, i32) [[G0]]
; Test deliberately wrong declaration
declare i32 @strcpy(...)
; CHECK: declare i32 @strcpy(...)
declare i32 @gettimeofday(i8*, i8*)
; CHECK-POSIX: declare i32 @gettimeofday(i8* nocapture, i8* nocapture) [[G0:#[0-9]+]]
; CHECK: attributes [[G0]] = { nounwind }
; CHECK: attributes [[G1]] = { nounwind readonly }
; CHECK-POSIX: attributes [[G0]] = { nounwind }
|
Data Provenance Initiative
|
2025-04-01T17:48:26.624322
|
{
"license": [
"Apache 2 License - https://www.apache.org/licenses/LICENSE-2.0",
"BSD 2-Clause",
"BSD 3-Clause",
"MIT License",
"MIT License"
],
"license_url": "https://opensource.org/licenses/MIT",
"language": [
"English",
"LLVM"
],
"url": "https://github.com/bigcode-project/octopack",
"dataset_id": "commitpackft-llvm",
"response": ""
}
|
commitpackft-llvm-175
|
; RUN: llvm-profdata merge %S/Inputs/diag.proftext -o %T/diag.profdata
; RUN: opt < %s -pgo-instr-use -pgo-test-profile-file=%T/diag.profdata -S 2>&1 | FileCheck %s
; CHECK: No profile data available for function bar
target datalayout = "e-m:e-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-unknown-linux-gnu"
define i32 @bar() {
entry:
ret i32 0
}
Rename the profdata filename to avoid the conflict b/w tests.
; RUN: llvm-profdata merge %S/Inputs/diag.proftext -o %T/diag2.profdata
; RUN: opt < %s -pgo-instr-use -pgo-test-profile-file=%T/diag2.profdata -S 2>&1 | FileCheck %s
; CHECK: No profile data available for function bar
target datalayout = "e-m:e-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-unknown-linux-gnu"
define i32 @bar() {
entry:
ret i32 0
}
|
Data Provenance Initiative
|
2025-04-01T17:48:26.624326
|
{
"license": [
"Apache 2 License - https://www.apache.org/licenses/LICENSE-2.0",
"BSD 2-Clause",
"BSD 3-Clause",
"MIT License",
"MIT License"
],
"license_url": "https://opensource.org/licenses/MIT",
"language": [
"English",
"LLVM"
],
"url": "https://github.com/bigcode-project/octopack",
"dataset_id": "commitpackft-llvm",
"response": ""
}
|
commitpackft-llvm-176
|
; RUN: llc < %s | FileCheck %s
target triple = "x86_64-linux-gnu"
define coldcc void @foo() {
; CHECK: pushq %rbp
; CHECK: pushq %r15
; CHECK: pushq %r14
; CHECK: pushq %r13
; CHECK: pushq %r12
; CHECK: pushq %r11
; CHECK: pushq %r10
; CHECK: pushq %r9
; CHECK: pushq %r8
; CHECK: pushq %rdi
; CHECK: pushq %rsi
; CHECK: pushq %rdx
; CHECK: pushq %rcx
; CHECK: pushq %rbx
; CHECK: vmovaps %xmm15
; CHECK: vmovaps %xmm0
call void asm sideeffect "", "~{xmm15},~{xmm0},~{rbp},~{r15},~{r14},~{r13},~{r12},~{r11},~{r10},~{r9},~{r8},~{rdi},~{rsi},~{rdx},~{rcx},~{rbx}"()
ret void
}
Fix test by matching movaps instead of AVX-only vmovaps
; RUN: llc < %s | FileCheck %s
target triple = "x86_64-linux-gnu"
define coldcc void @foo() {
; CHECK: pushq %rbp
; CHECK: pushq %r15
; CHECK: pushq %r14
; CHECK: pushq %r13
; CHECK: pushq %r12
; CHECK: pushq %r11
; CHECK: pushq %r10
; CHECK: pushq %r9
; CHECK: pushq %r8
; CHECK: pushq %rdi
; CHECK: pushq %rsi
; CHECK: pushq %rdx
; CHECK: pushq %rcx
; CHECK: pushq %rbx
; CHECK: movaps %xmm15
; CHECK: movaps %xmm0
call void asm sideeffect "", "~{xmm15},~{xmm0},~{rbp},~{r15},~{r14},~{r13},~{r12},~{r11},~{r10},~{r9},~{r8},~{rdi},~{rsi},~{rdx},~{rcx},~{rbx}"()
ret void
}
|
Data Provenance Initiative
|
2025-04-01T17:48:26.624329
|
{
"license": [
"Apache 2 License - https://www.apache.org/licenses/LICENSE-2.0",
"BSD 2-Clause",
"BSD 3-Clause",
"MIT License",
"MIT License"
],
"license_url": "https://opensource.org/licenses/MIT",
"language": [
"English",
"LLVM"
],
"url": "https://github.com/bigcode-project/octopack",
"dataset_id": "commitpackft-llvm",
"response": ""
}
|
commitpackft-llvm-177
|
; RUN: llc < %s -mtriple=i686-apple-darwin -mattr=+sse2 | grep mov | grep ecx | grep 0
; RUN: llc < %s -mtriple=i686-apple-darwin -mattr=+sse2 | grep mov | grep xmm0 | grep 8
@d = external global double ; <double*> [#uses=1]
@c = external global double ; <double*> [#uses=1]
@b = external global double ; <double*> [#uses=1]
@a = external global double ; <double*> [#uses=1]
define i32 @foo() nounwind {
entry:
%0 = load double* @d, align 8 ; <double> [#uses=1]
%1 = load double* @c, align 8 ; <double> [#uses=1]
%2 = load double* @b, align 8 ; <double> [#uses=1]
%3 = load double* @a, align 8 ; <double> [#uses=1]
tail call fastcc void @bar( i32 0, i32 1, i32 2, double 1.000000e+00, double %3, double %2, double %1, double %0 ) nounwind
ret i32 0
}
declare fastcc void @bar(i32, i32, i32, double, double, double, double, double)
Fix this test to account for a movl $0 being emitted as an xor now, and convert it to FileCheck.
; RUN: llc < %s -mtriple=i686-apple-darwin -mattr=+sse2 | FileCheck %s
; CHECK: movsd %xmm0, 8(%esp)
; CHECK: xorl %ecx, %ecx
@d = external global double ; <double*> [#uses=1]
@c = external global double ; <double*> [#uses=1]
@b = external global double ; <double*> [#uses=1]
@a = external global double ; <double*> [#uses=1]
define i32 @foo() nounwind {
entry:
%0 = load double* @d, align 8 ; <double> [#uses=1]
%1 = load double* @c, align 8 ; <double> [#uses=1]
%2 = load double* @b, align 8 ; <double> [#uses=1]
%3 = load double* @a, align 8 ; <double> [#uses=1]
tail call fastcc void @bar( i32 0, i32 1, i32 2, double 1.000000e+00, double %3, double %2, double %1, double %0 ) nounwind
ret i32 0
}
declare fastcc void @bar(i32, i32, i32, double, double, double, double, double)
|
Data Provenance Initiative
|
2025-04-01T17:48:26.624334
|
{
"license": [
"Apache 2 License - https://www.apache.org/licenses/LICENSE-2.0",
"BSD 2-Clause",
"BSD 3-Clause",
"MIT License",
"MIT License"
],
"license_url": "https://opensource.org/licenses/MIT",
"language": [
"English",
"LLVM"
],
"url": "https://github.com/bigcode-project/octopack",
"dataset_id": "commitpackft-llvm",
"response": ""
}
|
commitpackft-llvm-178
|
; RUN: llvm-as < %s | llc -march=x86 | grep {orl \$1}
define i32 @test(i32 %A) nounwind {
%B = or i32 %A, 1
%C = or i32 %B, 1
%D = and i32 %C, 7057
ret i32 %D
}
Add a PR comment to this test.
; RUN: llvm-as < %s | llc -march=x86 | grep {orl \$1}
; PR3018
define i32 @test(i32 %A) nounwind {
%B = or i32 %A, 1
%C = or i32 %B, 1
%D = and i32 %C, 7057
ret i32 %D
}
|
Data Provenance Initiative
|
2025-04-01T17:48:26.624337
|
{
"license": [
"Apache 2 License - https://www.apache.org/licenses/LICENSE-2.0",
"BSD 2-Clause",
"BSD 3-Clause",
"MIT License",
"MIT License"
],
"license_url": "https://opensource.org/licenses/MIT",
"language": [
"English",
"LLVM"
],
"url": "https://github.com/bigcode-project/octopack",
"dataset_id": "commitpackft-llvm",
"response": ""
}
|
commitpackft-llvm-179
|
; RUN: llc < %s -mtriple=i386-apple-darwin9 | grep no_dead_strip | count 1
; We should have a .no_dead_strip directive for Z but not for X/Y.
@X = internal global i8 4
@Y = internal global i32 123
@Z = internal global i8 4
@llvm.used = appending global [1 x i8*] [ i8* @Z ], section "llvm.metadata"
@llvm.compiler_used = appending global [2 x i8*] [ i8* @X, i8* bitcast (i32* @Y to i8*)], section "llvm.metadata"
Move test from grep to FileCheck.
; RUN: llc < %s -mtriple=i386-apple-darwin9 | FileCheck %s
@X = internal global i8 4
@Y = internal global i32 123
@Z = internal global i8 4
@llvm.used = appending global [1 x i8*] [ i8* @Z ], section "llvm.metadata"
@llvm.compiler_used = appending global [2 x i8*] [ i8* @X, i8* bitcast (i32* @Y to i8*)], section "llvm.metadata"
; CHECK-NOT: .no_dead_strip
; CHECK: .no_dead_strip _Z
; CHECK-NOT: .no_dead_strip
|
Data Provenance Initiative
|
2025-04-01T17:48:26.624341
|
{
"license": [
"Apache 2 License - https://www.apache.org/licenses/LICENSE-2.0",
"BSD 2-Clause",
"BSD 3-Clause",
"MIT License",
"MIT License"
],
"license_url": "https://opensource.org/licenses/MIT",
"language": [
"English",
"LLVM"
],
"url": "https://github.com/bigcode-project/octopack",
"dataset_id": "commitpackft-llvm",
"response": ""
}
|
commitpackft-llvm-180
|
; Test that the StrCatOptimizer works correctly
; RUN: llvm-as < %s | opt -simplify-libcalls | llvm-dis | not grep 'pow'
declare double %pow(double,double)
%fpstorage = global double 5.0
implementation ; Functions:
int %main () {
%fpnum = load double* %fpstorage;
%one = call double %pow(double 1.0, double %fpnum)
%two = call double %pow(double %one, double 0.5)
%three = call double %pow(double %two, double 1.0)
%four = call double %pow(double %three, double -1.0)
%five = call double %pow(double %four, double 0.0)
%result = cast double %five to int
ret int %result
}
Fix the success criteria for the test to make call instructions with "pow" not just any occurrence of "pow".
; Test that the StrCatOptimizer works correctly
; RUN: llvm-as < %s | opt -simplify-libcalls | llvm-dis | not grep 'call.*pow'
declare double %pow(double,double)
%fpstorage = global double 5.0
implementation ; Functions:
int %main () {
%fpnum = load double* %fpstorage;
%one = call double %pow(double 1.0, double %fpnum)
%two = call double %pow(double %one, double 0.5)
%three = call double %pow(double %two, double 1.0)
%four = call double %pow(double %three, double -1.0)
%five = call double %pow(double %four, double 0.0)
%result = cast double %five to int
ret int %result
}
|
Data Provenance Initiative
|
2025-04-01T17:48:26.624344
|
{
"license": [
"Apache 2 License - https://www.apache.org/licenses/LICENSE-2.0",
"BSD 2-Clause",
"BSD 3-Clause",
"MIT License",
"MIT License"
],
"license_url": "https://opensource.org/licenses/MIT",
"language": [
"English",
"LLVM"
],
"url": "https://github.com/bigcode-project/octopack",
"dataset_id": "commitpackft-llvm",
"response": ""
}
|
commitpackft-llvm-181
|
; RUN: llc < %s -march=thumb | grep bne | count 1
; RUN: llc < %s -march=thumb | grep beq | count 1
define i32 @f1(float %X, float %Y) {
%tmp = fcmp uno float %X, %Y
%retval = select i1 %tmp, i32 1, i32 -1
ret i32 %retval
}
define i32 @f2(float %X, float %Y) {
%tmp = fcmp ord float %X, %Y
%retval = select i1 %tmp, i32 1, i32 -1
ret i32 %retval
}
Use FileCheck and expand the test a bit.
; RUN: llc < %s -mtriple=thumb-apple-darwin | FileCheck %s
define i32 @f1(float %X, float %Y) {
; CHECK-LABEL _f1:
; CHECK: bne
; CHECK: .data_region
; CHECK: .long ___unordsf2
%tmp = fcmp uno float %X, %Y
%retval = select i1 %tmp, i32 1, i32 -1
ret i32 %retval
}
define i32 @f2(float %X, float %Y) {
; CHECK-LABEL _f2:
; CHECK: beq
; CHECK: .data_region
; CHECK: .long ___unordsf2
%tmp = fcmp ord float %X, %Y
%retval = select i1 %tmp, i32 1, i32 -1
ret i32 %retval
}
|
Data Provenance Initiative
|
2025-04-01T17:48:26.624348
|
{
"license": [
"Apache 2 License - https://www.apache.org/licenses/LICENSE-2.0",
"BSD 2-Clause",
"BSD 3-Clause",
"MIT License",
"MIT License"
],
"license_url": "https://opensource.org/licenses/MIT",
"language": [
"English",
"LLVM"
],
"url": "https://github.com/bigcode-project/octopack",
"dataset_id": "commitpackft-llvm",
"response": ""
}
|
commitpackft-llvm-182
|
; RUN: llc < %s -march=x86-64 | FileCheck %s
define zeroext i1 @f1(i8* %x) {
entry:
%0 = load i8* %x, align 1, !range !0
%tobool = trunc i8 %0 to i1
ret i1 %tobool
}
; CHECK: f1:
; CHECK: movb (%rdi), %al
; CHECK-NEXT: ret
!0 = metadata !{i8 0, i8 2}
Add a triple to the test.
; RUN: llc < %s -mtriple=x86_64-apple-darwin | FileCheck %s
define zeroext i1 @f1(i8* %x) {
entry:
%0 = load i8* %x, align 1, !range !0
%tobool = trunc i8 %0 to i1
ret i1 %tobool
}
; CHECK: f1:
; CHECK: movb (%rdi), %al
; CHECK-NEXT: ret
!0 = metadata !{i8 0, i8 2}
|
Data Provenance Initiative
|
2025-04-01T17:48:26.624352
|
{
"license": [
"Apache 2 License - https://www.apache.org/licenses/LICENSE-2.0",
"BSD 2-Clause",
"BSD 3-Clause",
"MIT License",
"MIT License"
],
"license_url": "https://opensource.org/licenses/MIT",
"language": [
"English",
"LLVM"
],
"url": "https://github.com/bigcode-project/octopack",
"dataset_id": "commitpackft-llvm",
"response": ""
}
|
commitpackft-llvm-183
|
; RUN: opt < %s -basicaa -newgvn -instcombine -S | FileCheck %s
; PR4189
@G = external constant [4 x i32]
define i32 @test(i8* %p, i32 %i) nounwind {
entry:
%P = getelementptr [4 x i32], [4 x i32]* @G, i32 0, i32 %i
%A = load i32, i32* %P
store i8 4, i8* %p
%B = load i32, i32* %P
%C = sub i32 %A, %B
ret i32 %C
}
; CHECK: define i32 @test(i8* %p, i32 %i) #0 {
; CHECK-NEXT: entry:
; CHECK-NEXT: store i8 4, i8* %p, align 1
; CHECK-NEXT: ret i32 0
; CHECK-NEXT: }
Fix test so that it doesn't rely on InstCombine anymore.
; RUN: opt < %s -basicaa -newgvn -S | FileCheck %s
; PR4189
@G = external constant [4 x i32]
define i32 @test(i8* %p, i32 %i) nounwind {
entry:
%P = getelementptr [4 x i32], [4 x i32]* @G, i32 0, i32 %i
%A = load i32, i32* %P
store i8 4, i8* %p
%B = load i32, i32* %P
%C = sub i32 %A, %B
ret i32 %C
}
; CHECK-LABEL: define i32 @test
; CHECK-NEXT: entry:
; CHECK-NEXT: %P = getelementptr [4 x i32], [4 x i32]* @G, i32 0, i32 %i
; CHECK-NEXT: %A = load i32, i32* %P
; CHECK-NEXT: store i8 4, i8* %p
; CHECK-NEXT: ret i32 0
; CHECK-NEXT: }
|
Data Provenance Initiative
|
2025-04-01T17:48:26.624355
|
{
"license": [
"Apache 2 License - https://www.apache.org/licenses/LICENSE-2.0",
"BSD 2-Clause",
"BSD 3-Clause",
"MIT License",
"MIT License"
],
"license_url": "https://opensource.org/licenses/MIT",
"language": [
"English",
"LLVM"
],
"url": "https://github.com/bigcode-project/octopack",
"dataset_id": "commitpackft-llvm",
"response": ""
}
|
commitpackft-llvm-184
|
; RUN: llc < %s -march=x86-64 | FileCheck %s
; Verify that we are using the efficient uitofp --> sitofp lowering illustrated
; by the compiler_rt implementation of __floatundisf.
; <rdar://problem/8493982>
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"
target triple = "x86_64-apple-darwin10.0.0"
; CHECK: testq %rdi, %rdi
; CHECK-NEXT: jns LBB0_2
; CHECK: shrq
; CHECK-NEXT: andq
; CHECK-NEXT: orq
; CHECK-NEXT: cvtsi2ss
; CHECK: LBB0_2
; CHECK-NEXT: cvtsi2ss
define float @test(i64 %a) {
entry:
%b = uitofp i64 %a to float
ret float %b
}
Use –mcpu=generic, so that the test will not fail when run on an Intel Atom processor, due to the Atom scheduler producing an instruction sequence that is different from that which is expected. Patch by Michael Spencer!
; RUN: llc < %s -mcpu=generic -march=x86-64 | FileCheck %s
; Verify that we are using the efficient uitofp --> sitofp lowering illustrated
; by the compiler_rt implementation of __floatundisf.
; <rdar://problem/8493982>
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"
target triple = "x86_64-apple-darwin10.0.0"
; CHECK: testq %rdi, %rdi
; CHECK-NEXT: jns LBB0_2
; CHECK: shrq
; CHECK-NEXT: andq
; CHECK-NEXT: orq
; CHECK-NEXT: cvtsi2ss
; CHECK: LBB0_2
; CHECK-NEXT: cvtsi2ss
define float @test(i64 %a) {
entry:
%b = uitofp i64 %a to float
ret float %b
}
|
Data Provenance Initiative
|
2025-04-01T17:48:26.624362
|
{
"license": [
"Apache 2 License - https://www.apache.org/licenses/LICENSE-2.0",
"BSD 2-Clause",
"BSD 3-Clause",
"MIT License",
"MIT License"
],
"license_url": "https://opensource.org/licenses/MIT",
"language": [
"English",
"LLVM"
],
"url": "https://github.com/bigcode-project/octopack",
"dataset_id": "commitpackft-llvm",
"response": ""
}
|
commitpackft-llvm-185
|
; Test to make sure that the 'private' is used correctly.
;
; RUN: llvm-as < %s | llc -mtriple=powerpc-unknown-linux-gnu | FileCheck %s -check-prefix=LINUX
; RUN: llvm-as < %s | llc -mtriple=powerpc-apple-darwin | FileCheck %s -check-prefix=DARWIN
define private void @foo() nounwind {
ret void
; LINUX: .Lfoo:
; DARWIN: L_foo:
}
define i32 @bar() nounwind {
call void @foo()
%1 = load i32* @baz, align 4
ret i32 %1
; LINUX: bar:
; LINUX: bl .Lfoo
; LINUX: lis 3, .Lbaz@ha
; LINUX: lwz 3, .Lbaz@l(3)
; DARWIN: _bar:
; DARWIN: bl L_foo
; DARWIN: lis r2, ha16(L_baz)
; DARWIN: lwz r3, lo16(L_baz)(r2)
}
; LINUX: .Lbaz:
; DARWIN: L_baz:
@baz = private global i32 4
Add -march=ppc32 lines so that this test doesn't ever default to ppc64.
; Test to make sure that the 'private' is used correctly.
;
; RUN: llvm-as < %s | llc -mtriple=powerpc-unknown-linux-gnu -march=ppc32 | FileCheck %s -check-prefix=LINUX
; RUN: llvm-as < %s | llc -mtriple=powerpc-apple-darwin -march=ppc32 | FileCheck %s -check-prefix=DARWIN
define private void @foo() nounwind {
ret void
; LINUX: .Lfoo:
; DARWIN: L_foo:
}
define i32 @bar() nounwind {
call void @foo()
%1 = load i32* @baz, align 4
ret i32 %1
; LINUX: bar:
; LINUX: bl .Lfoo
; LINUX: lis 3, .Lbaz@ha
; LINUX: lwz 3, .Lbaz@l(3)
; DARWIN: _bar:
; DARWIN: bl L_foo
; DARWIN: lis r2, ha16(L_baz)
; DARWIN: lwz r3, lo16(L_baz)(r2)
}
; LINUX: .Lbaz:
; DARWIN: L_baz:
@baz = private global i32 4
|
Data Provenance Initiative
|
2025-04-01T17:48:26.624366
|
{
"license": [
"Apache 2 License - https://www.apache.org/licenses/LICENSE-2.0",
"BSD 2-Clause",
"BSD 3-Clause",
"MIT License",
"MIT License"
],
"license_url": "https://opensource.org/licenses/MIT",
"language": [
"English",
"LLVM"
],
"url": "https://github.com/bigcode-project/octopack",
"dataset_id": "commitpackft-llvm",
"response": ""
}
|
commitpackft-llvm-186
|
; RUN: llc -mtriple x86_64-linux -mcpu core %s -o - | FileCheck %s
define i32 @f(i1 %foo, i16* %tm_year2, i8* %bar, i16 %zed, i32 %zed2) {
entry:
br i1 %foo, label %return, label %if.end
if.end:
%rem = srem i32 %zed2, 100
%conv3 = trunc i32 %rem to i16
store i16 %conv3, i16* %tm_year2
%sext = shl i32 %rem, 16
%conv5 = ashr exact i32 %sext, 16
%div = sdiv i32 %conv5, 10
%conv6 = trunc i32 %div to i8
store i8 %conv6, i8* %bar
br label %return
return:
%retval.0 = phi i32 [ 0, %if.end ], [ -1, %entry ]
ret i32 %retval.0
}
; We were miscompiling this and using %ax instead of %cx in the movw.
; CHECK: movswl %cx, %ecx
; CHECK: movw %cx, (%rsi)
; CHECK: movslq %ecx, %rcx
Fix the cpu name and add -verify-machineinstrs.
; RUN: llc -mtriple x86_64-linux -mcpu core2 -verify-machineinstrs %s -o - | FileCheck %s
define i32 @f(i1 %foo, i16* %tm_year2, i8* %bar, i16 %zed, i32 %zed2) {
entry:
br i1 %foo, label %return, label %if.end
if.end:
%rem = srem i32 %zed2, 100
%conv3 = trunc i32 %rem to i16
store i16 %conv3, i16* %tm_year2
%sext = shl i32 %rem, 16
%conv5 = ashr exact i32 %sext, 16
%div = sdiv i32 %conv5, 10
%conv6 = trunc i32 %div to i8
store i8 %conv6, i8* %bar
br label %return
return:
%retval.0 = phi i32 [ 0, %if.end ], [ -1, %entry ]
ret i32 %retval.0
}
; We were miscompiling this and using %ax instead of %cx in the movw.
; CHECK: movswl %cx, %ecx
; CHECK: movw %cx, (%rsi)
; CHECK: movslq %ecx, %rcx
|
Data Provenance Initiative
|
2025-04-01T17:48:26.624369
|
{
"license": [
"Apache 2 License - https://www.apache.org/licenses/LICENSE-2.0",
"BSD 2-Clause",
"BSD 3-Clause",
"MIT License",
"MIT License"
],
"license_url": "https://opensource.org/licenses/MIT",
"language": [
"English",
"LLVM"
],
"url": "https://github.com/bigcode-project/octopack",
"dataset_id": "commitpackft-llvm",
"response": ""
}
|
commitpackft-llvm-187
|
; RUN: if as < %s | opt -raise | dis | grep '= cast' | grep \*
; RUN: then exit 1
; RUN: else exit 0
; RUN: fi
%FILE = type { int, ubyte*, ubyte*, ubyte, ubyte, uint, uint, uint }
uint %addfile(%FILE* %f) {
%cast255 = cast %FILE* %f to sbyte* ; <sbyte*> [#uses=1]
%reg2421 = getelementptr sbyte* %cast255, long 24 ; <sbyte*> [#uses=1]
%reg130 = load sbyte* %reg2421 ; <sbyte> [#uses=1]
%cast250 = cast sbyte %reg130 to uint ; <uint> [#uses=1]
ret uint %cast250
}
Add information about why this testcase fails
; RUN: if as < %s | opt -raise | dis | grep '= cast' | grep \*
; RUN: then exit 1
; RUN: else exit 0
; RUN: fi
%FILE = type { int, ubyte*, ubyte*, ubyte, ubyte, uint, uint, uint }
uint %addfile(%FILE* %f) {
%cast255 = cast %FILE* %f to sbyte*
; Addreses a ubyte member in memory...
%reg2421 = getelementptr sbyte* %cast255, long 24
; Loads the ubyte
%reg130 = load sbyte* %reg2421
; Error, cast cannot convert the source operand to ubyte because then
; the sign extension would not be performed. Need to insert a cast.
;
%cast250 = cast sbyte %reg130 to uint ; This is a sign extension instruction
ret uint %cast250
}
|
Data Provenance Initiative
|
2025-04-01T17:48:26.624373
|
{
"license": [
"Apache 2 License - https://www.apache.org/licenses/LICENSE-2.0",
"BSD 2-Clause",
"BSD 3-Clause",
"MIT License",
"MIT License"
],
"license_url": "https://opensource.org/licenses/MIT",
"language": [
"English",
"LLVM"
],
"url": "https://github.com/bigcode-project/octopack",
"dataset_id": "commitpackft-llvm",
"response": ""
}
|
commitpackft-llvm-188
|
define void @foo() {
ret void
}
Add layout/triple to fix test on platforms where names are mangled.
target datalayout = "e-m:w-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-windows-msvc"
define void @foo() {
ret void
}
|
Data Provenance Initiative
|
2025-04-01T17:48:26.624377
|
{
"license": [
"Apache 2 License - https://www.apache.org/licenses/LICENSE-2.0",
"BSD 2-Clause",
"BSD 3-Clause",
"MIT License",
"MIT License"
],
"license_url": "https://opensource.org/licenses/MIT",
"language": [
"English",
"LLVM"
],
"url": "https://github.com/bigcode-project/octopack",
"dataset_id": "commitpackft-llvm",
"response": ""
}
|
commitpackft-llvm-189
|
; REQUIRES: x86
; RUN: llvm-as %s -o %t.o
; RUN: ld.lld %t.o -o %t.so -shared
; RUN: llvm-readelf -s %t.so | FileCheck %s
target datalayout = "e-m:e-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-unknown-linux-gnu"
@foo = hidden global i32 42, section "foo_section"
@bar = hidden global i32 42, section "bar_section"
@zed = hidden global i32 42, section "zed_section"
@__start_foo_section = external global i32
@__stop_bar_section = external global i32
define i32* @use1() {
ret i32* @__start_foo_section
}
define i32* @use2() {
ret i32* @__stop_bar_section
}
; CHECK-NOT: zed_section
; CHECK: foo_section PROGBITS
; CHECK-NEXT: bar_section PROGBITS
; CHECK-NOT: zed_section
Add --gc-sections to a test.
; REQUIRES: x86
; RUN: llvm-as %s -o %t.o
; RUN: ld.lld %t.o -o %t.so -shared
; RUN: llvm-readelf -s %t.so | FileCheck %s
; RUN: ld.lld %t.o -o %t.so -shared --gc-sections
; RUN: llvm-readelf -s %t.so | FileCheck --check-prefix=GC %s
target datalayout = "e-m:e-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-unknown-linux-gnu"
@foo = hidden global i32 42, section "foo_section"
@bar = hidden global i32 42, section "bar_section"
@zed = hidden global i32 42, section "zed_section"
@__start_foo_section = external global i32
@__stop_bar_section = external global i32
define hidden i32* @use1() {
ret i32* @__start_foo_section
}
define i32* @use2() {
ret i32* @__stop_bar_section
}
; CHECK-NOT: zed_section
; CHECK: foo_section PROGBITS
; CHECK-NEXT: bar_section PROGBITS
; CHECK-NOT: zed_section
; GC-NOT: zed_section
; GC-NOT: foo_section
; GC: bar_section PROGBITS
; GC-NOT: zed_section
; GC-NOT: foo_section
|
Data Provenance Initiative
|
2025-04-01T17:48:26.624381
|
{
"license": [
"Apache 2 License - https://www.apache.org/licenses/LICENSE-2.0",
"BSD 2-Clause",
"BSD 3-Clause",
"MIT License",
"MIT License"
],
"license_url": "https://opensource.org/licenses/MIT",
"language": [
"English",
"LLVM"
],
"url": "https://github.com/bigcode-project/octopack",
"dataset_id": "commitpackft-llvm",
"response": ""
}
|
commitpackft-llvm-190
|
; Tests to make sure elimination of casts is working correctly
; RUN: if as < %s | opt -instcombine -dce | grep '%c'
; RUN: then exit 1
; RUN: else exit 0
; RUN: fi
implementation
int "test1"(int %A)
begin
%c1 = cast int %A to uint
%c2 = cast uint %c1 to int
ret int %c2
end
ulong "test2"(ubyte %A)
begin
%c1 = cast ubyte %A to ushort
%c2 = cast ushort %c1 to uint
%Ret = cast uint %c2 to ulong
ret ulong %Ret
end
Add another testcase that isn't failing because of another bug in instcombine
; Tests to make sure elimination of casts is working correctly
; RUN: if as < %s | opt -instcombine -dce | grep '%c' | grep cast
; RUN: then exit 1
; RUN: else exit 0
; RUN: fi
implementation
int %test1(int %A) {
%c1 = cast int %A to uint
%c2 = cast uint %c1 to int
ret int %c2
}
ulong %test2(ubyte %A) {
%c1 = cast ubyte %A to ushort
%c2 = cast ushort %c1 to uint
%Ret = cast uint %c2 to ulong
ret ulong %Ret
}
ulong %test3(ulong %A) { ; This function should just use bitwise AND
%c1 = cast ulong %A to ubyte
%c2 = cast ubyte %c1 to ulong
ret ulong %c2
}
|
Data Provenance Initiative
|
2025-04-01T17:48:26.624385
|
{
"license": [
"Apache 2 License - https://www.apache.org/licenses/LICENSE-2.0",
"BSD 2-Clause",
"BSD 3-Clause",
"MIT License",
"MIT License"
],
"license_url": "https://opensource.org/licenses/MIT",
"language": [
"English",
"LLVM"
],
"url": "https://github.com/bigcode-project/octopack",
"dataset_id": "commitpackft-llvm",
"response": ""
}
|
commitpackft-llvm-191
|
%struct.str = type { i64, i8* }
declare i64 @"\01_write"(i32, i8*, i64)
define void @print(%struct.str* %str) {
%1 = getelementptr inbounds %struct.str* %str, i64 0, i32 1
%2 = load i8** %1
%3 = getelementptr inbounds %struct.str* %str, i64 0, i32 0
%4 = load i64* %3
tail call i64 @"\01_write"(i32 1, i8* %2, i64 %4)
ret void
}
Print newlines after printed content by default.
%struct.str = type { i64, i8* }
@str_NL = constant [1 x i8] c"\0a"
declare i64 @"\01_write"(i32, i8*, i64)
define void @print(%struct.str* %str) {
%1 = getelementptr inbounds %struct.str* %str, i64 0, i32 1
%2 = load i8** %1
%3 = getelementptr inbounds %struct.str* %str, i64 0, i32 0
%4 = load i64* %3
call i64 @"\01_write"(i32 1, i8* %2, i64 %4)
%6 = getelementptr inbounds [1 x i8]* @str_NL, i64 0, i64 0
call i64 @"\01_write"(i32 1, i8* %6, i64 1)
ret void
}
|
Data Provenance Initiative
|
2025-04-01T17:48:26.624389
|
{
"license": [
"Apache 2 License - https://www.apache.org/licenses/LICENSE-2.0",
"BSD 2-Clause",
"BSD 3-Clause",
"MIT License",
"MIT License"
],
"license_url": "https://opensource.org/licenses/MIT",
"language": [
"English",
"LLVM"
],
"url": "https://github.com/bigcode-project/octopack",
"dataset_id": "commitpackft-llvm",
"response": ""
}
|
commitpackft-llvm-192
|
; RUN: opt < %s -basicaa -sink -S | FileCheck %s
@A = external global i32
@B = external global i32
; Sink should sink the load past the store (which doesn't overlap) into
; the block that uses it.
; CHECK: @foo
; CHECK: true:
; CHECK-NEXT: %l = load i32* @A
; CHECK-NEXT: ret i32 %l
define i32 @foo(i1 %z) {
%l = load i32* @A
store i32 0, i32* @B
br i1 %z, label %true, label %false
true:
ret i32 %l
false:
ret i32 0
}
; But don't sink volatile loads...
; CHECK: @foo2
; CHECK: volatile load
; CHECK-NEXT: store i32
define i32 @foo2(i1 %z) {
%l = volatile load i32* @A
store i32 0, i32* @B
br i1 %z, label %true, label %false
true:
ret i32 %l
false:
ret i32 0
}
Fix test; sorry for any inconvenience.
; RUN: opt < %s -basicaa -sink -S | FileCheck %s
@A = external global i32
@B = external global i32
; Sink should sink the load past the store (which doesn't overlap) into
; the block that uses it.
; CHECK: @foo
; CHECK: true:
; CHECK-NEXT: %l = load i32* @A
; CHECK-NEXT: ret i32 %l
define i32 @foo(i1 %z) {
%l = load i32* @A
store i32 0, i32* @B
br i1 %z, label %true, label %false
true:
ret i32 %l
false:
ret i32 0
}
; But don't sink volatile loads...
; CHECK: @foo2
; CHECK: load volatile
; CHECK-NEXT: store i32
define i32 @foo2(i1 %z) {
%l = load volatile i32* @A
store i32 0, i32* @B
br i1 %z, label %true, label %false
true:
ret i32 %l
false:
ret i32 0
}
|
Data Provenance Initiative
|
2025-04-01T17:48:26.624393
|
{
"license": [
"Apache 2 License - https://www.apache.org/licenses/LICENSE-2.0",
"BSD 2-Clause",
"BSD 3-Clause",
"MIT License",
"MIT License"
],
"license_url": "https://opensource.org/licenses/MIT",
"language": [
"English",
"LLVM"
],
"url": "https://github.com/bigcode-project/octopack",
"dataset_id": "commitpackft-llvm",
"response": ""
}
|
commitpackft-llvm-193
|
; RUN: llvm-upgrade < %s | llvm-as | llc -march=arm -mattr=+v6
uint %test1(uint %tmp54) {
%tmp56 = tail call uint asm "uxtb16 $0,$1", "=r,r"( uint %tmp54 )
ret uint %tmp56
}
void %test2() {
%tmp1 = call long asm "ldmia $1!, {$0, ${0:H}}", "=r,==r,1"( int** null, int* null )
%tmp1 = cast long %tmp1 to ulong
%tmp2 = shr ulong %tmp1, ubyte 32
%tmp3 = cast ulong %tmp2 to int
%tmp4 = call int asm "pkhbt $0, $1, $2, lsl #16", "=r,r,r"( int 0, int %tmp3 )
ret void
}
Test inline asm modifier 'c'.
; RUN: llvm-as < %s | llc -march=arm -mattr=+v6
define i32 @test1(i32 %tmp54) {
%tmp56 = tail call i32 asm "uxtb16 $0,$1", "=r,r"( i32 %tmp54 ) ; <i32> [#uses=1]
ret i32 %tmp56
}
define void @test2() {
%tmp1 = call i64 asm "ldmia $1!, {$0, ${0:H}}", "=r,==r,1"( i32** null, i32* null ) ; <i64> [#uses=2]
%tmp2 = lshr i64 %tmp1, 32 ; <i64> [#uses=1]
%tmp3 = trunc i64 %tmp2 to i32 ; <i32> [#uses=1]
%tmp4 = call i32 asm "pkhbt $0, $1, $2, lsl #16", "=r,r,r"( i32 0, i32 %tmp3 ) ; <i32> [#uses=0]
ret void
}
define void @test3() {
tail call void asm sideeffect "/* number: ${0:c} */", "i"( i32 1 )
ret void
}
|
Data Provenance Initiative
|
2025-04-01T17:48:26.624397
|
{
"license": [
"Apache 2 License - https://www.apache.org/licenses/LICENSE-2.0",
"BSD 2-Clause",
"BSD 3-Clause",
"MIT License",
"MIT License"
],
"license_url": "https://opensource.org/licenses/MIT",
"language": [
"English",
"LLVM"
],
"url": "https://github.com/bigcode-project/octopack",
"dataset_id": "commitpackft-llvm",
"response": ""
}
|
commitpackft-llvm-194
|
; It's a bad idea to go recursively trapesing through types without a safety
; net.
; RUN: as < %s > Output/%s.out1.bc
; RUN: echo "%S = type { %S*, int* }" | as > Output/%s.out2.bc
; RUN: link Output/%s.out[12].bc
%S = type { %S*, opaque* }
Fix spelling error in comment.
; It's a bad idea to go recursively traipsing through types without a safety
; net.
; RUN: as < %s > Output/%s.out1.bc
; RUN: echo "%S = type { %S*, int* }" | as > Output/%s.out2.bc
; RUN: link Output/%s.out[12].bc
%S = type { %S*, opaque* }
|
Data Provenance Initiative
|
2025-04-01T17:48:26.624401
|
{
"license": [
"Apache 2 License - https://www.apache.org/licenses/LICENSE-2.0",
"BSD 2-Clause",
"BSD 3-Clause",
"MIT License",
"MIT License"
],
"license_url": "https://opensource.org/licenses/MIT",
"language": [
"English",
"LLVM"
],
"url": "https://github.com/bigcode-project/octopack",
"dataset_id": "commitpackft-llvm",
"response": ""
}
|
commitpackft-llvm-195
|
; RUN: llvm-as < %s | llc -march=x86-64 -enable-unsafe-fp-math | not grep mulps
; RUN: llvm-as < %s | llc -march=x86-64 | grep mulps
define void @test14(<4 x float>*) nounwind {
load <4 x float>* %0, align 1
mul <4 x float> %2, zeroinitializer
store <4 x float> %3, <4 x float>* %0, align 1
ret void
}
Update this test to use fmul instead of mul.
; RUN: llvm-as < %s | llc -march=x86-64 -enable-unsafe-fp-math | not grep mulps
; RUN: llvm-as < %s | llc -march=x86-64 | grep mulps
define void @test14(<4 x float>*) nounwind {
load <4 x float>* %0, align 1
fmul <4 x float> %2, zeroinitializer
store <4 x float> %3, <4 x float>* %0, align 1
ret void
}
|
Data Provenance Initiative
|
2025-04-01T17:48:26.624405
|
{
"license": [
"Apache 2 License - https://www.apache.org/licenses/LICENSE-2.0",
"BSD 2-Clause",
"BSD 3-Clause",
"MIT License",
"MIT License"
],
"license_url": "https://opensource.org/licenses/MIT",
"language": [
"English",
"LLVM"
],
"url": "https://github.com/bigcode-project/octopack",
"dataset_id": "commitpackft-llvm",
"response": ""
}
|
commitpackft-llvm-196
|
; RUN: llc < %s -march=thumb -mattr=+thumb2 | \
; RUN: grep {ldr.*\\\[.*\],} | count 1
define i32 @test(i32 %a, i32 %b, i32 %c) {
%tmp1 = mul i32 %a, %b ; <i32> [#uses=2]
%tmp2 = inttoptr i32 %tmp1 to i32* ; <i32*> [#uses=1]
%tmp3 = load i32* %tmp2 ; <i32> [#uses=1]
%tmp4 = sub i32 %tmp1, 8 ; <i32> [#uses=1]
%tmp5 = mul i32 %tmp4, %tmp3 ; <i32> [#uses=1]
ret i32 %tmp5
}
Fix the TCL-style quoting in one random test that somehow slipped through my perl nets.
; RUN: llc < %s -march=thumb -mattr=+thumb2 | \
; RUN: grep "ldr.*\[.*\]," | count 1
define i32 @test(i32 %a, i32 %b, i32 %c) {
%tmp1 = mul i32 %a, %b ; <i32> [#uses=2]
%tmp2 = inttoptr i32 %tmp1 to i32* ; <i32*> [#uses=1]
%tmp3 = load i32* %tmp2 ; <i32> [#uses=1]
%tmp4 = sub i32 %tmp1, 8 ; <i32> [#uses=1]
%tmp5 = mul i32 %tmp4, %tmp3 ; <i32> [#uses=1]
ret i32 %tmp5
}
|
Data Provenance Initiative
|
2025-04-01T17:48:26.624409
|
{
"license": [
"Apache 2 License - https://www.apache.org/licenses/LICENSE-2.0",
"BSD 2-Clause",
"BSD 3-Clause",
"MIT License",
"MIT License"
],
"license_url": "https://opensource.org/licenses/MIT",
"language": [
"English",
"LLVM"
],
"url": "https://github.com/bigcode-project/octopack",
"dataset_id": "commitpackft-llvm",
"response": ""
}
|
commitpackft-llvm-197
|
target triple = "x86_64-unknown-linux-gnu"
target datalayout = "e-m:e-i64:64-f80:128-n8:16:32:64-S128"
; REQUIRES: X86
; RUN: llc %s -o %t.s
; RUN: llvm-mc %t.s -o %t.o -filetype=obj
; RUN: llvm-as %p/Inputs/drop-linkage.ll -o %t2.o
; RUN: ld.lld %t.o %t2.o -o %t.so -save-temps -shared
; RUN: llvm-dis %t.so.lto.opt.bc -o - | FileCheck %s
define void @foo() {
ret void
}
; CHECK: declare void @foo()
Fix test to run everywhere.
target triple = "x86_64-unknown-linux-gnu"
target datalayout = "e-m:e-i64:64-f80:128-n8:16:32:64-S128"
; REQUIRES: x86
; RUN: llc %s -o %t.o -filetype=obj
; RUN: llvm-as %p/Inputs/drop-linkage.ll -o %t2.o
; RUN: ld.lld %t.o %t2.o -o %t.so -save-temps -shared
; RUN: llvm-dis %t.so.lto.opt.bc -o - | FileCheck %s
define void @foo() {
ret void
}
; CHECK: declare void @foo()
|
Data Provenance Initiative
|
2025-04-01T17:48:26.624412
|
{
"license": [
"Apache 2 License - https://www.apache.org/licenses/LICENSE-2.0",
"BSD 2-Clause",
"BSD 3-Clause",
"MIT License",
"MIT License"
],
"license_url": "https://opensource.org/licenses/MIT",
"language": [
"English",
"LLVM"
],
"url": "https://github.com/bigcode-project/octopack",
"dataset_id": "commitpackft-llvm",
"response": ""
}
|
commitpackft-llvm-198
|
; Tests to make sure elimination of casts is working correctly
; RUN: if as < %s | opt -instcombine | grep '%c' | grep cast
; RUN: then exit 1
; RUN: else exit 0
; RUN: fi
implementation
int %test1(int %A) {
%c1 = cast int %A to uint
%c2 = cast uint %c1 to int
ret int %c2
}
ulong %test2(ubyte %A) {
%c1 = cast ubyte %A to ushort
%c2 = cast ushort %c1 to uint
%Ret = cast uint %c2 to ulong
ret ulong %Ret
}
ulong %test3(ulong %A) { ; This function should just use bitwise AND
%c1 = cast ulong %A to ubyte
%c2 = cast ubyte %c1 to ulong
ret ulong %c2
}
Fix testcase to actually test what we think we are
; Tests to make sure elimination of casts is working correctly
; RUN: if as < %s | opt -instcombine -die | dis | grep '%c' | grep cast
; RUN: then exit 1
; RUN: else exit 0
; RUN: fi
implementation
int %test1(int %A) {
%c1 = cast int %A to uint
%c2 = cast uint %c1 to int
ret int %c2
}
ulong %test2(ubyte %A) {
%c1 = cast ubyte %A to ushort
%c2 = cast ushort %c1 to uint
%Ret = cast uint %c2 to ulong
ret ulong %Ret
}
ulong %test3(ulong %A) { ; This function should just use bitwise AND
%c1 = cast ulong %A to ubyte
%c2 = cast ubyte %c1 to ulong
ret ulong %c2
}
|
Data Provenance Initiative
|
2025-04-01T17:48:26.624416
|
{
"license": [
"Apache 2 License - https://www.apache.org/licenses/LICENSE-2.0",
"BSD 2-Clause",
"BSD 3-Clause",
"MIT License",
"MIT License"
],
"license_url": "https://opensource.org/licenses/MIT",
"language": [
"English",
"LLVM"
],
"url": "https://github.com/bigcode-project/octopack",
"dataset_id": "commitpackft-llvm",
"response": ""
}
|
commitpackft-llvm-199
|
; For PR1099
; RUN: llvm-as < %s | llc -march=c | \
; RUN: grep {return ((((llvm_cbe_tmp2 == llvm_cbe_b_0_0_val)) ? (1) : (0)))}
target datalayout = "e-p:32:32"
target triple = "i686-apple-darwin8"
%struct.Connector = type { i16, i16, i8, i8, %struct.Connector*, i8* }
define i1 @prune_match_entry_2E_ce(%struct.Connector* %a, i16 %b.0.0.val) {
newFuncRoot:
br label %entry.ce
cond_next.exitStub: ; preds = %entry.ce
ret i1 true
entry.return_crit_edge.exitStub: ; preds = %entry.ce
ret i1 false
entry.ce: ; preds = %newFuncRoot
%tmp1 = getelementptr %struct.Connector* %a, i32 0, i32 0 ; <i16*> [#uses=1]
%tmp2 = load i16* %tmp1 ; <i16> [#uses=1]
%tmp3 = icmp eq i16 %tmp2, %b.0.0.val ; <i1> [#uses=1]
br i1 %tmp3, label %cond_next.exitStub, label %entry.return_crit_edge.exitStub
}
Update this test to match the (corrected) output from the CBE.
; For PR1099
; RUN: llvm-as < %s | llc -march=c | \
; RUN: grep {return ((((((unsigned short )llvm_cbe_tmp2&65535U) == ((unsigned
short )llvm_cbe_b_0_0_val&65535U))) ? (1) : (0)))}
target datalayout = "e-p:32:32"
target triple = "i686-apple-darwin8"
%struct.Connector = type { i16, i16, i8, i8, %struct.Connector*, i8* }
define i1 @prune_match_entry_2E_ce(%struct.Connector* %a, i16 %b.0.0.val) {
newFuncRoot:
br label %entry.ce
cond_next.exitStub: ; preds = %entry.ce
ret i1 true
entry.return_crit_edge.exitStub: ; preds = %entry.ce
ret i1 false
entry.ce: ; preds = %newFuncRoot
%tmp1 = getelementptr %struct.Connector* %a, i32 0, i32 0 ; <i16*> [#uses=1]
%tmp2 = load i16* %tmp1 ; <i16> [#uses=1]
%tmp3 = icmp eq i16 %tmp2, %b.0.0.val ; <i1> [#uses=1]
br i1 %tmp3, label %cond_next.exitStub, label %entry.return_crit_edge.exitStub
}
|
Data Provenance Initiative
|
2025-04-01T17:48:26.624420
|
{
"license": [
"Apache 2 License - https://www.apache.org/licenses/LICENSE-2.0",
"BSD 2-Clause",
"BSD 3-Clause",
"MIT License",
"MIT License"
],
"license_url": "https://opensource.org/licenses/MIT",
"language": [
"English",
"LLVM"
],
"url": "https://github.com/bigcode-project/octopack",
"dataset_id": "commitpackft-llvm",
"response": ""
}
|
commitpackft-llvm-200
|
implementation
; Bytecode gets a constant pool block, that constains:
; type plane: int(int)
int "main"(int %argc) ; TODO: , sbyte **argv, sbyte **envp)
begin
%retval = call int (int) *%test(int %argc)
%two = add int %retval, %retval
ret int %two
end
int "test"(int %i0)
begin
ret int %i0
end
Add more function call and prototype specific tests
%FunTy = type int(int)
declare int "test"(...) ; Test differences of prototype
declare int "test"() ; Differ only by vararg
implementation
void "invoke"(%FunTy *%x)
begin
%foo = call %FunTy* %x(int 123)
ret void
end
int "main"(int %argc) ; TODO: , sbyte **argv, sbyte **envp)
begin
%retval = call int (int) *%test(int %argc)
%two = add int %retval, %retval
%retval2 = invoke int %test(int %argc)
to label %Next except label %Error
Next:
%two2 = add int %two, %retval2
call void %invoke (%FunTy* %test)
ret int %two2
Error:
ret int -1
end
int "test"(int %i0)
begin
ret int %i0
end
|
Data Provenance Initiative
|
2025-04-01T17:48:26.624424
|
{
"license": [
"Apache 2 License - https://www.apache.org/licenses/LICENSE-2.0",
"BSD 2-Clause",
"BSD 3-Clause",
"MIT License",
"MIT License"
],
"license_url": "https://opensource.org/licenses/MIT",
"language": [
"English",
"LLVM"
],
"url": "https://github.com/bigcode-project/octopack",
"dataset_id": "commitpackft-llvm",
"response": ""
}
|
commitpackft-llvm-201
|
; RUN: llc < %s
; PR38038
define i8 @crash(half) {
entry:
%1 = bitcast half %0 to i16
%.lobit = lshr i16 %1, 15
%2 = trunc i16 %.lobit to i8
ret i8 %2
}
Add x86_64-unkown triple to llc for x86 test.
; RUN: llc < %s -mtriple=x86_64-unknown-unknown
; PR38038
define i8 @crash(half) {
entry:
%1 = bitcast half %0 to i16
%.lobit = lshr i16 %1, 15
%2 = trunc i16 %.lobit to i8
ret i8 %2
}
|
Data Provenance Initiative
|
2025-04-01T17:48:26.624428
|
{
"license": [
"Apache 2 License - https://www.apache.org/licenses/LICENSE-2.0",
"BSD 2-Clause",
"BSD 3-Clause",
"MIT License",
"MIT License"
],
"license_url": "https://opensource.org/licenses/MIT",
"language": [
"English",
"LLVM"
],
"url": "https://github.com/bigcode-project/octopack",
"dataset_id": "commitpackft-llvm",
"response": ""
}
|
commitpackft-llvm-202
|
; RUN: llc < %s -march=x86 -x86-asm-syntax=intel | \
; RUN: grep "lea EAX, DWORD PTR \[... + 4\*... - 5\]"
; RUN: llc < %s -march=x86 -x86-asm-syntax=intel | \
; RUN: not grep add
define i32 @test1(i32 %A, i32 %B) {
%tmp1 = shl i32 %A, 2 ; <i32> [#uses=1]
%tmp3 = add i32 %B, -5 ; <i32> [#uses=1]
%tmp4 = add i32 %tmp3, %tmp1 ; <i32> [#uses=1]
ret i32 %tmp4
}
Rewrite this test properly with a FileCheck instead of greps
; RUN: llc < %s -march=x86 -x86-asm-syntax=intel | FileCheck %s
define i32 @test1(i32 %A, i32 %B) {
%tmp1 = shl i32 %A, 2
%tmp3 = add i32 %B, -5
%tmp4 = add i32 %tmp3, %tmp1
; The above computation of %tmp4 should match a single lea, without using
; actual add instructions.
; CHECK-NOT: add
; CHECK: lea {{[A-Z]+}}, DWORD PTR [{{[A-Z]+}} + 4*{{[A-Z]+}} - 5]
ret i32 %tmp4
}
|
Data Provenance Initiative
|
2025-04-01T17:48:26.624432
|
{
"license": [
"Apache 2 License - https://www.apache.org/licenses/LICENSE-2.0",
"BSD 2-Clause",
"BSD 3-Clause",
"MIT License",
"MIT License"
],
"license_url": "https://opensource.org/licenses/MIT",
"language": [
"English",
"LLVM"
],
"url": "https://github.com/bigcode-project/octopack",
"dataset_id": "commitpackft-llvm",
"response": ""
}
|
commitpackft-llvm-203
|
; RUN: llc < %s -fast-isel -mtriple=x86_64-unknown-linux-gnu -mattr=+avx512f | FileCheck %s
define i1 @test_i1(i1* %b) {
; CHECK-LABEL: test_i1:
; CHECK: # BB#0: # %entry
; CHECK-NEXT: testb $1, (%rdi)
entry:
%0 = load i1, i1* %b, align 1
br i1 %0, label %in, label %out
in:
ret i1 0
out:
ret i1 1
}
Use update_llc_test_checks.py to regenerate a test.
; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py
; RUN: llc < %s -fast-isel -mtriple=x86_64-unknown-linux-gnu -mattr=+avx512f | FileCheck %s
define i1 @test_i1(i1* %b) {
; CHECK-LABEL: test_i1:
; CHECK: # BB#0: # %entry
; CHECK-NEXT: testb $1, (%rdi)
; CHECK-NEXT: je .LBB0_2
; CHECK-NEXT: # BB#1: # %in
; CHECK-NEXT: xorl %eax, %eax
; CHECK-NEXT: retq
; CHECK-NEXT: .LBB0_2: # %out
; CHECK-NEXT: movb $1, %al
; CHECK-NEXT: retq
entry:
%0 = load i1, i1* %b, align 1
br i1 %0, label %in, label %out
in:
ret i1 0
out:
ret i1 1
}
|
Data Provenance Initiative
|
2025-04-01T17:48:26.624436
|
{
"license": [
"Apache 2 License - https://www.apache.org/licenses/LICENSE-2.0",
"BSD 2-Clause",
"BSD 3-Clause",
"MIT License",
"MIT License"
],
"license_url": "https://opensource.org/licenses/MIT",
"language": [
"English",
"LLVM"
],
"url": "https://github.com/bigcode-project/octopack",
"dataset_id": "commitpackft-llvm",
"response": ""
}
|
commitpackft-llvm-204
|
; This tests value of ELF st_other field for function symbol table entries.
; For microMIPS value should be equal to STO_MIPS_MICROMIPS.
; RUN: llc -mtriple mipsel-unknown-linux -mcpu=mips32r2 -mattr=+micromips -print-hack-directives %s -o - | FileCheck %s
define i32 @main() nounwind {
entry:
ret i32 0
}
; CHECK: .set micromips
; CHECK: main:
Remove -print-hack-directives from a test where we already do the right thing.
; This tests value of ELF st_other field for function symbol table entries.
; For microMIPS value should be equal to STO_MIPS_MICROMIPS.
; RUN: llc -mtriple mipsel-unknown-linux -mcpu=mips32r2 -mattr=+micromips %s -o - | FileCheck %s
define i32 @main() nounwind {
entry:
ret i32 0
}
; CHECK: .set micromips
; CHECK: main:
|
Data Provenance Initiative
|
2025-04-01T17:48:26.624439
|
{
"license": [
"Apache 2 License - https://www.apache.org/licenses/LICENSE-2.0",
"BSD 2-Clause",
"BSD 3-Clause",
"MIT License",
"MIT License"
],
"license_url": "https://opensource.org/licenses/MIT",
"language": [
"English",
"LLVM"
],
"url": "https://github.com/bigcode-project/octopack",
"dataset_id": "commitpackft-llvm",
"response": ""
}
|
commitpackft-llvm-205
|
; RUN: opt < %s -gvn -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"
target triple = "i386-apple-darwin7"
define i8 @test(i8* %P) nounwind {
; CHECK: lifetime.start
; CHECK-NOT: load
; CHECK: lifetime.end
entry:
call void @llvm.lifetime.start(i64 32, i8* %P)
%0 = load i8* %P
store i8 1, i8* %P
call void @llvm.lifetime.end(i64 32, i8* %P)
%1 = load i8* %P
ret i8 %1
}
declare {}* @llvm.lifetime.start(i64 %S, i8* nocapture %P) readonly
declare void @llvm.lifetime.end(i64 %S, i8* nocapture %P)
Fix intrinsic signature in this test.
; RUN: opt < %s -gvn -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"
target triple = "i386-apple-darwin7"
define i8 @test(i8* %P) nounwind {
; CHECK: lifetime.start
; CHECK-NOT: load
; CHECK: lifetime.end
entry:
call void @llvm.lifetime.start(i64 32, i8* %P)
%0 = load i8* %P
store i8 1, i8* %P
call void @llvm.lifetime.end(i64 32, i8* %P)
%1 = load i8* %P
ret i8 %1
}
declare void @llvm.lifetime.start(i64 %S, i8* nocapture %P) readonly
declare void @llvm.lifetime.end(i64 %S, i8* nocapture %P)
|
Data Provenance Initiative
|
2025-04-01T17:48:26.624443
|
{
"license": [
"Apache 2 License - https://www.apache.org/licenses/LICENSE-2.0",
"BSD 2-Clause",
"BSD 3-Clause",
"MIT License",
"MIT License"
],
"license_url": "https://opensource.org/licenses/MIT",
"language": [
"English",
"LLVM"
],
"url": "https://github.com/bigcode-project/octopack",
"dataset_id": "commitpackft-llvm",
"response": ""
}
|
commitpackft-llvm-206
|
; RUN: llvm-as < %s | llc -march=thumb -mattr=+thumb2 -mtriple=armv6-apple-darwin10 | FileCheck %s
@t = weak global i32 ()* null ; <i32 ()**> [#uses=1]
declare void @g(i32, i32, i32, i32)
define void @f() {
; CHECK: f:
; CHECK: blx
call void @g( i32 1, i32 2, i32 3, i32 4 )
ret void
}
define void @h() {
; CHECK: h:
; CHECK: blx r0
%tmp = load i32 ()** @t ; <i32 ()*> [#uses=1]
%tmp.upgrd.2 = tail call i32 %tmp( ) ; <i32> [#uses=0]
ret void
}
Test both darwin and linux.
; RUN: llvm-as < %s | llc -mtriple=thumbv7-apple-darwin -mattr=+thumb2 | FileCheck %s -check-prefix=DARWIN
; RUN: llvm-as < %s | llc -mtriple=thumbv7-linux -mattr=+thumb2 | FileCheck %s -check-prefix=LINUX
@t = weak global i32 ()* null ; <i32 ()**> [#uses=1]
declare void @g(i32, i32, i32, i32)
define void @f() {
; DARWIN: f:
; DARWIN: blx L_g$stub
; LINUX: f:
; LINUX: bl g
call void @g( i32 1, i32 2, i32 3, i32 4 )
ret void
}
define void @h() {
; DARWIN: h:
; DARWIN: blx r0
; LINUX: h:
; LINUX: blx r0
%tmp = load i32 ()** @t ; <i32 ()*> [#uses=1]
%tmp.upgrd.2 = tail call i32 %tmp( ) ; <i32> [#uses=0]
ret void
}
|
Data Provenance Initiative
|
2025-04-01T17:48:26.624446
|
{
"license": [
"Apache 2 License - https://www.apache.org/licenses/LICENSE-2.0",
"BSD 2-Clause",
"BSD 3-Clause",
"MIT License",
"MIT License"
],
"license_url": "https://opensource.org/licenses/MIT",
"language": [
"English",
"LLVM"
],
"url": "https://github.com/bigcode-project/octopack",
"dataset_id": "commitpackft-llvm",
"response": ""
}
|
commitpackft-llvm-207
|
; RUN: llc -march=x86 < %s | FileCheck %s
; Verify that llvm.ident metadata is emitted as .ident
; directives in assembly files, and in the .comment section in ELF object files.
; CHECK: .ident "clang version x.x"
; CHECK-NEXT: .ident "something else"
!llvm.ident = !{!0, !1}
!0 = metadata !{metadata !"clang version x.x"}
!1 = metadata !{metadata !"something else"}
Add a triple to this test.
; RUN: llc -mtriple=x86_64-linux < %s | FileCheck %s
; Verify that llvm.ident metadata is emitted as .ident
; directives in assembly files, and in the .comment section in ELF object files.
; CHECK: .ident "clang version x.x"
; CHECK-NEXT: .ident "something else"
!llvm.ident = !{!0, !1}
!0 = metadata !{metadata !"clang version x.x"}
!1 = metadata !{metadata !"something else"}
|
Data Provenance Initiative
|
2025-04-01T17:48:26.624450
|
{
"license": [
"Apache 2 License - https://www.apache.org/licenses/LICENSE-2.0",
"BSD 2-Clause",
"BSD 3-Clause",
"MIT License",
"MIT License"
],
"license_url": "https://opensource.org/licenses/MIT",
"language": [
"English",
"LLVM"
],
"url": "https://github.com/bigcode-project/octopack",
"dataset_id": "commitpackft-llvm",
"response": ""
}
|
commitpackft-llvm-208
|
; RUN: llvm-as < %s | opt -lcssa | llvm-dis | grep "%lcssa = phi int"
void %lcssa(bool %S2) {
entry:
br label %loop.interior
loop.interior: ; preds = %entry
br bool %S2, label %if.true, label %if.false
if.true:
%X1 = add int 0, 0
br label %post.if
if.false:
%X2 = add int 0, 1
br label %post.if
post.if:
%X3 = phi int [%X1, %if.true], [%X2, %if.false]
br bool %S2, label %loop.exit, label %loop.interior
loop.exit:
%X4 = add int 3, %X3
ret void
}
Update the testcase to check the full extent of LCSSA.
; RUN: llvm-as < %s | opt -lcssa | llvm-dis | grep "%lcssa = phi int"
; RUN: llvm-as < %s | opt -lcssa | llvm-dis | grep "%X4 = add int 3, %lcssa"
void %lcssa(bool %S2) {
entry:
br label %loop.interior
loop.interior: ; preds = %entry
br bool %S2, label %if.true, label %if.false
if.true:
%X1 = add int 0, 0
br label %post.if
if.false:
%X2 = add int 0, 1
br label %post.if
post.if:
%X3 = phi int [%X1, %if.true], [%X2, %if.false]
br bool %S2, label %loop.exit, label %loop.interior
loop.exit:
%X4 = add int 3, %X3
ret void
}
|
Data Provenance Initiative
|
2025-04-01T17:48:26.624454
|
{
"license": [
"Apache 2 License - https://www.apache.org/licenses/LICENSE-2.0",
"BSD 2-Clause",
"BSD 3-Clause",
"MIT License",
"MIT License"
],
"license_url": "https://opensource.org/licenses/MIT",
"language": [
"English",
"LLVM"
],
"url": "https://github.com/bigcode-project/octopack",
"dataset_id": "commitpackft-llvm",
"response": ""
}
|
commitpackft-llvm-209
|
; RUN: llc -march=amdgcn -mcpu=gfx900 -amdgpu-atomic-optimizations=true < %s | FileCheck %s
; RUN: llc -march=amdgcn -mcpu=gfx900 -amdgpu-atomic-optimizations=true < %s -use-gpu-divergence-analysis | FileCheck %s
@local = addrspace(3) global i32 undef
define void @reducible(i32 %x) {
; CHECK-LABEL: reducible:
; CHECK-NOT: dpp
entry:
br label %loop
loop:
%i = phi i32 [ 0, %entry ], [ %i1, %loop ]
%gep = getelementptr i32, i32 addrspace(3)* @local, i32 %i
%cond = icmp ult i32 %i, %x
%i1 = add i32 %i, 1
br i1 %cond, label %loop, label %exit
exit:
%old = atomicrmw add i32 addrspace(3)* %gep, i32 %x acq_rel
ret void
}
Add amdgpu_kernel for consistency with other tests
; RUN: llc -march=amdgcn -mcpu=gfx900 -amdgpu-atomic-optimizations=true < %s | FileCheck %s
; RUN: llc -march=amdgcn -mcpu=gfx900 -amdgpu-atomic-optimizations=true < %s -use-gpu-divergence-analysis | FileCheck %s
@local = addrspace(3) global i32 undef
define amdgpu_kernel void @reducible(i32 %x) {
; CHECK-LABEL: reducible:
; CHECK-NOT: dpp
entry:
br label %loop
loop:
%i = phi i32 [ 0, %entry ], [ %i1, %loop ]
%gep = getelementptr i32, i32 addrspace(3)* @local, i32 %i
%cond = icmp ult i32 %i, %x
%i1 = add i32 %i, 1
br i1 %cond, label %loop, label %exit
exit:
%old = atomicrmw add i32 addrspace(3)* %gep, i32 %x acq_rel
ret void
}
|
Data Provenance Initiative
|
2025-04-01T17:48:26.624458
|
{
"license": [
"Apache 2 License - https://www.apache.org/licenses/LICENSE-2.0",
"BSD 2-Clause",
"BSD 3-Clause",
"MIT License",
"MIT License"
],
"license_url": "https://opensource.org/licenses/MIT",
"language": [
"English",
"LLVM"
],
"url": "https://github.com/bigcode-project/octopack",
"dataset_id": "commitpackft-llvm",
"response": ""
}
|
commitpackft-llvm-210
|
int %f(int %a) {
entry:
%tmp = seteq int %a, 4 ; <bool> [#uses=1]
br bool %tmp, label %cond_false, label %cond_true
cond_true: ; preds = %entry
br label %return
cond_false: ; preds = %entry
br label %return
return: ; preds = %cond_false, %cond_true
%retval.0 = phi int [ 2, %cond_true ], [ 3, %cond_false ] ; <int> [#uses=1]
ret int %retval.0
}
Add a simple RUN line so this doesn't always fail. XFAIL this until Rafael can get a chance to fix it.
; RUN llvm-as %s -o /dev/null -f
; XFAIL: ALL
int %f(int %a) {
entry:
%tmp = seteq int %a, 4 ; <bool> [#uses=1]
br bool %tmp, label %cond_false, label %cond_true
cond_true: ; preds = %entry
br label %return
cond_false: ; preds = %entry
br label %return
return: ; preds = %cond_false, %cond_true
%retval.0 = phi int [ 2, %cond_true ], [ 3, %cond_false ] ; <int> [#uses=1]
ret int %retval.0
}
|
Data Provenance Initiative
|
2025-04-01T17:48:26.624462
|
{
"license": [
"Apache 2 License - https://www.apache.org/licenses/LICENSE-2.0",
"BSD 2-Clause",
"BSD 3-Clause",
"MIT License",
"MIT License"
],
"license_url": "https://opensource.org/licenses/MIT",
"language": [
"English",
"LLVM"
],
"url": "https://github.com/bigcode-project/octopack",
"dataset_id": "commitpackft-llvm",
"response": ""
}
|
commitpackft-llvm-211
|
%Hosp = type { int, int, int, { \2 *, { int, int, int, { [4 x \3], \2, \5, \6,
int, int } * } *, \2 * }, { \2 *, { int, int, int, { [4 x \3], \2, \5, \6, int,
int } * } *, \2 * }, { \2 *, { int, int, int, { [4 x \3], \2, \5, \6, int, int
} * } *, \2 * }, { \2 *, { int, int, int, { [4 x \3], \2, \5, \6, int, int } * }
*, \2 * } }
Fix bug in testcase: no implementatino section make it not legal input, so once the parser is fixed to handle the bug, it broke on the bad input. :)
%Hosp = type { int, int, int, { \2 *, { int, int, int, { [4 x \3], \2, \5, \6,
int, int } * } *, \2 * }, { \2 *, { int, int, int, { [4 x \3], \2, \5, \6, int,
int } * } *, \2 * }, { \2 *, { int, int, int, { [4 x \3], \2, \5, \6, int, int
} * } *, \2 * }, { \2 *, { int, int, int, { [4 x \3], \2, \5, \6, int, int } * }
*, \2 * } }
implementation
|
Data Provenance Initiative
|
2025-04-01T17:48:26.624465
|
{
"license": [
"Apache 2 License - https://www.apache.org/licenses/LICENSE-2.0",
"BSD 2-Clause",
"BSD 3-Clause",
"MIT License",
"MIT License"
],
"license_url": "https://opensource.org/licenses/MIT",
"language": [
"English",
"LLVM"
],
"url": "https://github.com/bigcode-project/octopack",
"dataset_id": "commitpackft-llvm",
"response": ""
}
|
commitpackft-llvm-212
|
; The output formater prints out 1.0e100 as Inf!
;
; RUN: llvm-as < %s | llvm-dis | llvm-as | llvm-dis
define float @test() {
%tmp = mul float 0x7FF0000000000000, 1.000000e+01 ; <float> [#uses=1]
ret float %tmp
}
Make this test slightly more strict.
; The output formater prints out 1.0e100 as Inf!
;
; RUN: llvm-as < %s | llvm-dis | llvm-as | llvm-dis | grep 0x7FF0000000000000
define float @test() {
%tmp = mul float 0x7FF0000000000000, 1.000000e+01 ; <float> [#uses=1]
ret float %tmp
}
|
Data Provenance Initiative
|
2025-04-01T17:48:26.624469
|
{
"license": [
"Apache 2 License - https://www.apache.org/licenses/LICENSE-2.0",
"BSD 2-Clause",
"BSD 3-Clause",
"MIT License",
"MIT License"
],
"license_url": "https://opensource.org/licenses/MIT",
"language": [
"English",
"LLVM"
],
"url": "https://github.com/bigcode-project/octopack",
"dataset_id": "commitpackft-llvm",
"response": ""
}
|
commitpackft-llvm-213
|
; Check that the backend doesn't crash.
; RUN: llc -mtriple=x86_64-pc-freebsd %s -o - | FileCheck %s
@__stack_chk_guard = internal global [8 x i64] zeroinitializer, align 16
define void @f() sspstrong {
%tbl = alloca [4 x i64], align 16
ret void
}
; CHECK: .type __stack_chk_guard,@object
; CHECK: .local __stack_chk_guard
; CHECK: .comm __stack_chk_guard,64,16
Improve r272262, check that __stack_chk_guard is used.
; Check that the backend doesn't crash.
; RUN: llc -mtriple=x86_64-pc-freebsd %s -o - | FileCheck %s
@__stack_chk_guard = internal global [8 x i64] zeroinitializer, align 16
define void @f() sspstrong {
%tbl = alloca [4 x i64], align 16
ret void
}
; CHECK: movq __stack_chk_guard(%rip), %rax
; CHECKL movq __stack_chk_guard(%rip), %rax
; CHECK: .type __stack_chk_guard,@object
; CHECK: .local __stack_chk_guard
; CHECK: .comm __stack_chk_guard,64,16
|
Data Provenance Initiative
|
2025-04-01T17:48:26.624472
|
{
"license": [
"Apache 2 License - https://www.apache.org/licenses/LICENSE-2.0",
"BSD 2-Clause",
"BSD 3-Clause",
"MIT License",
"MIT License"
],
"license_url": "https://opensource.org/licenses/MIT",
"language": [
"English",
"LLVM"
],
"url": "https://github.com/bigcode-project/octopack",
"dataset_id": "commitpackft-llvm",
"response": ""
}
|
commitpackft-llvm-214
|
; RUN: llvm-as %s -o %t.bc
; RUN: llvm-lto2 run -r=%t.bc,foo,pxl -use-new-pm --print-before-all %t.bc -o - 2>&1 | FileCheck %s --check-prefix=CHECK-BEFORE
; RUN: llvm-lto2 run -r=%t.bc,foo,pxl -use-new-pm --print-after-all %t.bc -o - 2>&1 | FileCheck %s --check-prefix=CHECK-AFTER
; CHECK-BEFORE: *** IR Dump Before GlobalDCEPass ***
; CHECK-AFTER: *** IR Dump After GlobalDCEPass ***
target datalayout = "e-m:e-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-unknown-linux-gnu"
define i32 @foo() {
ret i32 42
}
Fix test added in r369024.
; RUN: llvm-as %s -o %t.bc
; RUN: llvm-lto2 run -r=%t.bc,foo,pxl -use-new-pm --print-before-all %t.bc -o %t2 2>&1 | FileCheck %s --check-prefix=CHECK-BEFORE
; RUN: llvm-lto2 run -r=%t.bc,foo,pxl -use-new-pm --print-after-all %t.bc -o %t3 2>&1 | FileCheck %s --check-prefix=CHECK-AFTER
; CHECK-BEFORE: *** IR Dump Before GlobalDCEPass ***
; CHECK-AFTER: *** IR Dump After GlobalDCEPass ***
target datalayout = "e-m:e-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-unknown-linux-gnu"
define i32 @foo() {
ret i32 42
}
|
Data Provenance Initiative
|
2025-04-01T17:48:26.624476
|
{
"license": [
"Apache 2 License - https://www.apache.org/licenses/LICENSE-2.0",
"BSD 2-Clause",
"BSD 3-Clause",
"MIT License",
"MIT License"
],
"license_url": "https://opensource.org/licenses/MIT",
"language": [
"English",
"LLVM"
],
"url": "https://github.com/bigcode-project/octopack",
"dataset_id": "commitpackft-llvm",
"response": ""
}
|
commitpackft-llvm-215
|
; RUN: llvm-dis %s.bc-16 -o /dev/null -f &&
; RUN: llc %s.bc-16 -o /dev/null -f -march=c &&
; RUN: llvm-as < %s
void %test(int* %P, int* %Q) {
entry:
%tmp.1 = cast int* %P to sbyte* ; <sbyte*> [#uses=2]
%tmp.3 = cast int* %Q to sbyte* ; <sbyte*> [#uses=3]
tail call void %llvm.memcpy( sbyte* %tmp.1, sbyte* %tmp.3, uint 100000, uint 1 )
tail call void %llvm.memcpy( sbyte* %tmp.1, sbyte* %tmp.3, ulong 100000, uint 1 )
tail call void %llvm.memset( sbyte* %tmp.3, ubyte 14, uint 10000, uint 0 )
tail call void %llvm.memmove( sbyte* %tmp.1, sbyte* %tmp.3, uint 123124, uint 1 )
ret void
}
declare void %llvm.memcpy(sbyte*, sbyte*, uint, uint)
declare void %llvm.memcpy(sbyte*, sbyte*, ulong, uint)
declare void %llvm.memset(sbyte*, ubyte, uint, uint)
declare void %llvm.memmove(sbyte*, sbyte*, uint, uint)
Upgrade old intrinsic function calls manually.
; RUN: llvm-upgrade < %s | llvm-as -o /dev/null -f
void %test(int* %P, int* %Q) {
entry:
%tmp.1 = cast int* %P to sbyte* ; <sbyte*> [#uses=2]
%tmp.3 = cast int* %Q to sbyte* ; <sbyte*> [#uses=3]
tail call void %llvm.memcpy.i32( sbyte* %tmp.1, sbyte* %tmp.3, uint 100000, uint 1 )
tail call void %llvm.memcpy.i64( sbyte* %tmp.1, sbyte* %tmp.3, ulong 100000, uint 1 )
tail call void %llvm.memset.i32( sbyte* %tmp.3, ubyte 14, uint 10000, uint 0 )
tail call void %llvm.memmove.i32( sbyte* %tmp.1, sbyte* %tmp.3, uint 123124, uint 1 )
ret void
}
declare void %llvm.memcpy.i32(sbyte*, sbyte*, uint, uint)
declare void %llvm.memcpy.i64(sbyte*, sbyte*, ulong, uint)
declare void %llvm.memset.i32(sbyte*, ubyte, uint, uint)
declare void %llvm.memmove.i32(sbyte*, sbyte*, uint, uint)
|
Data Provenance Initiative
|
2025-04-01T17:48:26.624481
|
{
"license": [
"Apache 2 License - https://www.apache.org/licenses/LICENSE-2.0",
"BSD 2-Clause",
"BSD 3-Clause",
"MIT License",
"MIT License"
],
"license_url": "https://opensource.org/licenses/MIT",
"language": [
"English",
"LLVM"
],
"url": "https://github.com/bigcode-project/octopack",
"dataset_id": "commitpackft-llvm",
"response": ""
}
|
commitpackft-llvm-216
|
; RUN: opt -S -globalopt < %s | FileCheck %s
; PR6112 - When globalopt does RAUW(@G, %G), the metadata reference should drop
; to null. Function local metadata that references @G from a different function
; to that containing %G should likewise drop to null.
@G = internal global i8** null
define i32 @main(i32 %argc, i8** %argv) {
; CHECK: @main
; CHECK: %G = alloca
store i8** %argv, i8*** @G
ret i32 0
}
define void @foo(i32 %x) {
call void @llvm.dbg.value(metadata !{i8*** @G, i32 %x}, i64 0, metadata !1)
; CHECK: call void @llvm.dbg.value(metadata !{null, i32 %x}, i64 0, metadata !1)
ret void
}
declare void @llvm.dbg.value(metadata, i64, metadata) nounwind readnone
!named = !{!0}
!0 = metadata !{i8*** @G}
; CHECK: !0 = metadata !{null}
!1 = metadata !{i8* null}
Use llvm.foo as the intrinsic, rather than llvm.dbg.value. Since the values passed to llvm.dbg.value were not valid for the intrinsic, it might have caused trouble one day if the verifier ever started checking for valid debug info.
; RUN: opt -S -globalopt < %s | FileCheck %s
; PR6112 - When globalopt does RAUW(@G, %G), the metadata reference should drop
; to null. Function local metadata that references @G from a different function
; to that containing %G should likewise drop to null.
@G = internal global i8** null
define i32 @main(i32 %argc, i8** %argv) {
; CHECK: @main
; CHECK: %G = alloca
store i8** %argv, i8*** @G
ret i32 0
}
define void @foo(i32 %x) {
call void @llvm.foo(metadata !{i8*** @G, i32 %x})
; CHECK: call void @llvm.foo(metadata !{null, i32 %x})
ret void
}
declare void @llvm.foo(metadata) nounwind readnone
!named = !{!0}
!0 = metadata !{i8*** @G}
; CHECK: !0 = metadata !{null}
|
Data Provenance Initiative
|
2025-04-01T17:48:26.624485
|
{
"license": [
"Apache 2 License - https://www.apache.org/licenses/LICENSE-2.0",
"BSD 2-Clause",
"BSD 3-Clause",
"MIT License",
"MIT License"
],
"license_url": "https://opensource.org/licenses/MIT",
"language": [
"English",
"LLVM"
],
"url": "https://github.com/bigcode-project/octopack",
"dataset_id": "commitpackft-llvm",
"response": ""
}
|
commitpackft-llvm-217
|
; RUN: llvm-upgrade < %s | llvm-as | llvm-dis > %t1.ll
; RUN: llvm-as %t1.ll -o - | llvm-dis > %t2.ll
; RUN: diff %t1.ll %t2.ll
; RUN: llvm-as < %s | llvm-dis
%foo1 = uninitialized global <4 x float>;
%foo2 = uninitialized global <2 x int>;
implementation ; Functions:
void %main()
{
store <4 x float> <float 1.0, float 2.0, float 3.0, float 4.0>, <4 x float>* %foo1
store <2 x int> <int 4, int 4>, <2 x int>* %foo2
%l1 = load <4 x float>* %foo1
%l2 = load <2 x int>* %foo2
ret void
}
Remove a redundant RUN: line.
; RUN: llvm-upgrade < %s | llvm-as | llvm-dis > %t1.ll
; RUN: llvm-as %t1.ll -o - | llvm-dis > %t2.ll
; RUN: diff %t1.ll %t2.ll
%foo1 = uninitialized global <4 x float>;
%foo2 = uninitialized global <2 x int>;
implementation ; Functions:
void %main()
{
store <4 x float> <float 1.0, float 2.0, float 3.0, float 4.0>, <4 x float>* %foo1
store <2 x int> <int 4, int 4>, <2 x int>* %foo2
%l1 = load <4 x float>* %foo1
%l2 = load <2 x int>* %foo2
ret void
}
|
Data Provenance Initiative
|
2025-04-01T17:48:26.624488
|
{
"license": [
"Apache 2 License - https://www.apache.org/licenses/LICENSE-2.0",
"BSD 2-Clause",
"BSD 3-Clause",
"MIT License",
"MIT License"
],
"license_url": "https://opensource.org/licenses/MIT",
"language": [
"English",
"LLVM"
],
"url": "https://github.com/bigcode-project/octopack",
"dataset_id": "commitpackft-llvm",
"response": ""
}
|
commitpackft-llvm-218
|
; RUN: llc < %s -march=x86 | FileCheck %s
; CHECK: "iΔ",4,4
@"i\CE\94" = common global i32 0, align 4
Make the test for r154235 more platform-independent with a shorter string.
; RUN: llc < %s -march=x86 | FileCheck %s
; CHECK: iΔ
@"i\CE\94" = common global i32 0, align 4
|
Data Provenance Initiative
|
2025-04-01T17:48:26.624492
|
{
"license": [
"Apache 2 License - https://www.apache.org/licenses/LICENSE-2.0",
"BSD 2-Clause",
"BSD 3-Clause",
"MIT License",
"MIT License"
],
"license_url": "https://opensource.org/licenses/MIT",
"language": [
"English",
"LLVM"
],
"url": "https://github.com/bigcode-project/octopack",
"dataset_id": "commitpackft-llvm",
"response": ""
}
|
commitpackft-llvm-219
|
; REQUIRES: shell
; RUN: rm -rf %t.dir
; RUN: mkdir -p %t.dir
; RUN: llc -filetype=obj %s -o %t.dir/foo.o
; RUN: wasm-ld --reproduce=%t.dir/repro.tar -o out.wasm %t.dir/foo.o
; RUN: cd %t.dir
; RUN: tar tf repro.tar | FileCheck --check-prefix=TAR %s
; TAR: repro/response.txt
; TAR: repro/version.txt
; TAR: repro/{{.*}}/foo.o
; RUN: tar xf repro.tar
; RUN: FileCheck --check-prefix=RSP %s < repro/response.txt
; RSP: -o out.wasm
; RSP: {{.*}}/foo.o
; RUN: FileCheck %s --check-prefix=VERSION < repro/version.txt
; VERSION: LLD
target triple = "wasm32-unknown-unknown"
define void @_start() {
ret void
}
Fix test to put its outputs into the temp directory.
; REQUIRES: shell
; RUN: rm -rf %t.dir
; RUN: mkdir -p %t.dir
; RUN: llc -filetype=obj %s -o %t.dir/foo.o
; RUN: wasm-ld --reproduce=%t.dir/repro.tar -o %t.dir/out.wasm %t.dir/foo.o
; RUN: cd %t.dir
; RUN: tar tf repro.tar | FileCheck --check-prefix=TAR %s
; TAR: repro/response.txt
; TAR: repro/version.txt
; TAR: repro/{{.*}}/foo.o
; RUN: tar xf repro.tar
; RUN: FileCheck --check-prefix=RSP %s < repro/response.txt
; RSP: -o {{.*}}out.wasm
; RSP: {{.*}}/foo.o
; RUN: FileCheck %s --check-prefix=VERSION < repro/version.txt
; VERSION: LLD
target triple = "wasm32-unknown-unknown"
define void @_start() {
ret void
}
|
Data Provenance Initiative
|
2025-04-01T17:48:26.624496
|
{
"license": [
"Apache 2 License - https://www.apache.org/licenses/LICENSE-2.0",
"BSD 2-Clause",
"BSD 3-Clause",
"MIT License",
"MIT License"
],
"license_url": "https://opensource.org/licenses/MIT",
"language": [
"English",
"LLVM"
],
"url": "https://github.com/bigcode-project/octopack",
"dataset_id": "commitpackft-llvm",
"response": ""
}
|
commitpackft-llvm-220
|
; Test that the StrChrOptimizer works correctly
; RUN: llvm-as < %s | opt -simplify-libcalls | llvm-dis | not grep 'call.*strchr'
declare sbyte* %strchr(sbyte*,int)
declare int %puts(sbyte*)
%hello = constant [14 x sbyte] c"hello world\n\00"
%null = constant [1 x sbyte] c"\00"
implementation ; Functions:
int %main () {
%hello_p = getelementptr [14 x sbyte]* %hello, int 0, int 0
%null_p = getelementptr [1 x sbyte]* %null, int 0, int 0
%world = call sbyte* %strchr(sbyte* %hello_p, int 119 )
%ignore = call sbyte* %strchr(sbyte* %null_p, int 119 )
%result = call int %puts(sbyte* %world)
ret int %result
}
Fix this test to succeed even if "strchr" is on a call instruction.
; Test that the StrChrOptimizer works correctly
; RUN: llvm-as < %s | opt -simplify-libcalls | llvm-dis | not grep 'call.*%strchr'
declare sbyte* %strchr(sbyte*,int)
declare int %puts(sbyte*)
%hello = constant [14 x sbyte] c"hello world\n\00"
%null = constant [1 x sbyte] c"\00"
implementation ; Functions:
int %main () {
%hello_p = getelementptr [14 x sbyte]* %hello, int 0, int 0
%null_p = getelementptr [1 x sbyte]* %null, int 0, int 0
%world = call sbyte* %strchr(sbyte* %hello_p, int 119 )
%ignore = call sbyte* %strchr(sbyte* %null_p, int 119 )
%len = call int %puts(sbyte* %world)
%index = add int %len, 112
%result = call sbyte* %strchr(sbyte* %hello_p, int %index)
ret int %index
}
|
Data Provenance Initiative
|
2025-04-01T17:48:26.624500
|
{
"license": [
"Apache 2 License - https://www.apache.org/licenses/LICENSE-2.0",
"BSD 2-Clause",
"BSD 3-Clause",
"MIT License",
"MIT License"
],
"license_url": "https://opensource.org/licenses/MIT",
"language": [
"English",
"LLVM"
],
"url": "https://github.com/bigcode-project/octopack",
"dataset_id": "commitpackft-llvm",
"response": ""
}
|
commitpackft-llvm-221
|
; RUN: llvm-as < %s | llc -march=x86 -mattr=+sse2 | grep movss | wc -l | grep 3 &&
; RUN: llvm-as < %s | llc -march=x86 -mattr=+sse2 | grep unpckhps | wc -l | grep 1 &&
; RUN: llvm-as < %s | llc -march=x86 -mattr=+sse2 | grep pshufd | wc -l | grep 1
void %test1(<4 x float>* %F, float* %f) {
%tmp = load <4 x float>* %F
%tmp7 = add <4 x float> %tmp, %tmp
%tmp2 = extractelement <4 x float> %tmp7, uint 0
store float %tmp2, float* %f
ret void
}
float %test2(<4 x float>* %F, float* %f) {
%tmp = load <4 x float>* %F
%tmp7 = add <4 x float> %tmp, %tmp
%tmp2 = extractelement <4 x float> %tmp7, uint 2
ret float %tmp2
}
void %test2(float* %R, <4 x float>* %P1) {
%X = load <4 x float>* %P1
%tmp = extractelement <4 x float> %X, uint 2
store float %tmp, float* %R
ret void
}
Update vector extract test cases.
; RUN: llvm-as < %s | llc -march=x86 -mattr=+sse2 | grep movss | wc -l | grep 3 &&
; RUN: llvm-as < %s | llc -march=x86 -mattr=+sse2 | grep movhlps | wc -l | grep 1 &&
; RUN: llvm-as < %s | llc -march=x86 -mattr=+sse2 | grep pshufd | wc -l | grep 1
void %test1(<4 x float>* %F, float* %f) {
%tmp = load <4 x float>* %F
%tmp7 = add <4 x float> %tmp, %tmp
%tmp2 = extractelement <4 x float> %tmp7, uint 0
store float %tmp2, float* %f
ret void
}
float %test2(<4 x float>* %F, float* %f) {
%tmp = load <4 x float>* %F
%tmp7 = add <4 x float> %tmp, %tmp
%tmp2 = extractelement <4 x float> %tmp7, uint 2
ret float %tmp2
}
void %test2(float* %R, <4 x float>* %P1) {
%X = load <4 x float>* %P1
%tmp = extractelement <4 x float> %X, uint 3
store float %tmp, float* %R
ret void
}
|
Data Provenance Initiative
|
2025-04-01T17:48:26.624504
|
{
"license": [
"Apache 2 License - https://www.apache.org/licenses/LICENSE-2.0",
"BSD 2-Clause",
"BSD 3-Clause",
"MIT License",
"MIT License"
],
"license_url": "https://opensource.org/licenses/MIT",
"language": [
"English",
"LLVM"
],
"url": "https://github.com/bigcode-project/octopack",
"dataset_id": "commitpackft-llvm",
"response": ""
}
|
commitpackft-llvm-222
|
; RUN: as < %s > Output/%s.out1.bc
; RUN: echo "%S = external global { int, opaque* }" | as > Output/%s.out2.bc
; RUN: link Output/%s.out[12].bc | dis | not grep opaque
; After linking this testcase, there should be no opaque types left. The two
; S's should cause the opaque type to be resolved to 'int'.
%S = global { int, int* } { int 5, int* null }
Test functions as well as globals
; RUN: as < %s > Output/%s.out1.bc
; RUN: echo "%S = external global { int, opaque* } declare void %F(opaque*)" | as > Output/%s.out2.bc
; RUN: link Output/%s.out[12].bc | dis | not grep opaque
; After linking this testcase, there should be no opaque types left. The two
; S's should cause the opaque type to be resolved to 'int'.
%S = global { int, int* } { int 5, int* null }
declare void %F(int*)
|
Data Provenance Initiative
|
2025-04-01T17:48:26.624508
|
{
"license": [
"Apache 2 License - https://www.apache.org/licenses/LICENSE-2.0",
"BSD 2-Clause",
"BSD 3-Clause",
"MIT License",
"MIT License"
],
"license_url": "https://opensource.org/licenses/MIT",
"language": [
"English",
"LLVM"
],
"url": "https://github.com/bigcode-project/octopack",
"dataset_id": "commitpackft-llvm",
"response": ""
}
|
commitpackft-llvm-223
|
; RUN: opt < %s -instcombine -S | FileCheck %s
target datalayout = "e-p:32:32:32-i1:8:32-i8:8:32-i16:16:32-i32:32:32-i64:32:32-f32:32:32-f64:32:32-v64:64:64-v128:128:128-a0:0:32-n32"
@a = constant [2 x i32] [i32 3, i32 6] ; <[2 x i32]*> [#uses=2]
define arm_apcscc i32 @b(i32 %y) nounwind readonly {
; CHECK: @b
; CHECK-NOT: load
; CHECK: ret i32
entry:
%0 = icmp eq i32 %y, 0 ; <i1> [#uses=1]
%storemerge = select i1 %0, i32* getelementptr inbounds ([2 x i32]* @a, i32 0, i32 1), i32* getelementptr inbounds ([2 x i32]* @a, i32 0, i32 0) ; <i32*> [#uses=1]
%1 = load i32* %storemerge, align 4 ; <i32> [#uses=1]
ret i32 %1
}
Remove ARM-specific calling convention from this test. Target data is needed for this test, but otherwise, there's nothing ARM-specific about it and no need to specify the calling convention.
; RUN: opt < %s -instcombine -S | FileCheck %s
target datalayout = "e-p:32:32:32-i1:8:32-i8:8:32-i16:16:32-i32:32:32-i64:32:32-f32:32:32-f64:32:32-v64:64:64-v128:128:128-a0:0:32-n32"
@a = constant [2 x i32] [i32 3, i32 6] ; <[2 x i32]*> [#uses=2]
define i32 @b(i32 %y) nounwind readonly {
; CHECK: @b
; CHECK-NOT: load
; CHECK: ret i32
entry:
%0 = icmp eq i32 %y, 0 ; <i1> [#uses=1]
%storemerge = select i1 %0, i32* getelementptr inbounds ([2 x i32]* @a, i32 0, i32 1), i32* getelementptr inbounds ([2 x i32]* @a, i32 0, i32 0) ; <i32*> [#uses=1]
%1 = load i32* %storemerge, align 4 ; <i32> [#uses=1]
ret i32 %1
}
|
Data Provenance Initiative
|
2025-04-01T17:48:26.624513
|
{
"license": [
"Apache 2 License - https://www.apache.org/licenses/LICENSE-2.0",
"BSD 2-Clause",
"BSD 3-Clause",
"MIT License",
"MIT License"
],
"license_url": "https://opensource.org/licenses/MIT",
"language": [
"English",
"LLVM"
],
"url": "https://github.com/bigcode-project/octopack",
"dataset_id": "commitpackft-llvm",
"response": ""
}
|
commitpackft-llvm-224
|
declare i8* @malloc(i64)
declare void @free(i8*)
declare i64 @write(i32, i8*, i64)
declare i32 @asprintf(i8**, i8*, ...)
declare void @llvm.memcpy.p0i8.p0i8.i64(i8*, i8*, i64, i32, i1)
%IBool = type { i64 (i8*, i1*)* }
%IBool.wrap = type { %IBool*, i8* }
%str = type { i1, i64, i8* }
%IStr = type { i64 (i8*, %str*)* }
%IStr.wrap = type { %IStr*, i8* }
define i8* @lang.malloc(i64 %sz) alwaysinline {
%1 = call i8* @malloc(i64 %sz)
ret i8* %1
}
define void @lang.free(i8* %ptr) alwaysinline {
call void @free(i8* %ptr)
ret void
}
Add some stuff to help debugging memory issues.
declare i8* @malloc(i64)
declare void @free(i8*)
declare i64 @write(i32, i8*, i64)
declare i32 @asprintf(i8**, i8*, ...)
declare i32 @printf(i8*, ...)
declare void @llvm.memcpy.p0i8.p0i8.i64(i8*, i8*, i64, i32, i1)
%IBool = type { i64 (i8*, i1*)* }
%IBool.wrap = type { %IBool*, i8* }
%str = type { i1, i64, i8* }
%IStr = type { i64 (i8*, %str*)* }
%IStr.wrap = type { %IStr*, i8* }
@fmt_MALLOC = constant [15 x i8] c"malloc(%ld) %p\0a"
@fmt_FREE = constant [9 x i8] c"free(%p)\0a"
define i8* @lang.malloc(i64 %sz) alwaysinline {
%ptr = call i8* @malloc(i64 %sz)
; %fmt = getelementptr inbounds [15 x i8]* @fmt_MALLOC, i32 0, i32 0
; call i32 (i8*, ...)* @printf(i8* %fmt, i64 %sz, i8* %ptr)
ret i8* %ptr
}
define void @lang.free(i8* %ptr) alwaysinline {
; %fmt = getelementptr inbounds [9 x i8]* @fmt_FREE, i32 0, i32 0
; call i32 (i8*, ...)* @printf(i8* %fmt, i8* %ptr)
call void @free(i8* %ptr)
ret void
}
|
Data Provenance Initiative
|
2025-04-01T17:48:26.624517
|
{
"license": [
"Apache 2 License - https://www.apache.org/licenses/LICENSE-2.0",
"BSD 2-Clause",
"BSD 3-Clause",
"MIT License",
"MIT License"
],
"license_url": "https://opensource.org/licenses/MIT",
"language": [
"English",
"LLVM"
],
"url": "https://github.com/bigcode-project/octopack",
"dataset_id": "commitpackft-llvm",
"response": ""
}
|
commitpackft-llvm-225
|
; RUN: llc < %s -mtriple=x86_64-linux -march=x86 | FileCheck %s
define void @t(<2 x i64>* %dst, <2 x i64> %src1, <2 x i64> %src2) nounwind readonly {
; CHECK: pandn
%cmp1 = icmp ne <2 x i64> %src1, zeroinitializer
%cmp2 = icmp ne <2 x i64> %src2, zeroinitializer
%t1 = and <2 x i1> %cmp1, %cmp2
%t2 = sext <2 x i1> %t1 to <2 x i64>
store <2 x i64> %t2, <2 x i64>* %dst
ret void
}
define void @t2(<3 x i64>* %dst, <3 x i64> %src1, <3 x i64> %src2) nounwind readonly {
; CHECK-NOT: pandn
%cmp1 = icmp ne <3 x i64> %src1, zeroinitializer
%cmp2 = icmp ne <3 x i64> %src2, zeroinitializer
%t1 = and <3 x i1> %cmp1, %cmp2
%t2 = sext <3 x i1> %t1 to <3 x i64>
store <3 x i64> %t2, <3 x i64>* %dst
ret void
}
Clean the triple, add check lines.
; RUN: llc < %s -mtriple=x86_64-linux | FileCheck %s
define void @t0(<2 x i64>* %dst, <2 x i64> %src1, <2 x i64> %src2) nounwind readonly {
; CHECK: t0
; CHECK: pand
; CHECK: ret
%cmp1 = icmp ne <2 x i64> %src1, zeroinitializer
%cmp2 = icmp ne <2 x i64> %src2, zeroinitializer
%t1 = and <2 x i1> %cmp1, %cmp2
%t2 = sext <2 x i1> %t1 to <2 x i64>
store <2 x i64> %t2, <2 x i64>* %dst
ret void
}
define void @t2(<3 x i64>* %dst, <3 x i64> %src1, <3 x i64> %src2) nounwind readonly {
; CHECK: t2
; CHECK-NOT: pand
; CHECK: ret
%cmp1 = icmp ne <3 x i64> %src1, zeroinitializer
%cmp2 = icmp ne <3 x i64> %src2, zeroinitializer
%t1 = and <3 x i1> %cmp1, %cmp2
%t2 = sext <3 x i1> %t1 to <3 x i64>
store <3 x i64> %t2, <3 x i64>* %dst
ret void
}
|
Data Provenance Initiative
|
2025-04-01T17:48:26.624521
|
{
"license": [
"Apache 2 License - https://www.apache.org/licenses/LICENSE-2.0",
"BSD 2-Clause",
"BSD 3-Clause",
"MIT License",
"MIT License"
],
"license_url": "https://opensource.org/licenses/MIT",
"language": [
"English",
"LLVM"
],
"url": "https://github.com/bigcode-project/octopack",
"dataset_id": "commitpackft-llvm",
"response": ""
}
|
commitpackft-llvm-226
|
; Test combined function index generation for ThinLTO via llvm-lto.
; RUN: llvm-as -function-summary %s -o %t.o
; RUN: llvm-as -function-summary %p/Inputs/thinlto.ll -o %t2.o
; RUN: llvm-lto -thinlto -o %t3 %t.o %t2.o
; RUN: llvm-bcanalyzer -dump %t3.thinlto.bc | FileCheck %s --check-prefix=COMBINED
; RUN: not test -e %t3
; COMBINED: <MODULE_STRTAB_BLOCK
; COMBINED-NEXT: <ENTRY {{.*}} record string = '{{.*}}/thinlto.ll.tmp{{.*}}.o'
; COMBINED-NEXT: <ENTRY {{.*}} record string = '{{.*}}/thinlto.ll.tmp{{.*}}.o'
; COMBINED-NEXT: </MODULE_STRTAB_BLOCK
; COMBINED-NEXT: <FUNCTION_SUMMARY_BLOCK
; COMBINED-NEXT: <COMBINED_ENTRY
; COMBINED-NEXT: <COMBINED_ENTRY
; COMBINED-NEXT: </FUNCTION_SUMMARY_BLOCK
; COMBINED-NEXT: <VALUE_SYMTAB
; COMBINED-NEXT: <COMBINED_FNENTRY {{.*}} record string = '{{f|g}}'
; COMBINED-NEXT: <COMBINED_FNENTRY {{.*}} record string = '{{f|g}}'
; COMBINED-NEXT: </VALUE_SYMTAB
define void @f() {
entry:
ret void
}
Fix windows bot failures from r250699 by removing "/" from expected path in test output.
; Test combined function index generation for ThinLTO via llvm-lto.
; RUN: llvm-as -function-summary %s -o %t.o
; RUN: llvm-as -function-summary %p/Inputs/thinlto.ll -o %t2.o
; RUN: llvm-lto -thinlto -o %t3 %t.o %t2.o
; RUN: llvm-bcanalyzer -dump %t3.thinlto.bc | FileCheck %s --check-prefix=COMBINED
; RUN: not test -e %t3
; COMBINED: <MODULE_STRTAB_BLOCK
; COMBINED-NEXT: <ENTRY {{.*}} record string = '{{.*}}thinlto.ll.tmp{{.*}}.o'
; COMBINED-NEXT: <ENTRY {{.*}} record string = '{{.*}}thinlto.ll.tmp{{.*}}.o'
; COMBINED-NEXT: </MODULE_STRTAB_BLOCK
; COMBINED-NEXT: <FUNCTION_SUMMARY_BLOCK
; COMBINED-NEXT: <COMBINED_ENTRY
; COMBINED-NEXT: <COMBINED_ENTRY
; COMBINED-NEXT: </FUNCTION_SUMMARY_BLOCK
; COMBINED-NEXT: <VALUE_SYMTAB
; COMBINED-NEXT: <COMBINED_FNENTRY {{.*}} record string = '{{f|g}}'
; COMBINED-NEXT: <COMBINED_FNENTRY {{.*}} record string = '{{f|g}}'
; COMBINED-NEXT: </VALUE_SYMTAB
define void @f() {
entry:
ret void
}
|
Data Provenance Initiative
|
2025-04-01T17:48:26.624525
|
{
"license": [
"Apache 2 License - https://www.apache.org/licenses/LICENSE-2.0",
"BSD 2-Clause",
"BSD 3-Clause",
"MIT License",
"MIT License"
],
"license_url": "https://opensource.org/licenses/MIT",
"language": [
"English",
"LLVM"
],
"url": "https://github.com/bigcode-project/octopack",
"dataset_id": "commitpackft-llvm",
"response": ""
}
|
commitpackft-llvm-227
|
; RUN: llvm-as < %s | llc -march=x86 | grep {movsbl .al, .eax}
@X = global i32 0 ; <i32*> [#uses=1]
define i8 @_Z3fooi(i32 %x) signext {
entry:
store i32 %x, i32* @X, align 4
%retval67 = trunc i32 %x to i8 ; <i8> [#uses=1]
ret i8 %retval67
}
Fix test so it passes.
; RUN: llvm-as < %s | llc -march=x86 | grep {movsbl}
@X = global i32 0 ; <i32*> [#uses=1]
define i8 @_Z3fooi(i32 %x) signext {
entry:
store i32 %x, i32* @X, align 4
%retval67 = trunc i32 %x to i8 ; <i8> [#uses=1]
ret i8 %retval67
}
|
Data Provenance Initiative
|
2025-04-01T17:48:26.624528
|
{
"license": [
"Apache 2 License - https://www.apache.org/licenses/LICENSE-2.0",
"BSD 2-Clause",
"BSD 3-Clause",
"MIT License",
"MIT License"
],
"license_url": "https://opensource.org/licenses/MIT",
"language": [
"English",
"LLVM"
],
"url": "https://github.com/bigcode-project/octopack",
"dataset_id": "commitpackft-llvm",
"response": ""
}
|
commitpackft-llvm-228
|
; RUN: llc -march=mips < %s | FileCheck %s
@p = external global i32
@q = external global i32
@r = external global i32
define void @f0() nounwind {
entry:
; CHECK: jalr
; CHECK-NOT: got({{.*}})($gp)
; CHECK: lw $gp
; CHECK: jalr
; CHECK-NOT: got({{.*}})($gp)
; CHECK: lw $gp
; CHECK: jalr
; CHECK-NOT: got({{.*}})($gp)
; CHECK: lw $gp
tail call void (...)* @f1() nounwind
%tmp = load i32* @p, align 4, !tbaa !0
tail call void @f2(i32 %tmp) nounwind
%tmp1 = load i32* @q, align 4, !tbaa !0
%tmp2 = load i32* @r, align 4, !tbaa !0
tail call void @f3(i32 %tmp1, i32 %tmp2) nounwind
ret void
}
declare void @f1(...)
declare void @f2(i32)
declare void @f3(i32, i32)
!0 = metadata !{metadata !"int", metadata !1}
!1 = metadata !{metadata !"omnipotent char", metadata !2}
!2 = metadata !{metadata !"Simple C/C++ TBAA", null}
Remove LLVM IR metadata in test case committed in r130847.
; RUN: llc -march=mips < %s | FileCheck %s
@p = external global i32
@q = external global i32
@r = external global i32
define void @f0() nounwind {
entry:
; CHECK: jalr
; CHECK-NOT: got({{.*}})($gp)
; CHECK: lw $gp
; CHECK: jalr
; CHECK-NOT: got({{.*}})($gp)
; CHECK: lw $gp
; CHECK: jalr
; CHECK-NOT: got({{.*}})($gp)
; CHECK: lw $gp
tail call void (...)* @f1() nounwind
%tmp = load i32* @p, align 4
tail call void @f2(i32 %tmp) nounwind
%tmp1 = load i32* @q, align 4
%tmp2 = load i32* @r, align 4
tail call void @f3(i32 %tmp1, i32 %tmp2) nounwind
ret void
}
declare void @f1(...)
declare void @f2(i32)
declare void @f3(i32, i32)
|
Data Provenance Initiative
|
2025-04-01T17:48:26.624532
|
{
"license": [
"Apache 2 License - https://www.apache.org/licenses/LICENSE-2.0",
"BSD 2-Clause",
"BSD 3-Clause",
"MIT License",
"MIT License"
],
"license_url": "https://opensource.org/licenses/MIT",
"language": [
"English",
"LLVM"
],
"url": "https://github.com/bigcode-project/octopack",
"dataset_id": "commitpackft-llvm",
"response": ""
}
|
commitpackft-llvm-229
|
; RUN: %lli -code-model=small %s > /dev/null
; XFAIL: mips
;
; FIXME: Merge this file with non-extern-addend.ll once AArch64 supports PC-rel
; relocations in ELF. (The code is identical, only the run line differs).
;
define i32 @foo(i32 %x, i32 %y, double %d) {
entry:
%d.int64 = bitcast double %d to i64
%d.top64 = lshr i64 %d.int64, 32
%d.top = trunc i64 %d.top64 to i32
%d.bottom = trunc i64 %d.int64 to i32
%topCorrect = icmp eq i32 %d.top, 3735928559
%bottomCorrect = icmp eq i32 %d.bottom, 4277009102
%right = and i1 %topCorrect, %bottomCorrect
%nRight = xor i1 %right, true
%retVal = zext i1 %nRight to i32
ret i32 %retVal
}
define i32 @main() {
entry:
%call = call i32 @foo(i32 0, i32 1, double 0xDEADBEEFFEEDFACE)
ret i32 %call
}
Mark as explicit failing on x86-64 -- small memory model doesn't agree with default address selections.
; RUN: %lli -code-model=small %s > /dev/null
; XFAIL: mips
; XFAIL: x86_64
;
; FIXME: Merge this file with non-extern-addend.ll once AArch64 supports PC-rel
; relocations in ELF. (The code is identical, only the run line differs).
;
define i32 @foo(i32 %x, i32 %y, double %d) {
entry:
%d.int64 = bitcast double %d to i64
%d.top64 = lshr i64 %d.int64, 32
%d.top = trunc i64 %d.top64 to i32
%d.bottom = trunc i64 %d.int64 to i32
%topCorrect = icmp eq i32 %d.top, 3735928559
%bottomCorrect = icmp eq i32 %d.bottom, 4277009102
%right = and i1 %topCorrect, %bottomCorrect
%nRight = xor i1 %right, true
%retVal = zext i1 %nRight to i32
ret i32 %retVal
}
define i32 @main() {
entry:
%call = call i32 @foo(i32 0, i32 1, double 0xDEADBEEFFEEDFACE)
ret i32 %call
}
|
Data Provenance Initiative
|
2025-04-01T17:48:26.624536
|
{
"license": [
"Apache 2 License - https://www.apache.org/licenses/LICENSE-2.0",
"BSD 2-Clause",
"BSD 3-Clause",
"MIT License",
"MIT License"
],
"license_url": "https://opensource.org/licenses/MIT",
"language": [
"English",
"LLVM"
],
"url": "https://github.com/bigcode-project/octopack",
"dataset_id": "commitpackft-llvm",
"response": ""
}
|
commitpackft-llvm-230
|
; @f and @g are lazily linked. @f requires @g - ensure @g is correctly linked.
; RUN: echo -e "declare i32 @f(i32)\ndefine i32 @h(i32 %x) {\n%1 = call i32 @f(i32 %x)\nret i32 %1\n}" | llvm-as >%t.1.bc
; RUN: llvm-as < %s > %t.2.bc
; RUN: llvm-link %t.1.bc %t.2.bc
define available_externally i32 @f(i32 %x) {
%1 = call i32 @g(i32 %x)
ret i32 %1
}
define available_externally i32 @g(i32 %x) {
ret i32 5
}
Use multiple statements instead of 'echo -e', which is not part of BSD echo.
; @f and @g are lazily linked. @f requires @g - ensure @g is correctly linked.
; RUN: echo "declare i32 @f(i32)" > %t.1.ll
; RUN: echo "define i32 @h(i32 %x) {" >> %t.1.ll
; RUN: echo " %1 = call i32 @f(i32 %x)" >> %t.1.ll
; RUN: echo " ret i32 %1" >> %t.1.ll
; RUN: echo "}" >> %t.1.ll
; RUN: llvm-as < %t.1.ll > %t.1.bc
; RUN: llvm-as < %s > %t.2.bc
; RUN: llvm-link %t.1.bc %t.2.bc
define available_externally i32 @f(i32 %x) {
%1 = call i32 @g(i32 %x)
ret i32 %1
}
define available_externally i32 @g(i32 %x) {
ret i32 5
}
|
Data Provenance Initiative
|
2025-04-01T17:48:26.624540
|
{
"license": [
"Apache 2 License - https://www.apache.org/licenses/LICENSE-2.0",
"BSD 2-Clause",
"BSD 3-Clause",
"MIT License",
"MIT License"
],
"license_url": "https://opensource.org/licenses/MIT",
"language": [
"English",
"LLVM"
],
"url": "https://github.com/bigcode-project/octopack",
"dataset_id": "commitpackft-llvm",
"response": ""
}
|
commitpackft-llvm-231
|
; RUN: llvm-as %s | lli
; PR672
int %main(){
%f = cast int (int, int*, int)* %check_tail to int*
%res = tail call fastcc int %check_tail( int 10, int* %f,int 10)
ret int %res
}
fastcc int %check_tail(int %x, int* %f, int %g) {
%tmp1 = setgt int %x, 0
br bool %tmp1, label %if-then, label %if-else
if-then:
%fun_ptr = cast int* %f to int(int, int*, int)*
%arg1 = add int %x, -1
%res = tail call fastcc int %fun_ptr( int %arg1, int * %f, int %g)
ret int %res
if-else:
ret int %x
}
Fix a bug in the testcase
; RUN: llvm-as < %s | lli
; PR672
int %main(){
%f = cast int (int, int*, int)* %check_tail to int*
%res = tail call fastcc int %check_tail( int 10, int* %f,int 10)
ret int %res
}
fastcc int %check_tail(int %x, int* %f, int %g) {
%tmp1 = setgt int %x, 0
br bool %tmp1, label %if-then, label %if-else
if-then:
%fun_ptr = cast int* %f to int(int, int*, int)*
%arg1 = add int %x, -1
%res = tail call fastcc int %fun_ptr( int %arg1, int * %f, int %g)
ret int %res
if-else:
ret int %x
}
|
Data Provenance Initiative
|
2025-04-01T17:48:26.624544
|
{
"license": [
"Apache 2 License - https://www.apache.org/licenses/LICENSE-2.0",
"BSD 2-Clause",
"BSD 3-Clause",
"MIT License",
"MIT License"
],
"license_url": "https://opensource.org/licenses/MIT",
"language": [
"English",
"LLVM"
],
"url": "https://github.com/bigcode-project/octopack",
"dataset_id": "commitpackft-llvm",
"response": ""
}
|
commitpackft-llvm-232
|
; PR28103
; Bail out if the two successors are not the header
; and another bb outside of the loop. This case is not
; properly handled by LoopUnroll, currently.
; RUN: opt -loop-unroll -verify-dom-info %s
; REQUIRE: asserts
define void @tinkywinky(i1 %patatino) {
entry:
br label %header1
header1:
%indvars.iv = phi i64 [ 1, %body2 ], [ 0, %entry ]
%exitcond = icmp ne i64 %indvars.iv, 1
br i1 %exitcond, label %body1, label %exit
body1:
br i1 %patatino, label %body2, label %sink
body2:
br i1 %patatino, label %header1, label %body3
body3:
br label %sink
sink:
br label %body2
exit:
ret void
}
Fix a test. REQUIRE should be REQUIRES.
; PR28103
; Bail out if the two successors are not the header
; and another bb outside of the loop. This case is not
; properly handled by LoopUnroll, currently.
; RUN: opt -loop-unroll -verify-dom-info %s
; REQUIRES: asserts
define void @tinkywinky(i1 %patatino) {
entry:
br label %header1
header1:
%indvars.iv = phi i64 [ 1, %body2 ], [ 0, %entry ]
%exitcond = icmp ne i64 %indvars.iv, 1
br i1 %exitcond, label %body1, label %exit
body1:
br i1 %patatino, label %body2, label %sink
body2:
br i1 %patatino, label %header1, label %body3
body3:
br label %sink
sink:
br label %body2
exit:
ret void
}
|
Data Provenance Initiative
|
2025-04-01T17:48:26.624547
|
{
"license": [
"Apache 2 License - https://www.apache.org/licenses/LICENSE-2.0",
"BSD 2-Clause",
"BSD 3-Clause",
"MIT License",
"MIT License"
],
"license_url": "https://opensource.org/licenses/MIT",
"language": [
"English",
"LLVM"
],
"url": "https://github.com/bigcode-project/octopack",
"dataset_id": "commitpackft-llvm",
"response": ""
}
|
commitpackft-llvm-233
|
; The loop canonicalization pass should guarantee that there is one backedge
; for all loops. This allows the -indvars pass to recognize the %IV
; induction variable in this testcase.
; RUN: opt < %s -indvars -S | grep indvar
define i32 @test(i1 %C) {
; <label>:0
br label %Loop
Loop: ; preds = %BE2, %BE1, %0
%IV = phi i32 [ 1, %0 ], [ %IV2, %BE1 ], [ %IV2, %BE2 ] ; <i32> [#uses=2]
store i32 %IV, i32* null
%IV2 = add i32 %IV, 2 ; <i32> [#uses=2]
br i1 %C, label %BE1, label %BE2
BE1: ; preds = %Loop
br label %Loop
BE2: ; preds = %Loop
br label %Loop
}
Generalize test case to handle multiple indvars modes.
; The loop canonicalization pass should guarantee that there is one backedge
; for all loops. This allows the -indvars pass to recognize the %IV
; induction variable in this testcase.
; RUN: opt < %s -indvars -S | FileCheck %s
; CHECK: Loop.backedge:
; CHECK-NOT: br
; CHECK: br label %Loop
define i32 @test(i1 %C) {
; <label>:0
br label %Loop
Loop: ; preds = %BE2, %BE1, %0
%IV = phi i32 [ 1, %0 ], [ %IV2, %BE1 ], [ %IV2, %BE2 ] ; <i32> [#uses=2]
store i32 %IV, i32* null
%IV2 = add i32 %IV, 2 ; <i32> [#uses=2]
br i1 %C, label %BE1, label %BE2
BE1: ; preds = %Loop
br label %Loop
BE2: ; preds = %Loop
br label %Loop
}
|
Data Provenance Initiative
|
2025-04-01T17:48:26.624552
|
{
"license": [
"Apache 2 License - https://www.apache.org/licenses/LICENSE-2.0",
"BSD 2-Clause",
"BSD 3-Clause",
"MIT License",
"MIT License"
],
"license_url": "https://opensource.org/licenses/MIT",
"language": [
"English",
"LLVM"
],
"url": "https://github.com/bigcode-project/octopack",
"dataset_id": "commitpackft-llvm",
"response": ""
}
|
commitpackft-llvm-234
|
; RUN: llc < %s -march=x86-64 -tailcallopt -fast-isel -fast-isel-abort | FileCheck %s
%0 = type { i64, i32, i8* }
define fastcc i8* @"visit_array_aux<`Reference>"(%0 %arg, i32 %arg1) nounwind {
fail: ; preds = %entry
%tmp20 = tail call fastcc i8* @"visit_array_aux<`Reference>"(%0 %arg, i32 undef) ; <i8*> [#uses=1]
; CHECK: jmp "_visit_array_aux<`Reference>" ## TAILCALL
ret i8* %tmp20
}
define i32 @foo() nounwind {
entry:
%0 = tail call i32 (...)* @bar() nounwind ; <i32> [#uses=1]
ret i32 %0
}
declare i32 @bar(...) nounwind
Add a triple to this test.
; RUN: llc < %s -mtriple=x86_64-apple-darwin -tailcallopt -fast-isel -fast-isel-abort | FileCheck %s
%0 = type { i64, i32, i8* }
define fastcc i8* @"visit_array_aux<`Reference>"(%0 %arg, i32 %arg1) nounwind {
fail: ; preds = %entry
%tmp20 = tail call fastcc i8* @"visit_array_aux<`Reference>"(%0 %arg, i32 undef) ; <i8*> [#uses=1]
; CHECK: jmp "_visit_array_aux<`Reference>" ## TAILCALL
ret i8* %tmp20
}
define i32 @foo() nounwind {
entry:
%0 = tail call i32 (...)* @bar() nounwind ; <i32> [#uses=1]
ret i32 %0
}
declare i32 @bar(...) nounwind
|
Data Provenance Initiative
|
2025-04-01T17:48:26.624556
|
{
"license": [
"Apache 2 License - https://www.apache.org/licenses/LICENSE-2.0",
"BSD 2-Clause",
"BSD 3-Clause",
"MIT License",
"MIT License"
],
"license_url": "https://opensource.org/licenses/MIT",
"language": [
"English",
"LLVM"
],
"url": "https://github.com/bigcode-project/octopack",
"dataset_id": "commitpackft-llvm",
"response": ""
}
|
commitpackft-llvm-235
|
; RUN: llc -mtriple=armeb-linux-gnueabihf -O2 -mattr=+read-tp-hard %s -o - | FileCheck %s -check-prefix=CHECK-HARD
; RUN: llc -mtriple=armeb-linux-gnueabihf -O2 %s -o - | FileCheck %s -check-prefix=CHECK-SOFT
; __thread int counter;
; void foo() {
; counter = 5;
; }
@counter = thread_local local_unnamed_addr global i32 0, align 4
define void @foo() local_unnamed_addr #0 {
entry:
store i32 5, i32* @counter, align 4
ret void
}
; CHECK-LABEL: foo:
; CHECK-HARD: mrc p15, #0, {{r[0-9]+}}, c13, c0, #3
; CHECK-SOFT: bl __aeabi_read_tp
Add newline to end of test file. NFC.
; RUN: llc -mtriple=armeb-linux-gnueabihf -O2 -mattr=+read-tp-hard %s -o - | FileCheck %s -check-prefix=CHECK-HARD
; RUN: llc -mtriple=armeb-linux-gnueabihf -O2 %s -o - | FileCheck %s -check-prefix=CHECK-SOFT
; __thread int counter;
; void foo() {
; counter = 5;
; }
@counter = thread_local local_unnamed_addr global i32 0, align 4
define void @foo() local_unnamed_addr #0 {
entry:
store i32 5, i32* @counter, align 4
ret void
}
; CHECK-LABEL: foo:
; CHECK-HARD: mrc p15, #0, {{r[0-9]+}}, c13, c0, #3
; CHECK-SOFT: bl __aeabi_read_tp
|
Data Provenance Initiative
|
2025-04-01T17:48:26.624560
|
{
"license": [
"Apache 2 License - https://www.apache.org/licenses/LICENSE-2.0",
"BSD 2-Clause",
"BSD 3-Clause",
"MIT License",
"MIT License"
],
"license_url": "https://opensource.org/licenses/MIT",
"language": [
"English",
"LLVM"
],
"url": "https://github.com/bigcode-project/octopack",
"dataset_id": "commitpackft-llvm",
"response": ""
}
|
commitpackft-llvm-236
|
; RUN: llc < %s -relocation-model=pic -disable-cfi -mtriple=x86_64-pc-solaris2.11 -disable-cgp-branch-opts | FileCheck %s -check-prefix=X64
; RUN: llc < %s -relocation-model=pic -disable-cfi -mtriple=i386-pc-solaris2.11 -disable-cgp-branch-opts | FileCheck %s -check-prefix=X32
; PR1632
define void @_Z1fv() {
entry:
invoke void @_Z1gv()
to label %return unwind label %unwind
unwind: ; preds = %entry
%exn = landingpad {i8*, i32} personality i32 (...)* @__gxx_personality_v0
cleanup
ret void
return: ; preds = %eh_then, %entry
ret void
}
declare void @_Z1gv()
declare i32 @__gxx_personality_v0(...)
; X64: .size DW.ref.__gxx_personality_v0, 8
; X64: .quad __gxx_personality_v0
; X32: .size DW.ref.__gxx_personality_v0, 4
; X32: .long __gxx_personality_v0
Remove unused options from test.
; RUN: llc < %s -relocation-model=pic -mtriple=x86_64-pc-solaris2.11 | FileCheck %s -check-prefix=X64
; RUN: llc < %s -relocation-model=pic -mtriple=i386-pc-solaris2.11 | FileCheck %s -check-prefix=X32
; PR1632
define void @_Z1fv() {
entry:
invoke void @_Z1gv()
to label %return unwind label %unwind
unwind: ; preds = %entry
%exn = landingpad {i8*, i32} personality i32 (...)* @__gxx_personality_v0
cleanup
ret void
return: ; preds = %eh_then, %entry
ret void
}
declare void @_Z1gv()
declare i32 @__gxx_personality_v0(...)
; X64: .size DW.ref.__gxx_personality_v0, 8
; X64: .quad __gxx_personality_v0
; X32: .size DW.ref.__gxx_personality_v0, 4
; X32: .long __gxx_personality_v0
|
Data Provenance Initiative
|
2025-04-01T17:48:26.624564
|
{
"license": [
"Apache 2 License - https://www.apache.org/licenses/LICENSE-2.0",
"BSD 2-Clause",
"BSD 3-Clause",
"MIT License",
"MIT License"
],
"license_url": "https://opensource.org/licenses/MIT",
"language": [
"English",
"LLVM"
],
"url": "https://github.com/bigcode-project/octopack",
"dataset_id": "commitpackft-llvm",
"response": ""
}
|
commitpackft-llvm-237
|
target datalayout = "e-m:e-i64:64-f80:128-n8:16:32:64-S128"
; RUN: opt < %s -S -loop-vectorize -debug-only=loop-vectorize 2>&1 | FileCheck %s
; CHECK: LV: Can't vectorize due to memory conflicts
define void @test_loop_novect(double** %arr, i64 %n) {
for.body.lr.ph:
%t = load double** %arr, align 8
br label %for.body
for.body: ; preds = %for.body, %for.body.lr.ph
%i = phi i64 [ 0, %for.body.lr.ph ], [ %i.next, %for.body ]
%a = getelementptr inbounds double* %t, i64 %i
%i.next = add nuw nsw i64 %i, 1
%a.next = getelementptr inbounds double* %t, i64 %i.next
%t1 = load double* %a, align 8
%t2 = load double* %a.next, align 8
store double %t1, double* %a.next, align 8
store double %t2, double* %a, align 8
%c = icmp eq i64 %i, %n
br i1 %c, label %final, label %for.body
final: ; preds = %for.body
ret void
}
Fix broken test from r225159.
target datalayout = "e-m:e-i64:64-f80:128-n8:16:32:64-S128"
; RUN: opt < %s -S -loop-vectorize -debug-only=loop-vectorize 2>&1 | FileCheck %s
; REQUIRES: asserts
; CHECK: LV: Can't vectorize due to memory conflicts
define void @test_loop_novect(double** %arr, i64 %n) {
for.body.lr.ph:
%t = load double** %arr, align 8
br label %for.body
for.body: ; preds = %for.body, %for.body.lr.ph
%i = phi i64 [ 0, %for.body.lr.ph ], [ %i.next, %for.body ]
%a = getelementptr inbounds double* %t, i64 %i
%i.next = add nuw nsw i64 %i, 1
%a.next = getelementptr inbounds double* %t, i64 %i.next
%t1 = load double* %a, align 8
%t2 = load double* %a.next, align 8
store double %t1, double* %a.next, align 8
store double %t2, double* %a, align 8
%c = icmp eq i64 %i, %n
br i1 %c, label %final, label %for.body
final: ; preds = %for.body
ret void
}
|
Data Provenance Initiative
|
2025-04-01T17:48:26.624568
|
{
"license": [
"Apache 2 License - https://www.apache.org/licenses/LICENSE-2.0",
"BSD 2-Clause",
"BSD 3-Clause",
"MIT License",
"MIT License"
],
"license_url": "https://opensource.org/licenses/MIT",
"language": [
"English",
"LLVM"
],
"url": "https://github.com/bigcode-project/octopack",
"dataset_id": "commitpackft-llvm",
"response": ""
}
|
commitpackft-llvm-238
|
; RUN: llc -march=mips < %s | FileCheck %s
; Check for the emission of appropriate assembler directives before and
; after the inline assembly code.
define void @f() nounwind {
entry:
; CHECK: #APP
; CHECK-NEXT: .set push
; CHECK-NEXT: .set at
; CHECK-NEXT: .set macro
; CHECK-NEXT: .set reorder
; CHECK: addi $9, ${{[2-9][0-9]?}}, 8
; CHECK: subi ${{[2-9][0-9]?}}, $9, 6
; CHECK: .set pop
; CHECK-NEXT: #NO_APP
%a = alloca i32, align 4
%b = alloca i32, align 4
store i32 20, i32* %a, align 4
%0 = load i32, i32* %a, align 4
%1 = call i32 asm sideeffect "addi $$9, $1, 8\0A\09subi $0, $$9, 6", "=r,r,~{$1}"(i32 %0)
store i32 %1, i32* %b, align 4
ret void
}
Replace invalid assembly insn in test since IAS parses inline assembly.
; RUN: llc -march=mips < %s | FileCheck %s
; Check for the emission of appropriate assembler directives before and
; after the inline assembly code.
define void @f() nounwind {
entry:
; CHECK: #APP
; CHECK-NEXT: .set push
; CHECK-NEXT: .set at
; CHECK-NEXT: .set macro
; CHECK-NEXT: .set reorder
; CHECK: addi $9, ${{[2-9][0-9]?}}, 8
; CHECK: ori ${{[2-9][0-9]?}}, $9, 6
; CHECK: .set pop
; CHECK-NEXT: #NO_APP
%a = alloca i32, align 4
%b = alloca i32, align 4
store i32 20, i32* %a, align 4
%0 = load i32, i32* %a, align 4
%1 = call i32 asm sideeffect "addi $$9, $1, 8\0A\09ori $0, $$9, 6", "=r,r,~{$1}"(i32 %0)
store i32 %1, i32* %b, align 4
ret void
}
|
Data Provenance Initiative
|
2025-04-01T17:48:26.624572
|
{
"license": [
"Apache 2 License - https://www.apache.org/licenses/LICENSE-2.0",
"BSD 2-Clause",
"BSD 3-Clause",
"MIT License",
"MIT License"
],
"license_url": "https://opensource.org/licenses/MIT",
"language": [
"English",
"LLVM"
],
"url": "https://github.com/bigcode-project/octopack",
"dataset_id": "commitpackft-llvm",
"response": ""
}
|
commitpackft-llvm-239
|
; RUN: llc < %s -march=x86 | grep weak | count 2
@__gthrw_pthread_once = alias weak i32 (i32*, void ()*)* @pthread_once ; <i32 (i32*, void ()*)*> [#uses=0]
define weak i32 @pthread_once(i32*, void ()*) {
ret i32 0
}
Add a triple and switch test to FileCheck.
; RUN: llc < %s -mtriple=i686-pc-linux-gnu | FileCheck %s
@__gthrw_pthread_once = alias weak i32 (i32*, void ()*)* @pthread_once ; <i32 (i32*, void ()*)*> [#uses=0]
define weak i32 @pthread_once(i32*, void ()*) {
ret i32 0
}
; CHECK: .weak pthread_once
; CHECK: pthread_once:
; CHECK: .weak __gthrw_pthread_once
; CHECK: __gthrw_pthread_once = pthread_once
|
Data Provenance Initiative
|
2025-04-01T17:48:26.624576
|
{
"license": [
"Apache 2 License - https://www.apache.org/licenses/LICENSE-2.0",
"BSD 2-Clause",
"BSD 3-Clause",
"MIT License",
"MIT License"
],
"license_url": "https://opensource.org/licenses/MIT",
"language": [
"English",
"LLVM"
],
"url": "https://github.com/bigcode-project/octopack",
"dataset_id": "commitpackft-llvm",
"response": ""
}
|
commitpackft-llvm-240
|
; RUN: llvm-as < %s | opt -indvars | llvm-dis | %prcontext Loop: 1 | grep %indvar
; The indvar simplification code should ensure that the first PHI in the block
; is the canonical one!
define i32 @test() {
; <label>:0
br label %Loop
Loop: ; preds = %Loop, %0
%NonIndvar = phi i32 [ 200, %0 ], [ %NonIndvarNext, %Loop ] ; <i32> [#uses=1]
%Canonical = phi i32 [ 0, %0 ], [ %CanonicalNext, %Loop ] ; <i32> [#uses=1]
%NonIndvarNext = sdiv i32 %NonIndvar, 2 ; <i32> [#uses=1]
%CanonicalNext = add i32 %Canonical, 1 ; <i32> [#uses=1]
br label %Loop
}
Make this testcase slightly less trivial, so that it doesn't fail if indvars happens to optimize away the unused primary induction variable.
; RUN: llvm-as < %s | opt -indvars | llvm-dis | %prcontext Loop: 1 | grep %indvar
; The indvar simplification code should ensure that the first PHI in the block
; is the canonical one!
define i32 @test() {
; <label>:0
br label %Loop
Loop: ; preds = %Loop, %0
%NonIndvar = phi i32 [ 200, %0 ], [ %NonIndvarNext, %Loop ] ; <i32> [#uses=1]
%Canonical = phi i32 [ 0, %0 ], [ %CanonicalNext, %Loop ] ; <i32> [#uses=2]
store i32 %Canonical, i32* null
%NonIndvarNext = sdiv i32 %NonIndvar, 2 ; <i32> [#uses=1]
%CanonicalNext = add i32 %Canonical, 1 ; <i32> [#uses=1]
br label %Loop
}
|
Data Provenance Initiative
|
2025-04-01T17:48:26.624580
|
{
"license": [
"Apache 2 License - https://www.apache.org/licenses/LICENSE-2.0",
"BSD 2-Clause",
"BSD 3-Clause",
"MIT License",
"MIT License"
],
"license_url": "https://opensource.org/licenses/MIT",
"language": [
"English",
"LLVM"
],
"url": "https://github.com/bigcode-project/octopack",
"dataset_id": "commitpackft-llvm",
"response": ""
}
|
commitpackft-llvm-241
|
; Test linking of a bc file to an archive via llvm-ld.
; PR1434
; RUN: rm %t.bar.a %t.foo.a
; RUN: llvm-as %s -o %t.bar.bc
; RUN: echo {define i32* @foo(i32 %x) \{ ret i32* @baz \} \
; RUN: @baz = external global i32 } | llvm-as -o %t.foo.bc
; RUN: llvm-ar rcf %t.foo.a %t.foo.bc
; RUN: llvm-ar rcf %t.bar.a %t.bar.bc
; RUN: llvm-ld -disable-opt %t.bar.bc %t.foo.a -o %t.bc
; RUN: llvm-ld -disable-opt %t.foo.bc %t.bar.a -o %t.bc
declare i32* @foo(...)
define i32* @bar() {
%ret = call i32* (...)* @foo( i32 123 )
ret i32* %ret
}
@baz = global i32 0
Make everyone happy this time.
; Test linking of a bc file to an archive via llvm-ld.
; PR1434
; RUN: rm -f %t.bar.a %t.foo.a
; RUN: llvm-as %s -o %t.bar.bc
; RUN: echo {define i32* @foo(i32 %x) \{ ret i32* @baz \} \
; RUN: @baz = external global i32 } | llvm-as -o %t.foo.bc
; RUN: llvm-ar rcf %t.foo.a %t.foo.bc
; RUN: llvm-ar rcf %t.bar.a %t.bar.bc
; RUN: llvm-ld -disable-opt %t.bar.bc %t.foo.a -o %t.bc
; RUN: llvm-ld -disable-opt %t.foo.bc %t.bar.a -o %t.bc
declare i32* @foo(...)
define i32* @bar() {
%ret = call i32* (...)* @foo( i32 123 )
ret i32* %ret
}
@baz = global i32 0
|
Data Provenance Initiative
|
2025-04-01T17:48:26.624584
|
{
"license": [
"Apache 2 License - https://www.apache.org/licenses/LICENSE-2.0",
"BSD 2-Clause",
"BSD 3-Clause",
"MIT License",
"MIT License"
],
"license_url": "https://opensource.org/licenses/MIT",
"language": [
"English",
"LLVM"
],
"url": "https://github.com/bigcode-project/octopack",
"dataset_id": "commitpackft-llvm",
"response": ""
}
|
commitpackft-llvm-242
|
; RUN: llvm-as < %s | llc -march=x86 | FileCheck %s
@a = external global i96, align 4
@b = external global i64, align 8
define void @c() nounwind {
; CHECK: movl a+8, %eax
%srcval1 = load i96* @a, align 4
%sroa.store.elt2 = lshr i96 %srcval1, 64
%tmp = trunc i96 %sroa.store.elt2 to i64
; CHECK: movl %eax, b
; CHECK: movl $0, b+4
store i64 %tmp, i64* @b, align 8
ret void
}
Make this test platform neutral.
; RUN: llvm-as < %s | llc -march=x86 -mtriple=i386-pc-linux | FileCheck %s
@a = external global i96, align 4
@b = external global i64, align 8
define void @c() nounwind {
; CHECK: movl a+8, %eax
%srcval1 = load i96* @a, align 4
%sroa.store.elt2 = lshr i96 %srcval1, 64
%tmp = trunc i96 %sroa.store.elt2 to i64
; CHECK: movl %eax, b
; CHECK: movl $0, b+4
store i64 %tmp, i64* @b, align 8
ret void
}
|
Data Provenance Initiative
|
2025-04-01T17:48:26.624587
|
{
"license": [
"Apache 2 License - https://www.apache.org/licenses/LICENSE-2.0",
"BSD 2-Clause",
"BSD 3-Clause",
"MIT License",
"MIT License"
],
"license_url": "https://opensource.org/licenses/MIT",
"language": [
"English",
"LLVM"
],
"url": "https://github.com/bigcode-project/octopack",
"dataset_id": "commitpackft-llvm",
"response": ""
}
|
commitpackft-llvm-243
|
; RUN: llvm-as < %s | llc -o %t
; RUN: not grep and %t
; RUN: not grep shr %t
; rdar://6661955
@hello = internal constant [7 x i8] c"hello\0A\00"
@world = internal constant [7 x i8] c"world\0A\00"
define void @func(i32* %b) nounwind {
bb1579.i.i: ; preds = %bb1514.i.i, %bb191.i.i
%tmp176 = load i32* %b, align 4
%tmp177 = and i32 %tmp176, 2
%tmp178 = icmp eq i32 %tmp177, 0
br i1 %tmp178, label %hello, label %world
hello:
%h = tail call i32 (i8*, ...)* @printf( i8* getelementptr ([7 x i8]* @hello, i32 0, i32 0))
ret void
world:
%w = tail call i32 (i8*, ...)* @printf( i8* getelementptr ([7 x i8]* @world, i32 0, i32 0))
ret void
}
declare i32 @printf(i8*, ...) nounwind
Add -f to RUN line.
; RUN: llvm-as < %s | llc -o %t -f
; RUN: not grep and %t
; RUN: not grep shr %t
; rdar://6661955
@hello = internal constant [7 x i8] c"hello\0A\00"
@world = internal constant [7 x i8] c"world\0A\00"
define void @func(i32* %b) nounwind {
bb1579.i.i: ; preds = %bb1514.i.i, %bb191.i.i
%tmp176 = load i32* %b, align 4
%tmp177 = and i32 %tmp176, 2
%tmp178 = icmp eq i32 %tmp177, 0
br i1 %tmp178, label %hello, label %world
hello:
%h = tail call i32 (i8*, ...)* @printf( i8* getelementptr ([7 x i8]* @hello, i32 0, i32 0))
ret void
world:
%w = tail call i32 (i8*, ...)* @printf( i8* getelementptr ([7 x i8]* @world, i32 0, i32 0))
ret void
}
declare i32 @printf(i8*, ...) nounwind
|
Data Provenance Initiative
|
2025-04-01T17:48:26.624592
|
{
"license": [
"Apache 2 License - https://www.apache.org/licenses/LICENSE-2.0",
"BSD 2-Clause",
"BSD 3-Clause",
"MIT License",
"MIT License"
],
"license_url": "https://opensource.org/licenses/MIT",
"language": [
"English",
"LLVM"
],
"url": "https://github.com/bigcode-project/octopack",
"dataset_id": "commitpackft-llvm",
"response": ""
}
|
commitpackft-llvm-244
|
; Windows is not producing anything in the cache apparently, TBD
; XFAIL: win32
; RUN: opt -module-summary %s -o %t.bc
; RUN: opt -module-summary %p/Inputs/funcimport.ll -o %t2.bc
; Verify that enabling caching is working
; RUN: rm -Rf %t.cache && mkdir %t.cache
; RUN: llvm-lto -thinlto-action=run -exported-symbol=globalfunc %t2.bc %t.bc -thinlto-cache-dir %t.cache
; RUN: ls %t.cache/llvmcache.timestamp
; RUN: ls %t.cache | count 3
target datalayout = "e-m:o-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-apple-macosx10.11.0"
define void @globalfunc() #0 {
entry:
ret void
}
Rework r269548, "XFAIL ThinLTO Caching test on Windows.", not to use XFAIL, for now.
; Windows is not producing anything in the cache apparently, TBD
; REQUIRES: shell
; RUN: opt -module-summary %s -o %t.bc
; RUN: opt -module-summary %p/Inputs/funcimport.ll -o %t2.bc
; Verify that enabling caching is working
; RUN: rm -Rf %t.cache && mkdir %t.cache
; RUN: llvm-lto -thinlto-action=run -exported-symbol=globalfunc %t2.bc %t.bc -thinlto-cache-dir %t.cache
; RUN: ls %t.cache/llvmcache.timestamp
; RUN: ls %t.cache | count 3
target datalayout = "e-m:o-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-apple-macosx10.11.0"
define void @globalfunc() #0 {
entry:
ret void
}
|
Data Provenance Initiative
|
2025-04-01T17:48:26.624596
|
{
"license": [
"Apache 2 License - https://www.apache.org/licenses/LICENSE-2.0",
"BSD 2-Clause",
"BSD 3-Clause",
"MIT License",
"MIT License"
],
"license_url": "https://opensource.org/licenses/MIT",
"language": [
"English",
"LLVM"
],
"url": "https://github.com/bigcode-project/octopack",
"dataset_id": "commitpackft-llvm",
"response": ""
}
|
commitpackft-llvm-245
|
; RUN: llvm-as < %s | opt -indvars | llvm-dis | grep -C1 Loop: | grep Canonical
; The indvar simplification code should ensure that the first PHI in the block
; is the canonical one!
int %test() {
br label %Loop
Loop:
%NonIndvar = phi int [200, %0], [%NonIndvarNext, %Loop]
%Canonical = phi int [0, %0], [%CanonicalNext, %Loop]
%NonIndvarNext = div int %NonIndvar, 2
%CanonicalNext = add int %Canonical, 1
br label %Loop
}
Tweak testcase to work with new indvars pass
; RUN: llvm-as < %s | opt -indvars | llvm-dis | grep -C1 Loop: | grep %indvar
; The indvar simplification code should ensure that the first PHI in the block
; is the canonical one!
int %test() {
br label %Loop
Loop:
%NonIndvar = phi int [200, %0], [%NonIndvarNext, %Loop]
%Canonical = phi int [0, %0], [%CanonicalNext, %Loop]
%NonIndvarNext = div int %NonIndvar, 2
%CanonicalNext = add int %Canonical, 1
br label %Loop
}
|
Data Provenance Initiative
|
2025-04-01T17:48:26.624599
|
{
"license": [
"Apache 2 License - https://www.apache.org/licenses/LICENSE-2.0",
"BSD 2-Clause",
"BSD 3-Clause",
"MIT License",
"MIT License"
],
"license_url": "https://opensource.org/licenses/MIT",
"language": [
"English",
"LLVM"
],
"url": "https://github.com/bigcode-project/octopack",
"dataset_id": "commitpackft-llvm",
"response": ""
}
|
commitpackft-llvm-246
|
; RUN: llvm-upgrade < %s | llvm-as | llvm-dis -o /dev/null &&
; RUN: llvm-upgrade < %s | llvm-as | llvm-dis | not grep bitcast
int %test1() {
ret int bitcast(float 3.7 to int)
}
float %test2() {
ret float bitcast(int 17 to float)
}
long %test3() {
ret long bitcast (double 3.1415926 to long)
}
double %test4() {
ret double bitcast (long 42 to double)
}
Fix a missing -f that the new llvm.exp found.
; RUN: llvm-upgrade < %s | llvm-as | llvm-dis -o /dev/null -f &&
; RUN: llvm-upgrade < %s | llvm-as | llvm-dis | not grep bitcast
int %test1() {
ret int bitcast(float 3.7 to int)
}
float %test2() {
ret float bitcast(int 17 to float)
}
long %test3() {
ret long bitcast (double 3.1415926 to long)
}
double %test4() {
ret double bitcast (long 42 to double)
}
|
Data Provenance Initiative
|
2025-04-01T17:48:26.624603
|
{
"license": [
"Apache 2 License - https://www.apache.org/licenses/LICENSE-2.0",
"BSD 2-Clause",
"BSD 3-Clause",
"MIT License",
"MIT License"
],
"license_url": "https://opensource.org/licenses/MIT",
"language": [
"English",
"LLVM"
],
"url": "https://github.com/bigcode-project/octopack",
"dataset_id": "commitpackft-llvm",
"response": ""
}
|
commitpackft-llvm-247
|
; RUN: opt < %s -mtriple=x86_64-apple-macosx -pgo-instr-gen -instrprof -S | llc | FileCheck %s --check-prefix=MACHO-DIRECTIVE
target datalayout = "e-m:o-i64:64-f80:128-n8:16:32:64-S128"
; MACHO-DIRECTIVE: .weak_definition ___llvm_profile_raw_version
define i32 @test_macho(i32 %i) {
entry:
ret i32 %i
}
Fix buildbot failure from r268968.
; RUN: opt < %s -pgo-instr-gen -instrprof -S | llc | FileCheck %s --check-prefix=MACHO-DIRECTIVE
target datalayout = "e-m:o-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-apple-macosx10.11.0"
; MACHO-DIRECTIVE: .weak_definition ___llvm_profile_raw_version
define i32 @test_macho(i32 %i) {
entry:
ret i32 %i
}
|
Data Provenance Initiative
|
2025-04-01T17:48:26.624606
|
{
"license": [
"Apache 2 License - https://www.apache.org/licenses/LICENSE-2.0",
"BSD 2-Clause",
"BSD 3-Clause",
"MIT License",
"MIT License"
],
"license_url": "https://opensource.org/licenses/MIT",
"language": [
"English",
"LLVM"
],
"url": "https://github.com/bigcode-project/octopack",
"dataset_id": "commitpackft-llvm",
"response": ""
}
|
commitpackft-llvm-248
|
; RUN: llc < %s -march=x86 -mattr=+sse | FileCheck %s
; RUN: llc < %s -march=x86 -mattr=+avx | FileCheck %s
; RUN: llc < %s -march=x86 -mattr=+prfchw | FileCheck %s -check-prefix=PRFCHW
; rdar://10538297
define void @t(i8* %ptr) nounwind {
entry:
; CHECK: prefetcht2
; CHECK: prefetcht1
; CHECK: prefetcht0
; CHECK: prefetchnta
; PRFCHW: prefetchw
tail call void @llvm.prefetch( i8* %ptr, i32 0, i32 1, i32 1 )
tail call void @llvm.prefetch( i8* %ptr, i32 0, i32 2, i32 1 )
tail call void @llvm.prefetch( i8* %ptr, i32 0, i32 3, i32 1 )
tail call void @llvm.prefetch( i8* %ptr, i32 0, i32 0, i32 1 )
tail call void @llvm.prefetch( i8* %ptr, i32 1, i32 3, i32 1 )
ret void
}
declare void @llvm.prefetch(i8*, i32, i32, i32) nounwind
Fix PRFCHW test on non-x86 builds
; RUN: llc < %s -march=x86 -mattr=+sse | FileCheck %s
; RUN: llc < %s -march=x86 -mattr=+avx | FileCheck %s
; RUN: llc < %s -march=x86 -mattr=+sse -mattr=+prfchw | FileCheck %s -check-prefix=PRFCHW
; rdar://10538297
define void @t(i8* %ptr) nounwind {
entry:
; CHECK: prefetcht2
; CHECK: prefetcht1
; CHECK: prefetcht0
; CHECK: prefetchnta
; PRFCHW: prefetchw
tail call void @llvm.prefetch( i8* %ptr, i32 0, i32 1, i32 1 )
tail call void @llvm.prefetch( i8* %ptr, i32 0, i32 2, i32 1 )
tail call void @llvm.prefetch( i8* %ptr, i32 0, i32 3, i32 1 )
tail call void @llvm.prefetch( i8* %ptr, i32 0, i32 0, i32 1 )
tail call void @llvm.prefetch( i8* %ptr, i32 1, i32 3, i32 1 )
ret void
}
declare void @llvm.prefetch(i8*, i32, i32, i32) nounwind
|
Data Provenance Initiative
|
2025-04-01T17:48:26.624611
|
{
"license": [
"Apache 2 License - https://www.apache.org/licenses/LICENSE-2.0",
"BSD 2-Clause",
"BSD 3-Clause",
"MIT License",
"MIT License"
],
"license_url": "https://opensource.org/licenses/MIT",
"language": [
"English",
"LLVM"
],
"url": "https://github.com/bigcode-project/octopack",
"dataset_id": "commitpackft-llvm",
"response": ""
}
|
commitpackft-llvm-249
|
implementation
[[2 x int]] "test function"(int %i0, int %j0)
%array = [[2 x int]] [
[2 x int] [ int 12, int 52 ]
]
begin
ret [[2x int]] %array
end
Add test of string constants
%somestr = [sbyte] c"hello world"
%somestr = [11x sbyte] c"hello world"
implementation
[[2 x int]] "test function"(int %i0, int %j0)
%array = [[2 x int]] [
[2 x int] [ int 12, int 52 ]
]
begin
ret [[2x int]] %array
end
[sbyte] "other func"(int, double)
begin
ret [sbyte] %somestr
end
[sbyte] "again"(float)
begin
%cast = cast [11x sbyte] %somestr to [sbyte]
ret [sbyte] %cast
end
|
Data Provenance Initiative
|
2025-04-01T17:48:26.624614
|
{
"license": [
"Apache 2 License - https://www.apache.org/licenses/LICENSE-2.0",
"BSD 2-Clause",
"BSD 3-Clause",
"MIT License",
"MIT License"
],
"license_url": "https://opensource.org/licenses/MIT",
"language": [
"English",
"LLVM"
],
"url": "https://github.com/bigcode-project/octopack",
"dataset_id": "commitpackft-llvm",
"response": ""
}
|
commitpackft-llvm-250
|
; RUN: llc < %s -march=x86 -O0 | FileCheck %s
; PR7509
%asmtype = type { i32, i8*, i32, i32 }
; Arguments 1 and 4 must be the same. No other output arguments may be
; allocated %eax.
; CHECK: InlineAsm Start
; CHECK: arg1 %[[A1:...]]
; CHECK-NOT: ax
; CHECK: arg4 %[[A1]]
; CHECK: InlineAsm End
define i32 @func(i8* %s) nounwind ssp {
entry:
%0 = tail call %asmtype asm "arg0 $0\0A\09arg1 $1\0A\09arg2 $2\0A\09arg3 $3\0A\09arg4 $4", "={ax},=r,=r,=r,1,~{dirflag},~{fpsr},~{flags}"(i8* %s) nounwind, !srcloc !0 ; <%0> [#uses=1]
%asmresult = extractvalue %asmtype %0, 0 ; <i64> [#uses=1]
ret i32 %asmresult
}
!0 = metadata !{i32 108}
Add a triple so test runs on Linux as well.
; RUN: llc < %s -march=x86 -O0 | FileCheck %s
; PR7509
target triple = "i386-apple-darwin10"
%asmtype = type { i32, i8*, i32, i32 }
; Arguments 1 and 4 must be the same. No other output arguments may be
; allocated %eax.
; CHECK: InlineAsm Start
; CHECK: arg1 %[[A1:...]]
; CHECK-NOT: ax
; CHECK: arg4 %[[A1]]
; CHECK: InlineAsm End
define i32 @func(i8* %s) nounwind ssp {
entry:
%0 = tail call %asmtype asm "arg0 $0\0A\09arg1 $1\0A\09arg2 $2\0A\09arg3 $3\0A\09arg4 $4", "={ax},=r,=r,=r,1,~{dirflag},~{fpsr},~{flags}"(i8* %s) nounwind, !srcloc !0 ; <%0> [#uses=1]
%asmresult = extractvalue %asmtype %0, 0 ; <i64> [#uses=1]
ret i32 %asmresult
}
!0 = metadata !{i32 108}
|
Data Provenance Initiative
|
2025-04-01T17:48:26.624618
|
{
"license": [
"Apache 2 License - https://www.apache.org/licenses/LICENSE-2.0",
"BSD 2-Clause",
"BSD 3-Clause",
"MIT License",
"MIT License"
],
"license_url": "https://opensource.org/licenses/MIT",
"language": [
"English",
"LLVM"
],
"url": "https://github.com/bigcode-project/octopack",
"dataset_id": "commitpackft-llvm",
"response": ""
}
|
commitpackft-llvm-251
|
; RUN: llc %s -mtriple=thumbv7-apple-darwin -mcpu=cortex-a9 -O0
; The following test is supposed to produce a VMOVQQQQ pseudo instruction.
; Make sure that it gets expanded; otherwise, the compile fails when trying
; to print the pseudo-instruction.
define void @test_vmovqqqq_pseudo() nounwind ssp {
entry:
%vld3_lane = call { <8 x i16>, <8 x i16>, <8 x i16> } @llvm.arm.neon.vld3lane.v8i16(i8* undef, <8 x i16> undef, <8 x i16> undef, <8 x i16> zeroinitializer, i32 7, i32 2)
store { <8 x i16>, <8 x i16>, <8 x i16> } %vld3_lane, { <8 x i16>, <8 x i16>, <8 x i16> }* undef
ret void
}
declare { <8 x i16>, <8 x i16>, <8 x i16> } @llvm.arm.neon.vld3lane.v8i16(i8*, <8 x i16>, <8 x i16>, <8 x i16>, i32, i32) nounwind readonly
Fix this test to avoid leaving a temporary file behind.
; RUN: llc %s -mtriple=thumbv7-apple-darwin -mcpu=cortex-a9 -O0 -o -
; The following test is supposed to produce a VMOVQQQQ pseudo instruction.
; Make sure that it gets expanded; otherwise, the compile fails when trying
; to print the pseudo-instruction.
define void @test_vmovqqqq_pseudo() nounwind ssp {
entry:
%vld3_lane = call { <8 x i16>, <8 x i16>, <8 x i16> } @llvm.arm.neon.vld3lane.v8i16(i8* undef, <8 x i16> undef, <8 x i16> undef, <8 x i16> zeroinitializer, i32 7, i32 2)
store { <8 x i16>, <8 x i16>, <8 x i16> } %vld3_lane, { <8 x i16>, <8 x i16>, <8 x i16> }* undef
ret void
}
declare { <8 x i16>, <8 x i16>, <8 x i16> } @llvm.arm.neon.vld3lane.v8i16(i8*, <8 x i16>, <8 x i16>, <8 x i16>, i32, i32) nounwind readonly
|
Data Provenance Initiative
|
2025-04-01T17:48:26.624622
|
{
"license": [
"Apache 2 License - https://www.apache.org/licenses/LICENSE-2.0",
"BSD 2-Clause",
"BSD 3-Clause",
"MIT License",
"MIT License"
],
"license_url": "https://opensource.org/licenses/MIT",
"language": [
"English",
"LLVM"
],
"url": "https://github.com/bigcode-project/octopack",
"dataset_id": "commitpackft-llvm",
"response": ""
}
|
commitpackft-llvm-252
|
; RUN: llvm-as -o %t.bc %s
; RUN: llvm-lto -exported-symbol=foo -exported-symbol=bar -j2 -o %t.o %t.bc
; RUN: llvm-nm %t.o.0 | FileCheck --check-prefix=CHECK0 %s
; RUN: llvm-nm %t.o.1 | FileCheck --check-prefix=CHECK1 %s
; FIXME: Investigate test failures on these architecures.
; XFAIL: mips, mipsel, aarch64
target triple = "x86_64-unknown-linux-gnu"
; CHECK0-NOT: bar
; CHECK0: T foo
; CHECK0-NOT: bar
define void @foo() {
call void @bar()
ret void
}
; CHECK1-NOT: foo
; CHECK1: T bar
; CHECK1-NOT: foo
define void @bar() {
call void @foo()
ret void
}
Use UNSUPPORTED instead of XFAIL to disable this test, as it passes on one AArch64 bot.
; RUN: llvm-as -o %t.bc %s
; RUN: llvm-lto -exported-symbol=foo -exported-symbol=bar -j2 -o %t.o %t.bc
; RUN: llvm-nm %t.o.0 | FileCheck --check-prefix=CHECK0 %s
; RUN: llvm-nm %t.o.1 | FileCheck --check-prefix=CHECK1 %s
; FIXME: Investigate test failures on these architecures.
; UNSUPPORTED: mips, mipsel, aarch64
target triple = "x86_64-unknown-linux-gnu"
; CHECK0-NOT: bar
; CHECK0: T foo
; CHECK0-NOT: bar
define void @foo() {
call void @bar()
ret void
}
; CHECK1-NOT: foo
; CHECK1: T bar
; CHECK1-NOT: foo
define void @bar() {
call void @foo()
ret void
}
|
Data Provenance Initiative
|
2025-04-01T17:48:26.624625
|
{
"license": [
"Apache 2 License - https://www.apache.org/licenses/LICENSE-2.0",
"BSD 2-Clause",
"BSD 3-Clause",
"MIT License",
"MIT License"
],
"license_url": "https://opensource.org/licenses/MIT",
"language": [
"English",
"LLVM"
],
"url": "https://github.com/bigcode-project/octopack",
"dataset_id": "commitpackft-llvm",
"response": ""
}
|
commitpackft-llvm-253
|
; Make sure this testcase codegens to the zapnot instruction
; RUN: llvm-as < %s | llc -march=alpha | grep 'zapnot'
implementation ; Functions:
long %bar(long %x) {
entry:
%tmp.1 = and long %x, 255 ; <long> [#uses=1]
ret long %tmp.1
}
Change this regression so andi is not a valid codegen of it
; Make sure this testcase codegens to the zapnot instruction
; RUN: llvm-as < %s | llc -march=alpha | grep 'zapnot'
implementation ; Functions:
long %bar(long %x) {
entry:
%tmp.1 = and long %x, 16711935 ; <long> [#uses=1]
ret long %tmp.1
}
|
Data Provenance Initiative
|
2025-04-01T17:48:26.624629
|
{
"license": [
"Apache 2 License - https://www.apache.org/licenses/LICENSE-2.0",
"BSD 2-Clause",
"BSD 3-Clause",
"MIT License",
"MIT License"
],
"license_url": "https://opensource.org/licenses/MIT",
"language": [
"English",
"LLVM"
],
"url": "https://github.com/bigcode-project/octopack",
"dataset_id": "commitpackft-llvm",
"response": ""
}
|
commitpackft-llvm-254
|
; RUN: llvm-as < %s | llc -march=x86 -mattr=+sse2 | grep shufps
void %test_v4sf(<4 x float>* %P, float %X, float %Y) {
%tmp = insertelement <4 x float> zeroinitializer, float %X, uint 0
%tmp2 = insertelement <4 x float> %tmp, float %X, uint 1
%tmp4 = insertelement <4 x float> %tmp2, float %Y, uint 2
%tmp6 = insertelement <4 x float> %tmp4, float %Y, uint 3
store <4 x float> %tmp6, <4 x float>* %P
ret void
}
Add a v2f64 shuffle case.
; RUN: llvm-as < %s | llc -march=x86 -mattr=+sse2 | grep shufp | wc -l | grep 1
; RUN: llvm-as < %s | llc -march=x86 -mattr=+sse2 | grep movlhps
void %test_v4sf(<4 x float>* %P, float %X, float %Y) {
%tmp = insertelement <4 x float> zeroinitializer, float %X, uint 0
%tmp2 = insertelement <4 x float> %tmp, float %X, uint 1
%tmp4 = insertelement <4 x float> %tmp2, float %Y, uint 2
%tmp6 = insertelement <4 x float> %tmp4, float %Y, uint 3
store <4 x float> %tmp6, <4 x float>* %P
ret void
}
void %test_v2sd(<2 x double>* %P, double %X, double %Y) {
%tmp = insertelement <2 x double> zeroinitializer, double %X, uint 0
%tmp2 = insertelement <2 x double> %tmp, double %Y, uint 1
store <2 x double> %tmp2, <2 x double>* %P
ret void
}
|
Data Provenance Initiative
|
2025-04-01T17:48:26.624633
|
{
"license": [
"Apache 2 License - https://www.apache.org/licenses/LICENSE-2.0",
"BSD 2-Clause",
"BSD 3-Clause",
"MIT License",
"MIT License"
],
"license_url": "https://opensource.org/licenses/MIT",
"language": [
"English",
"LLVM"
],
"url": "https://github.com/bigcode-project/octopack",
"dataset_id": "commitpackft-llvm",
"response": ""
}
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.