-
Notifications
You must be signed in to change notification settings - Fork 45
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
The unfilled branch-delay slot no longer exists since we are emitting a conditional move now. Fixes #290
- Loading branch information
1 parent
483b93c
commit abcaf84
Showing
2 changed files
with
37 additions
and
28 deletions.
There are no files selected for viewing
28 changes: 0 additions & 28 deletions
28
llvm/test/CodeGen/Mips/cheri/bad-branch-delay-slot-usage-issue-290.c
This file was deleted.
Oops, something went wrong.
37 changes: 37 additions & 0 deletions
37
llvm/test/CodeGen/Mips/cheri/bad-branch-delay-slot-usage-issue-290.ll
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,37 @@ | ||
; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py | ||
;; https://github.com/CTSRD-CHERI/llvm-project/issues/290 | ||
;; This used to have an unfilled branch-delay slot but is ow converted to a conditional move | ||
; RUN: %cheri128_purecap_llc %s -o - | FileCheck %s '-D#CAP_SIZE=16' | ||
|
||
; Function Attrs: norecurse nounwind readnone uwtable | ||
define i32 addrspace(200)* @test(i32 addrspace(200)* readnone %inCap, i32 signext %test, i32 signext %inInt) local_unnamed_addr #0 { | ||
; CHECK-LABEL: test: | ||
; CHECK: # %bb.0: # %entry | ||
; CHECK-NEXT: cincoffset $c11, $c11, -[[#STACKFRAME_SIZE:]] | ||
; CHECK-NEXT: .cfi_def_cfa_offset [[#STACKFRAME_SIZE]] | ||
; CHECK-NEXT: csc $c24, $zero, [[#STACKFRAME_SIZE - CAP_SIZE]]($c11) | ||
; CHECK-NEXT: csc $c17, $zero, 0($c11) | ||
; CHECK-NEXT: .cfi_offset 96, -[[#STACKFRAME_SIZE - CAP_SIZE]] | ||
; CHECK-NEXT: .cfi_offset 89, -[[#CAP_SIZE * 2]] | ||
; CHECK-NEXT: cincoffset $c24, $c11, $zero | ||
; CHECK-NEXT: .cfi_def_cfa_register 96 | ||
; CHECK-NEXT: addiu $1, $5, 4 | ||
; CHECK-NEXT: dsll $1, $1, 2 | ||
; CHECK-NEXT: cincoffset $c1, $c3, $1 | ||
; CHECK-NEXT: cmovz $c1, $c3, $4 | ||
; CHECK-NEXT: cmove $c3, $c1 | ||
; CHECK-NEXT: cincoffset $c11, $c24, $zero | ||
; CHECK-NEXT: clc $c17, $zero, 0($c11) | ||
; CHECK-NEXT: clc $c24, $zero, [[#STACKFRAME_SIZE - CAP_SIZE]]($c11) | ||
; CHECK-NEXT: cjr $c17 | ||
; CHECK-NEXT: cincoffset $c11, $c11, [[#STACKFRAME_SIZE]] | ||
entry: | ||
%tobool = icmp eq i32 %test, 0 | ||
%add = add nsw i32 %inInt, 4 | ||
%idx.ext = sext i32 %add to i64 | ||
%add.ptr = getelementptr inbounds i32, i32 addrspace(200)* %inCap, i64 %idx.ext | ||
%ret.0 = select i1 %tobool, i32 addrspace(200)* %inCap, i32 addrspace(200)* %add.ptr | ||
ret i32 addrspace(200)* %ret.0 | ||
} | ||
|
||
attributes #0 = { norecurse nounwind readnone uwtable "correctly-rounded-divide-sqrt-fp-math"="false" "disable-tail-calls"="false" "frame-pointer"="all" "less-precise-fpmad"="false" "min-legal-vector-width"="0" "no-infs-fp-math"="false" "no-jump-tables"="false" "no-nans-fp-math"="false" "no-signed-zeros-fp-math"="false" "no-trapping-math"="false" "stack-protector-buffer-size"="8" "target-cpu"="cheri128" "target-features"="+cheri128,+chericap,+soft-float,-noabicalls" "unsafe-fp-math"="false" "use-soft-float"="true" } |