Skip to content

Commit 3ea3d95

Browse files
authored
Merge amd-debug into amd-staging (llvm#1562)
2 parents 5b2de35 + 9180a5a commit 3ea3d95

File tree

8 files changed

+481
-177
lines changed

8 files changed

+481
-177
lines changed
Lines changed: 134 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,134 @@
1+
name: Trigger amd-debug Buildbot Build
2+
on:
3+
workflow_dispatch:
4+
pull_request:
5+
branches: [amd-debug]
6+
types: [opened, reopened, synchronize, ready_for_review]
7+
8+
9+
jobs:
10+
trigger-build:
11+
if: github.event.pull_request.draft == false
12+
runs-on: self-hosted
13+
env:
14+
PR_SHA: ${{ github.event.pull_request.head.sha != '' && github.event.pull_request.head.sha || github.sha }}
15+
PR_NUMBER: ${{ github.event.pull_request.number != '' && github.event.pull_request.number || 0 }}
16+
PR_URL: ${{ github.event.pull_request.html_url != '' && github.event.pull_request.html_url || '' }}
17+
PR_TITLE: ${{ github.event.pull_request.title != '' && github.event.pull_request.title || '' }}
18+
BASE_BRANCH: ${{ github.event.pull_request.base.ref != '' && github.event.pull_request.base.ref || '' }}
19+
GITHUB_TOKEN: ${{secrets.CI_GITHUB_TOKEN}}
20+
21+
steps:
22+
# Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it
23+
- name: Set environment variable for container image
24+
run: |
25+
echo "CONTAINER_IMAGE=${{ secrets.BUILDBOT_DOCKER_IMAGE }}" >> $GITHUB_ENV
26+
echo "CONTAINER_NAME=my_container_${{ github.run_id }}" >> $GITHUB_ENV
27+
28+
- name: Pull container image
29+
run: docker pull "${{env.CONTAINER_IMAGE}}"
30+
31+
- name: Run container
32+
run: |
33+
docker run -d --name "${{env.CONTAINER_NAME}}" $CONTAINER_IMAGE sleep infinity
34+
docker exec "${{env.CONTAINER_NAME}}" /bin/bash -c "echo 'Running commands inside the container'"
35+
36+
- name: Escape pull request title
37+
run: |
38+
import json
39+
import os
40+
import shlex
41+
with open('${{ github.event_path }}') as fh:
42+
event = json.load(fh)
43+
escaped = event['pull_request']['title']
44+
with open(os.environ['GITHUB_ENV'], 'a') as fh:
45+
print(f'PR_TITLE={escaped}', file=fh)
46+
shell: python3 {0}
47+
48+
- name: Trigger Buildbot Build
49+
run: |
50+
echo "${{ secrets.BUILDBOT_HOST }}:${{ secrets.BUILDBOT_WORKER_PORT }}"
51+
docker exec -e PR_TITLE="$PR_TITLE" "${{env.CONTAINER_NAME}}" /bin/bash -c 'buildbot sendchange -W ${{ secrets.BUILDBOT_USER }} -a ${{secrets.BUILDBOT_USER}}:${{secrets.BUILDBOT_PWD}} --master="${{ secrets.BUILDBOT_HOST }}:${{ secrets.BUILDBOT_WORKER_PORT }}" --branch=${{ env.BASE_BRANCH }} --revision=${{ env.PR_SHA }} -p PR_NUMBER:${{ env.PR_NUMBER }} -p PR_TITLE:"$PR_TITLE" -p PR_URL:${{ env.PR_URL }} -p SHA:${{ env.PR_SHA }}'
52+
53+
- name: Set Initial Status to Pending
54+
run: |
55+
docker exec -e PR_SHA=$PR_SHA -e GITHUB_TOKEN=$GITHUB_TOKEN "${{env.CONTAINER_NAME}}" /bin/bash -c "python3 -c \"
56+
import os
57+
import requests
58+
GITHUB_TOKEN = os.getenv('GITHUB_TOKEN')
59+
TARGET_SHA = os.getenv('PR_SHA')
60+
print('debug', TARGET_SHA)
61+
api_url = f'https://api.github.com/repos/AMD-Lightning-Internal/llvm-project/statuses/{TARGET_SHA}'
62+
headers = {
63+
'Authorization': f'token {GITHUB_TOKEN}',
64+
'Content-Type': 'application/json'
65+
}
66+
payload = {
67+
'state': 'pending',
68+
'context': 'buildbot',
69+
'description': 'Build is in queue'
70+
}
71+
response = requests.post(api_url, json=payload, headers=headers)
72+
if response.status_code == 201:
73+
print('Status set to pending successfully.')
74+
else:
75+
print(f'Failed to set status: {response.status_code} {response.text}')
76+
\""
77+
78+
- name: Poll Buildbot build status
79+
run: |
80+
python3 -c "
81+
import os
82+
import time
83+
import requests
84+
GITHUB_TOKEN = os.getenv('GITHUB_TOKEN')
85+
BUILD_URL = 'http://${{ secrets.BUILDBOT_HOST }}:${{ secrets.BUILDBOT_MASTER_PORT }}/api/v2/builds'
86+
TARGET_SHA = os.getenv('PR_SHA')
87+
print('debug', TARGET_SHA)
88+
MAX_RETRIES = 10
89+
RETRY_INTERVAL = 30 # seconds
90+
91+
def get_build_properties(build_id):
92+
build_properties_url = f'http://${{ secrets.BUILDBOT_HOST }}:${{ secrets.BUILDBOT_MASTER_PORT }}/api/v2/builds/{build_id}/properties'
93+
response = requests.get(build_properties_url, headers={'Accept': 'application/json', 'Authorization': f'token {GITHUB_TOKEN}'})
94+
return response.json()
95+
96+
for i in range(MAX_RETRIES):
97+
response = requests.get(BUILD_URL, headers={'Accept': 'application/json'})
98+
response_json = response.json()
99+
print(f'Attempt {i + 1}: Buildbot response:', response_json)
100+
101+
# Check if any build has the target SHA
102+
builds = response_json.get('builds', [])
103+
print (builds)
104+
build_with_sha = None
105+
for build in builds:
106+
build_id = build['buildid']
107+
properties = get_build_properties(build_id)
108+
#print(properties)
109+
#prop = properties.get('revision', [])
110+
111+
if 'properties' in properties:
112+
print (properties['properties'])
113+
if 'revision' in properties['properties'][0]:
114+
print(properties['properties'][0])
115+
if 'revision' in properties['properties'][0] and properties['properties'][0]['revision'] [0] == TARGET_SHA:
116+
build_with_sha = build
117+
break
118+
119+
if build_with_sha:
120+
print('Build started successfully for SHA:', TARGET_SHA)
121+
break
122+
else:
123+
print('Build for SHA not started yet, retrying in', RETRY_INTERVAL, 'seconds')
124+
time.sleep(RETRY_INTERVAL)
125+
else:
126+
print('Build did not start for SHA:', TARGET_SHA, 'after maximum retries')
127+
exit(1)
128+
"
129+
130+
- name: Stop and remove container
131+
if: always()
132+
run: |
133+
docker stop "${{env.CONTAINER_NAME}}"
134+
docker rm "${{env.CONTAINER_NAME}}"

llvm/include/llvm/BinaryFormat/Dwarf.def

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -640,16 +640,16 @@ HANDLE_DW_AT(0x3e06, LLVM_ptrauth_extra_discriminator, 0, LLVM)
640640
HANDLE_DW_AT(0x3e07, LLVM_apinotes, 0, APPLE)
641641
HANDLE_DW_AT(0x3e08, LLVM_ptrauth_isa_pointer, 0, LLVM)
642642
HANDLE_DW_AT(0x3e09, LLVM_ptrauth_authenticates_null_values, 0, LLVM)
643+
HANDLE_DW_AT(0x3e0a, LLVM_ptrauth_authentication_mode, 0, LLVM)
644+
HANDLE_DW_AT(0x3e0b, LLVM_num_extra_inhabitants, 0, LLVM)
645+
HANDLE_DW_AT(0x3e0c, LLVM_stmt_sequence, 0, LLVM)
643646
// Heterogeneous Debugging Extension defined at
644647
// https://llvm.org/docs/AMDGPUDwarfProposalForHeterogeneousDebugging.html.
645-
HANDLE_DW_AT(0x3e0a, LLVM_lanes, 0, LLVM)
646-
HANDLE_DW_AT(0x3e0b, LLVM_lane_pc, 0, LLVM)
647-
HANDLE_DW_AT(0x3e0c, LLVM_vector_size, 0, LLVM)
648648
HANDLE_DW_AT(0x3e0d, LLVM_memory_space, 0, LLVM)
649649
HANDLE_DW_AT(0x3e0e, LLVM_address_space, 0, LLVM)
650-
HANDLE_DW_AT(0x3e0f, LLVM_ptrauth_authentication_mode, 0, LLVM)
651-
HANDLE_DW_AT(0x3e10, LLVM_num_extra_inhabitants, 0, LLVM)
652-
HANDLE_DW_AT(0x3e11, LLVM_stmt_sequence, 0, LLVM)
650+
HANDLE_DW_AT(0x3e0f, LLVM_lanes, 0, LLVM)
651+
HANDLE_DW_AT(0x3e10, LLVM_lane_pc, 0, LLVM)
652+
HANDLE_DW_AT(0x3e11, LLVM_vector_size, 0, LLVM)
653653

654654
// https://www.llvm.org/docs/AMDGPUDwarfExtensionsForHeterogeneousDebugging.html#a-7-15-memory-space-encodings
655655
HANDLE_DW_MSPACE(0x0, none)

llvm/lib/Frontend/OpenMP/OMPIRBuilder.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7193,7 +7193,7 @@ static Expected<Function *> createOutlinedFunction(
71937193
// preceding mapped arguments that refer to the same global that may be
71947194
// seperate segments. To prevent this, we defer global processing until all
71957195
// other processing has been performed.
7196-
if (isa<GlobalValue>(Input)) {
7196+
if (isa<GlobalValue>(removeASCastIfPresent(Input))) {
71977197
DeferredReplacement.push_back(std::make_pair(Input, InputCopy));
71987198
continue;
71997199
}

llvm/test/CodeGen/AMDGPU/nested-calls.ll

Lines changed: 8 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,6 @@
33
; RUN: llc -mtriple=amdgcn -mcpu=hawaii -verify-machineinstrs < %s | FileCheck -enable-var-scope -check-prefixes=GCN,HAWAII %s
44
; RUN: llc -mtriple=amdgcn -mcpu=gfx900 -mattr=-flat-for-global -verify-machineinstrs < %s | FileCheck -enable-var-scope -check-prefixes=GCN,GFX9 %s
55

6-
; needs to be autogen
7-
; XFAIL: *
8-
96
; Test calls when called by other callable functions rather than
107
; kernels.
118

@@ -21,19 +18,19 @@ define void @test_func_call_external_void_func_i32_imm() #0 {
2118
; GCN-NEXT: s_or_saveexec_b64 s[18:19], -1
2219
; GCN-NEXT: buffer_store_dword v40, off, s[0:3], s33 ; 4-byte Folded Spill
2320
; GCN-NEXT: s_mov_b64 exec, s[18:19]
24-
; GCN-NEXT: s_addk_i32 s32, 0x400
2521
; GCN-NEXT: v_writelane_b32 v40, s16, 2
22+
; GCN-NEXT: v_writelane_b32 v40, s30, 0
23+
; GCN-NEXT: s_addk_i32 s32, 0x400
24+
; GCN-NEXT: v_writelane_b32 v40, s31, 1
2625
; GCN-NEXT: s_getpc_b64 s[16:17]
2726
; GCN-NEXT: s_add_u32 s16, s16, external_void_func_i32@gotpcrel32@lo+4
2827
; GCN-NEXT: s_addc_u32 s17, s17, external_void_func_i32@gotpcrel32@hi+12
2928
; GCN-NEXT: s_load_dwordx2 s[16:17], s[16:17], 0x0
30-
; GCN-NEXT: v_writelane_b32 v40, s30, 0
3129
; GCN-NEXT: v_mov_b32_e32 v0, 42
32-
; GCN-NEXT: v_writelane_b32 v40, s31, 1
3330
; GCN-NEXT: s_waitcnt lgkmcnt(0)
3431
; GCN-NEXT: s_swappc_b64 s[30:31], s[16:17]
35-
; GCN-NEXT: v_readlane_b32 s31, v40, 1
3632
; GCN-NEXT: v_readlane_b32 s30, v40, 0
33+
; GCN-NEXT: v_readlane_b32 s31, v40, 1
3734
; GCN-NEXT: s_mov_b32 s32, s33
3835
; GCN-NEXT: v_readlane_b32 s4, v40, 2
3936
; GCN-NEXT: s_or_saveexec_b64 s[6:7], -1
@@ -55,24 +52,24 @@ define void @test_func_call_external_void_func_i32_imm_stack_use() #0 {
5552
; GCN-NEXT: s_or_saveexec_b64 s[18:19], -1
5653
; GCN-NEXT: buffer_store_dword v40, off, s[0:3], s33 offset:64 ; 4-byte Folded Spill
5754
; GCN-NEXT: s_mov_b64 exec, s[18:19]
58-
; GCN-NEXT: s_addk_i32 s32, 0x1400
5955
; GCN-NEXT: v_writelane_b32 v40, s16, 2
56+
; GCN-NEXT: v_writelane_b32 v40, s30, 0
57+
; GCN-NEXT: s_addk_i32 s32, 0x1400
58+
; GCN-NEXT: v_writelane_b32 v40, s31, 1
6059
; GCN-NEXT: s_getpc_b64 s[16:17]
6160
; GCN-NEXT: s_add_u32 s16, s16, external_void_func_i32@gotpcrel32@lo+4
6261
; GCN-NEXT: s_addc_u32 s17, s17, external_void_func_i32@gotpcrel32@hi+12
6362
; GCN-NEXT: s_load_dwordx2 s[16:17], s[16:17], 0x0
6463
; GCN-NEXT: v_mov_b32_e32 v0, 0
65-
; GCN-NEXT: v_writelane_b32 v40, s30, 0
6664
; GCN-NEXT: buffer_store_dword v0, off, s[0:3], s33
6765
; GCN-NEXT: s_waitcnt vmcnt(0)
6866
; GCN-NEXT: buffer_store_dword v0, off, s[0:3], s33 offset:64
6967
; GCN-NEXT: s_waitcnt vmcnt(0)
7068
; GCN-NEXT: v_mov_b32_e32 v0, 42
71-
; GCN-NEXT: v_writelane_b32 v40, s31, 1
7269
; GCN-NEXT: s_waitcnt lgkmcnt(0)
7370
; GCN-NEXT: s_swappc_b64 s[30:31], s[16:17]
74-
; GCN-NEXT: v_readlane_b32 s31, v40, 1
7571
; GCN-NEXT: v_readlane_b32 s30, v40, 0
72+
; GCN-NEXT: v_readlane_b32 s31, v40, 1
7673
; GCN-NEXT: s_mov_b32 s32, s33
7774
; GCN-NEXT: v_readlane_b32 s4, v40, 2
7875
; GCN-NEXT: s_or_saveexec_b64 s[6:7], -1

0 commit comments

Comments
 (0)