-
Notifications
You must be signed in to change notification settings - Fork 30
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[InstCombine] Fix removal of adjacent tapir.runtime.start and tapir.r…
…untime.end calls.
- Loading branch information
Showing
2 changed files
with
51 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,49 @@ | ||
; Check that instcombine properly removes adjacent tapir.runtime | ||
; calls. | ||
; | ||
; RUN: opt < %s -passes="instcombine" -S | FileCheck %s | ||
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128" | ||
target triple = "x86_64-unknown-linux-gnu" | ||
|
||
; Function Attrs: nounwind uwtable | ||
define dso_local i32 @main(i32 noundef %argc, ptr noundef %argv) #0 { | ||
entry: | ||
%retval = alloca i32, align 4 | ||
%argc.addr = alloca i32, align 4 | ||
%argv.addr = alloca ptr, align 8 | ||
store i32 0, ptr %retval, align 4 | ||
store i32 %argc, ptr %argc.addr, align 4, !tbaa !5 | ||
store ptr %argv, ptr %argv.addr, align 8, !tbaa !9 | ||
%0 = call token @llvm.tapir.runtime.start() | ||
call void @llvm.tapir.runtime.end(token %0) | ||
ret i32 0 | ||
} | ||
|
||
; CHECK: define {{.*}}i32 @main( | ||
; CHECK-NOT: call token @llvm.tapir.runtime.start | ||
; CHECK-NOT: call void @llvm.tapir.runtime.end | ||
; CHECK: ret | ||
|
||
; Function Attrs: nounwind willreturn memory(argmem: readwrite) | ||
declare token @llvm.tapir.runtime.start() #1 | ||
|
||
; Function Attrs: nounwind willreturn memory(argmem: readwrite) | ||
declare void @llvm.tapir.runtime.end(token) #1 | ||
|
||
attributes #0 = { nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } | ||
attributes #1 = { nounwind willreturn memory(argmem: readwrite) } | ||
|
||
!llvm.module.flags = !{!0, !1, !2, !3} | ||
!llvm.ident = !{!4} | ||
|
||
!0 = !{i32 1, !"wchar_size", i32 4} | ||
!1 = !{i32 8, !"PIC Level", i32 2} | ||
!2 = !{i32 7, !"PIE Level", i32 2} | ||
!3 = !{i32 7, !"uwtable", i32 2} | ||
!4 = !{!"clang version 16.0.6 ([email protected]:OpenCilk/opencilk-project.git ca9e0f93cdcefe84809f3ddd9c61363b76a1a271)"} | ||
!5 = !{!6, !6, i64 0} | ||
!6 = !{!"int", !7, i64 0} | ||
!7 = !{!"omnipotent char", !8, i64 0} | ||
!8 = !{!"Simple C/C++ TBAA"} | ||
!9 = !{!10, !10, i64 0} | ||
!10 = !{!"any pointer", !7, i64 0} |