Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

code_* cleanup, and strip IR metadata from code_llvm output #10741

Closed
wants to merge 2 commits into from

Conversation

ihnorton
Copy link
Member

@ihnorton ihnorton commented Apr 4, 2015

The first commit cleans up the code_native and code_llvm pathways a little bit by removing an intermediate function and calling the one we want directly from Julia code.

The second commit changes the behavior of code_llvm to strip all metadata before printing the IR. This reduces the work needed to run code_llvm output with lli for debugging purposes. I also added a code_llvm_raw version with the current behavior. If people don't think stripped should be the default I'll switch it around.

before:

; Function Attrs: uwtable
define void @julia_bf_112785(i32, i64) #0 {
top:
  call void @llvm.dbg.value(metadata i32 %0, i64 0, metadata !11, metadata !17)
  call void @llvm.dbg.value(metadata i64 %1, i64 0, metadata !18, metadata !17)
  %sext = shl i32 %0, 24, !dbg !19
  %2 = ashr exact i32 %sext, 24, !dbg !19
  %3 = icmp eq i32 %2, %0, !dbg !19
  br i1 %3, label %pass, label %fail, !dbg !19
...

after:

; Function Attrs: uwtable
define void @julia_bf_112785(i32, i64) #-1 {
top:
  call void @llvm.dbg.value(metadata i32 %0, i64 0, metadata !0, metadata !13)
  call void @llvm.dbg.value(metadata i64 %1, i64 0, metadata !14, metadata !13)
  %sext = shl i32 %0, 24
  %2 = ashr exact i32 %sext, 24
  %3 = icmp eq i32 %2, %0
  br i1 %3, label %pass, label %fail

@ihnorton
Copy link
Member Author

ihnorton commented Apr 4, 2015

I should probably get rid of the calls to @llvm.dbg.value too, although those are easier to remove as the whole line can be deleted.

@ihnorton ihnorton mentioned this pull request Apr 4, 2015
19 tasks
@ihnorton ihnorton closed this Apr 5, 2015
@ihnorton
Copy link
Member Author

ihnorton commented Apr 5, 2015

Force-pushed my fix 3 times, branch never updated, now I hit this bug which I see Arch hit recently too.

😡

@ihnorton
Copy link
Member Author

ihnorton commented Apr 5, 2015

And apparently this is what happens when trying to create a new PR from the same branch:
image

@ihnorton
Copy link
Member Author

ihnorton commented Apr 5, 2015

I seem to have deeply angered the github gods as I can't open a PR for a branch with a different name either.

@tkelman
Copy link
Contributor

tkelman commented Apr 5, 2015

blame it on the china ddos? if that's still happening...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants