2012-04-25 03:06:55 +08:00
|
|
|
; RUN: llc -mtriple=thumbv7-apple-ios -relocation-model=pic -disable-fp-elim -mcpu=cortex-a8 < %s
|
|
|
|
|
|
|
|
; CodeGen SplitCriticalEdge() shouldn't try to break edge to a landing pad.
|
|
|
|
; rdar://11300144
|
|
|
|
|
|
|
|
%0 = type opaque
|
|
|
|
%class.FunctionInterpreter.3.15.31 = type { %class.Parser.1.13.29, %class.Parser.1.13.29*, %struct.ParserVariable.2.14.30*, i32 }
|
|
|
|
%class.Parser.1.13.29 = type { i32 (...)**, %class.Parser.1.13.29* }
|
|
|
|
%struct.ParserVariable.2.14.30 = type opaque
|
|
|
|
%struct.ParseErrorMsg.0.12.28 = type { i32, i32, i32 }
|
|
|
|
|
|
|
|
@_ZTI13ParseErrorMsg = external hidden unnamed_addr constant { i8*, i8* }
|
|
|
|
@"OBJC_IVAR_$_MUMathExpressionDoubleBased.mInterpreter" = external hidden global i32, section "__DATA, __objc_ivar", align 4
|
|
|
|
@"\01L_OBJC_SELECTOR_REFERENCES_14" = external hidden global i8*, section "__DATA, __objc_selrefs, literal_pointers, no_dead_strip"
|
|
|
|
|
|
|
|
declare i8* @objc_msgSend(i8*, i8*, ...)
|
|
|
|
|
|
|
|
declare i32 @llvm.eh.typeid.for(i8*) nounwind readnone
|
|
|
|
|
|
|
|
declare i8* @__cxa_begin_catch(i8*)
|
|
|
|
|
Change memcpy/memset/memmove to have dest and source alignments.
Note, this was reviewed (and more details are in) http://lists.llvm.org/pipermail/llvm-commits/Week-of-Mon-20151109/312083.html
These intrinsics currently have an explicit alignment argument which is
required to be a constant integer. It represents the alignment of the
source and dest, and so must be the minimum of those.
This change allows source and dest to each have their own alignments
by using the alignment attribute on their arguments. The alignment
argument itself is removed.
There are a few places in the code for which the code needs to be
checked by an expert as to whether using only src/dest alignment is
safe. For those places, they currently take the minimum of src/dest
alignments which matches the current behaviour.
For example, code which used to read:
call void @llvm.memcpy.p0i8.p0i8.i32(i8* %dest, i8* %src, i32 500, i32 8, i1 false)
will now read:
call void @llvm.memcpy.p0i8.p0i8.i32(i8* align 8 %dest, i8* align 8 %src, i32 500, i1 false)
For out of tree owners, I was able to strip alignment from calls using sed by replacing:
(call.*llvm\.memset.*)i32\ [0-9]*\,\ i1 false\)
with:
$1i1 false)
and similarly for memmove and memcpy.
I then added back in alignment to test cases which needed it.
A similar commit will be made to clang which actually has many differences in alignment as now
IRBuilder can generate different source/dest alignments on calls.
In IRBuilder itself, a new argument was added. Instead of calling:
CreateMemCpy(Dst, Src, getInt64(Size), DstAlign, /* isVolatile */ false)
you now call
CreateMemCpy(Dst, Src, getInt64(Size), DstAlign, SrcAlign, /* isVolatile */ false)
There is a temporary class (IntegerAlignment) which takes the source alignment and rejects
implicit conversion from bool. This is to prevent isVolatile here from passing its default
parameter to the source alignment.
Note, changes in future can now be made to codegen. I didn't change anything here, but this
change should enable better memcpy code sequences.
Reviewed by Hal Finkel.
llvm-svn: 253511
2015-11-19 06:17:24 +08:00
|
|
|
declare void @llvm.memcpy.p0i8.p0i8.i32(i8* nocapture, i8* nocapture, i32, i1) nounwind
|
2012-04-25 03:06:55 +08:00
|
|
|
|
|
|
|
declare void @__cxa_end_catch()
|
|
|
|
|
|
|
|
declare void @_ZSt9terminatev()
|
|
|
|
|
2015-06-18 04:52:32 +08:00
|
|
|
define hidden double @t(%0* %self, i8* nocapture %_cmd) optsize ssp personality i8* bitcast (i32 (...)* @__gxx_personality_sj0 to i8*) {
|
2012-04-25 03:06:55 +08:00
|
|
|
entry:
|
|
|
|
%call = invoke double undef(%class.FunctionInterpreter.3.15.31* undef) optsize
|
|
|
|
to label %try.cont unwind label %lpad
|
|
|
|
|
|
|
|
lpad: ; preds = %entry
|
2015-06-18 04:52:32 +08:00
|
|
|
%0 = landingpad { i8*, i32 }
|
2012-04-25 03:06:55 +08:00
|
|
|
catch i8* bitcast ({ i8*, i8* }* @_ZTI13ParseErrorMsg to i8*)
|
|
|
|
br i1 undef, label %catch, label %eh.resume
|
|
|
|
|
|
|
|
catch: ; preds = %lpad
|
|
|
|
invoke void bitcast (i8* (i8*, i8*, ...)* @objc_msgSend to void (i8*, i8*, %struct.ParseErrorMsg.0.12.28*)*)(i8* undef, i8* undef, %struct.ParseErrorMsg.0.12.28* undef) optsize
|
|
|
|
to label %invoke.cont2 unwind label %lpad1
|
|
|
|
|
|
|
|
invoke.cont2: ; preds = %catch
|
|
|
|
br label %try.cont
|
|
|
|
|
|
|
|
try.cont: ; preds = %invoke.cont2, %entry
|
|
|
|
%value.0 = phi double [ 0x7FF8000000000000, %invoke.cont2 ], [ %call, %entry ]
|
|
|
|
ret double %value.0
|
|
|
|
|
|
|
|
lpad1: ; preds = %catch
|
2015-06-18 04:52:32 +08:00
|
|
|
%1 = landingpad { i8*, i32 }
|
2012-04-25 03:06:55 +08:00
|
|
|
cleanup
|
|
|
|
invoke void @__cxa_end_catch()
|
|
|
|
to label %eh.resume unwind label %terminate.lpad
|
|
|
|
|
|
|
|
eh.resume: ; preds = %lpad1, %lpad
|
|
|
|
resume { i8*, i32 } undef
|
|
|
|
|
|
|
|
terminate.lpad: ; preds = %lpad1
|
2015-06-18 04:52:32 +08:00
|
|
|
%2 = landingpad { i8*, i32 }
|
2012-04-25 03:06:55 +08:00
|
|
|
catch i8* null
|
|
|
|
unreachable
|
|
|
|
}
|
|
|
|
|
|
|
|
declare i32 @__gxx_personality_sj0(...)
|
|
|
|
|
|
|
|
!llvm.module.flags = !{!0, !1, !2, !3}
|
|
|
|
|
IR: Make metadata typeless in assembly
Now that `Metadata` is typeless, reflect that in the assembly. These
are the matching assembly changes for the metadata/value split in
r223802.
- Only use the `metadata` type when referencing metadata from a call
intrinsic -- i.e., only when it's used as a `Value`.
- Stop pretending that `ValueAsMetadata` is wrapped in an `MDNode`
when referencing it from call intrinsics.
So, assembly like this:
define @foo(i32 %v) {
call void @llvm.foo(metadata !{i32 %v}, metadata !0)
call void @llvm.foo(metadata !{i32 7}, metadata !0)
call void @llvm.foo(metadata !1, metadata !0)
call void @llvm.foo(metadata !3, metadata !0)
call void @llvm.foo(metadata !{metadata !3}, metadata !0)
ret void, !bar !2
}
!0 = metadata !{metadata !2}
!1 = metadata !{i32* @global}
!2 = metadata !{metadata !3}
!3 = metadata !{}
turns into this:
define @foo(i32 %v) {
call void @llvm.foo(metadata i32 %v, metadata !0)
call void @llvm.foo(metadata i32 7, metadata !0)
call void @llvm.foo(metadata i32* @global, metadata !0)
call void @llvm.foo(metadata !3, metadata !0)
call void @llvm.foo(metadata !{!3}, metadata !0)
ret void, !bar !2
}
!0 = !{!2}
!1 = !{i32* @global}
!2 = !{!3}
!3 = !{}
I wrote an upgrade script that handled almost all of the tests in llvm
and many of the tests in cfe (even handling many `CHECK` lines). I've
attached it (or will attach it in a moment if you're speedy) to PR21532
to help everyone update their out-of-tree testcases.
This is part of PR21532.
llvm-svn: 224257
2014-12-16 03:07:53 +08:00
|
|
|
!0 = !{i32 1, !"Objective-C Version", i32 2}
|
|
|
|
!1 = !{i32 1, !"Objective-C Image Info Version", i32 0}
|
|
|
|
!2 = !{i32 1, !"Objective-C Image Info Section", !"__DATA, __objc_imageinfo, regular, no_dead_strip"}
|
|
|
|
!3 = !{i32 4, !"Objective-C Garbage Collection", i32 0}
|