Skip to content

Instantly share code, notes, and snippets.

@chapuni
Created January 29, 2014 10:26
Show Gist options
  • Save chapuni/8685284 to your computer and use it in GitHub Desktop.
Save chapuni/8685284 to your computer and use it in GitHub Desktop.
-sroa inducts undef... {i8,i8,i8} to i32
; ModuleID = '<stdin>'
target datalayout = "e-m:e-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-redhat-linux"
module asm "\09.ident\09\22GCC: (GNU) 4.7.2 20121015 (Red Hat 4.7.2-5) LLVM: \22"
%struct.SourceRange = type { %struct.SourceLocation, %struct.SourceLocation }
%struct.SourceLocation = type { i32 }
%struct.CharSourceRange = type { %struct.SourceRange, i8, [3 x i8] }
%struct.RewriteOptions = type { i8, i8, i8 }
%struct.Rewriter = type { %struct.SourceManager*, %struct.LangOptions*, %struct.map }
%struct.SourceManager = type { %struct.RefCountedBase, %struct.DiagnosticsEngine*, %struct.FileManager*, %struct.BumpPtrAllocator, %struct.DenseMap.24, i8, i8, %struct.OwningPtr.29, %struct.vector.32, %struct.SmallVector.39, %struct.SmallVector.39, i32, i32, %struct.vector.40, %struct.ExternalSLocEntrySource*, %struct.FileID, %struct.LineTableInfo*, %struct.FileID, %struct.ContentCache*, i32, i32, %struct.FileID, %struct.FileID, i32, i32, %struct.DenseMap.42, %struct.DenseMap.44, %struct.InBeforeInTUCacheEntry, %struct.MemoryBuffer*, %struct.ContentCache*, %struct.DenseMap.46, %struct.SmallVector.52 }
%struct.RefCountedBase = type { i32 }
%struct.DiagnosticsEngine = type { %struct.RefCountedBase.0, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i32, i32, i32, i32, i32, %struct.IntrusiveRefCntPtr, %struct.IntrusiveRefCntPtr.3, %struct.DiagnosticConsumer*, i8, %struct.SourceManager*, %struct.list, %struct.vector.55, %struct.vector.6, i8, i8, i8, i8, i32, i32, i32, i32, i32, i32, i8*, void (i32, i64, i8*, i32, i8*, i32, %struct.pair.7*, i32, %struct.SmallVectorImpl*, i8*, %struct.ArrayRef*)*, i32, %struct.basic_string, %struct.basic_string, %struct.SourceLocation, i32, i8, i8, i8, [10 x i8], [10 x %struct.basic_string], [10 x i64], [10 x %struct.CharSourceRange], [10 x %struct.FixItHint] }
%struct.RefCountedBase.0 = type { i32 }
%struct.IntrusiveRefCntPtr = type { %struct.DiagnosticIDs* }
%struct.DiagnosticIDs = type { %struct.RefCountedBase.1, %struct.CustomDiagInfo* }
%struct.RefCountedBase.1 = type { i32 }
%struct.CustomDiagInfo = type opaque
%struct.IntrusiveRefCntPtr.3 = type { %struct.DiagnosticOptions* }
%struct.DiagnosticOptions = type { %struct.RefCountedBase.2, i8, i8, i8, i32, i32, i32, i32, i32, i32, i8, %struct.basic_string, %struct.basic_string, %struct.vector }
%struct.RefCountedBase.2 = type { i32 }
%struct.vector = type { %struct._Vector_base }
%struct._Vector_base = type { %struct._Vector_impl }
%struct._Vector_impl = type { %struct.basic_string*, %struct.basic_string*, %struct.basic_string* }
%struct.DiagnosticConsumer = type { i32 (...)**, i32, i32 }
%struct.list = type { %struct._List_base }
%struct._List_base = type { %struct._List_impl }
%struct._List_impl = type { %struct._List_node_base }
%struct._List_node_base = type { %struct._List_node_base*, %struct._List_node_base* }
%struct.vector.55 = type { %struct._Vector_base.54 }
%struct._Vector_base.54 = type { %struct._Vector_impl.53 }
%struct._Vector_impl.53 = type { %struct.DiagStatePoint*, %struct.DiagStatePoint*, %struct.DiagStatePoint* }
%struct.DiagStatePoint = type { %struct.DiagState*, %struct.FullSourceLoc }
%struct.DiagState = type { %struct.DenseMap }
%struct.DenseMap = type { %struct.pair*, i32, i32, i32, [4 x i8] }
%struct.pair = type { i32, %struct.DiagnosticMappingInfo }
%struct.DiagnosticMappingInfo = type { i8, [3 x i8] }
%struct.FullSourceLoc = type { %struct.SourceLocation, %struct.SourceManager* }
%struct.vector.6 = type { %struct._Vector_base.5 }
%struct._Vector_base.5 = type { %struct._Vector_impl.4 }
%struct._Vector_impl.4 = type { %struct.DiagState**, %struct.DiagState**, %struct.DiagState** }
%struct.pair.7 = type opaque
%struct.SmallVectorImpl = type { [25 x i8], [7 x i8] }
%struct.ArrayRef = type { i64*, i64 }
%struct.basic_string = type { %struct._Alloc_hider }
%struct._Alloc_hider = type { i8* }
%struct.FixItHint = type { %struct.CharSourceRange, %struct.CharSourceRange, %struct.basic_string, i8, [7 x i8] }
%struct.FileManager = type { %struct.RefCountedBase.8, %struct.FileSystemOptions, %struct.UniqueDirContainer*, %struct.UniqueFileContainer*, %struct.SmallVector, %struct.SmallVector.19, %struct.StringMap, %struct.StringMap.20, %struct.DenseMap.22, %struct.BumpPtrAllocator, i32, i32, i32, i32, i32, %struct.OwningPtr }
%struct.RefCountedBase.8 = type { i32 }
%struct.FileSystemOptions = type { %struct.basic_string }
%struct.UniqueDirContainer = type opaque
%struct.UniqueFileContainer = type opaque
%struct.SmallVector = type { %struct.SmallVectorImpl.13, %struct.SmallVectorStorage }
%struct.SmallVectorImpl.13 = type { %struct.SmallVectorTemplateBase.12 }
%struct.SmallVectorTemplateBase.12 = type { %struct.SmallVectorTemplateCommon.11 }
%struct.SmallVectorTemplateCommon.11 = type { %struct.SmallVectorBase, %struct.AlignedCharArrayUnion.10 }
%struct.SmallVectorBase = type { i8*, i8*, i8* }
%struct.AlignedCharArrayUnion.10 = type { %struct.AlignedCharArray.9 }
%struct.AlignedCharArray.9 = type { [8 x i8] }
%struct.SmallVectorStorage = type { [3 x %struct.AlignedCharArrayUnion.10] }
%struct.SmallVector.19 = type { %struct.SmallVectorImpl.17, %struct.SmallVectorStorage.18 }
%struct.SmallVectorImpl.17 = type { %struct.SmallVectorTemplateBase.16 }
%struct.SmallVectorTemplateBase.16 = type { %struct.SmallVectorTemplateCommon.15 }
%struct.SmallVectorTemplateCommon.15 = type { %struct.SmallVectorBase, %struct.AlignedCharArrayUnion.14 }
%struct.AlignedCharArrayUnion.14 = type { %struct.AlignedCharArray.9 }
%struct.SmallVectorStorage.18 = type { [3 x %struct.AlignedCharArrayUnion.14] }
%struct.StringMap = type { %struct.StringMapImpl, %struct.BumpPtrAllocator }
%struct.StringMapImpl = type { %struct.StringMapEntryBase**, i32, i32, i32, i32 }
%struct.StringMapEntryBase = type { i32 }
%struct.StringMap.20 = type { %struct.StringMapImpl, %struct.BumpPtrAllocator }
%struct.DenseMap.22 = type { %struct.pair.21*, i32, i32, i32, [4 x i8] }
%struct.pair.21 = type opaque
%struct.OwningPtr = type { %struct.FileSystemStatCache* }
%struct.FileSystemStatCache = type opaque
%struct.BumpPtrAllocator = type { i64, i64, %struct.MallocSlabAllocator, %struct.SlabAllocator*, %struct.MemSlab*, i8*, i8*, i64 }
%struct.MallocSlabAllocator = type { %struct.SlabAllocator, %struct.MallocAllocator, [7 x i8] }
%struct.SlabAllocator = type { i32 (...)** }
%struct.MallocAllocator = type { i8 }
%struct.MemSlab = type { i64, %struct.MemSlab* }
%struct.DenseMap.24 = type { %struct.pair.23*, i32, i32, i32, [4 x i8] }
%struct.pair.23 = type { %struct.FileEntry*, %struct.ContentCache* }
%struct.FileEntry = type { i8*, i64, i64, %struct.DirectoryEntry*, i32, %struct.UniqueID, i8, i8, i32 }
%struct.DirectoryEntry = type { i8* }
%struct.UniqueID = type { i64, i64 }
%struct.OwningPtr.29 = type { %struct.OverriddenFilesInfoTy* }
%struct.OverriddenFilesInfoTy = type { %struct.DenseMap.26, %struct.DenseSet }
%struct.DenseMap.26 = type { %struct.pair.25*, i32, i32, i32, [4 x i8] }
%struct.pair.25 = type { %struct.FileEntry*, %struct.FileEntry* }
%struct.DenseSet = type { %struct.DenseMap.28 }
%struct.DenseMap.28 = type { %struct.pair.27*, i32, i32, i32, [4 x i8] }
%struct.pair.27 = type { %struct.FileEntry*, i8, [7 x i8] }
%struct.vector.32 = type { %struct._Vector_base.31 }
%struct._Vector_base.31 = type { %struct._Vector_impl.30 }
%struct._Vector_impl.30 = type { %struct.ContentCache**, %struct.ContentCache**, %struct.ContentCache** }
%struct.SmallVector.39 = type { %struct.SmallVectorImpl.37, %struct.SmallVectorStorage.38, [7 x i8] }
%struct.SmallVectorImpl.37 = type { %struct.SmallVectorTemplateBase.36 }
%struct.SmallVectorTemplateBase.36 = type { %struct.SmallVectorTemplateCommon.35 }
%struct.SmallVectorTemplateCommon.35 = type { %struct.SmallVectorBase, %struct.AlignedCharArrayUnion.34 }
%struct.AlignedCharArrayUnion.34 = type { %struct.AlignedCharArray.33 }
%struct.AlignedCharArray.33 = type { [24 x i8] }
%struct.SmallVectorStorage.38 = type { i8 }
%struct.vector.40 = type { %struct._Bvector_base }
%struct._Bvector_base = type { %struct._Bvector_impl }
%struct._Bvector_impl = type { %struct._Bit_iterator, %struct._Bit_iterator, i64* }
%struct._Bit_iterator = type { [12 x i8], [4 x i8] }
%struct.ExternalSLocEntrySource = type { i32 (...)** }
%struct.LineTableInfo = type opaque
%struct.FileID = type { i32 }
%struct.DenseMap.42 = type { %struct.pair.41*, i32, i32, i32, [4 x i8] }
%struct.pair.41 = type opaque
%struct.DenseMap.44 = type { %struct.pair.43*, i32, i32, i32, [4 x i8] }
%struct.pair.43 = type opaque
%struct.InBeforeInTUCacheEntry = type { %struct.FileID, %struct.FileID, i8, %struct.FileID, i32, i32 }
%struct.MemoryBuffer = type { i32 (...)**, i8*, i8* }
%struct.ContentCache = type { %struct.PointerIntPair, %struct.FileEntry*, %struct.FileEntry*, i32*, i32, i8, [3 x i8] }
%struct.PointerIntPair = type { i64 }
%struct.DenseMap.46 = type { %struct.pair.45*, i32, i32, i32, [4 x i8] }
%struct.pair.45 = type opaque
%struct.SmallVector.52 = type { %struct.SmallVectorImpl.50, %struct.SmallVectorStorage.51 }
%struct.SmallVectorImpl.50 = type { %struct.SmallVectorTemplateBase.49 }
%struct.SmallVectorTemplateBase.49 = type { %struct.SmallVectorTemplateCommon.48 }
%struct.SmallVectorTemplateCommon.48 = type { %struct.SmallVectorBase, %struct.AlignedCharArrayUnion.47 }
%struct.AlignedCharArrayUnion.47 = type { %struct.AlignedCharArray.33 }
%struct.SmallVectorStorage.51 = type { [1 x %struct.AlignedCharArrayUnion.47] }
%struct.LangOptions = type { %struct.RefCountedBase.56, [62 x i8], %struct.ObjCRuntime, %struct.basic_string, %struct.basic_string, %struct.basic_string, %struct.CommentOptions }
%struct.RefCountedBase.56 = type { i32 }
%struct.ObjCRuntime = type { i32, %struct.VersionTuple }
%struct.VersionTuple = type { i32, i32, i32, i8, [3 x i8] }
%struct.CommentOptions = type { %struct.vector, i8, [7 x i8] }
%struct.map = type { %struct._Rb_tree }
%struct._Rb_tree = type { %struct._Rb_tree_impl }
%struct._Rb_tree_impl = type { %struct.less, %struct._Rb_tree_node_base, i64 }
%struct.less = type { i8 }
%struct._Rb_tree_node_base = type { i32, %struct._Rb_tree_node_base*, %struct._Rb_tree_node_base*, %struct._Rb_tree_node_base* }
%struct.RewritesApplicator = type { %struct.RewriteReceiver, %struct.Rewriter*, %struct.RewriteListener* }
%struct.RewriteReceiver = type { i32 (...)** }
%struct.RewriteListener = type { i32 (...)** }
; Function Attrs: inlinehint nounwind readonly uwtable
define linkonce_odr hidden i32 @_ZNK5clang11SourceRange8getBeginEv(%struct.SourceRange* %this) #0 align 2 {
entry:
%tmp2 = getelementptr inbounds %struct.SourceRange* %this, i64 0, i32 0, i32 0
%tmp3 = load i32* %tmp2, align 4
ret i32 %tmp3
}
; Function Attrs: inlinehint nounwind readonly uwtable
define linkonce_odr hidden i32 @_ZNK5clang15CharSourceRange8getBeginEv(%struct.CharSourceRange* %this) #0 align 2 {
entry:
%tmp1 = getelementptr inbounds %struct.CharSourceRange* %this, i64 0, i32 0
%tmp2 = call i32 @_ZNK5clang11SourceRange8getBeginEv(%struct.SourceRange* %tmp1) #3
ret i32 %tmp2
}
; Function Attrs: inlinehint nounwind uwtable
define linkonce_odr hidden void @_ZN5clang8Rewriter14RewriteOptionsC2Ev(%struct.RewriteOptions* nocapture %this) unnamed_addr #1 align 2 {
entry:
%tmp = getelementptr inbounds %struct.RewriteOptions* %this, i64 0, i32 0
store i8 1, i8* %tmp, align 1
%tmp1 = getelementptr inbounds %struct.RewriteOptions* %this, i64 0, i32 1
store i8 1, i8* %tmp1, align 1
%tmp2 = getelementptr inbounds %struct.RewriteOptions* %this, i64 0, i32 2
store i8 0, i8* %tmp2, align 1
ret void
}
; Function Attrs: inlinehint nounwind uwtable
define linkonce_odr hidden zeroext i8 @_ZN5clang8Rewriter10RemoveTextENS_15CharSourceRangeENS0_14RewriteOptionsE(%struct.Rewriter* %this, i64 %range.0, i64 %range.1, i32 %opts.0) #1 align 2 {
entry:
%range_addr = alloca %struct.CharSourceRange, align 8
%tmp = bitcast %struct.CharSourceRange* %range_addr to i64*
store i64 %range.0, i64* %tmp, align 8
%tmp1 = getelementptr inbounds %struct.CharSourceRange* %range_addr, i64 0, i32 1
%tmp2 = bitcast i8* %tmp1 to i32*
%tmp3 = trunc i64 %range.1 to i32
store i32 %tmp3, i32* %tmp2, align 8
%tmp7 = call i32 @_ZNK5clang8Rewriter12getRangeSizeERKNS_15CharSourceRangeENS0_14RewriteOptionsE(%struct.Rewriter* %this, %struct.CharSourceRange* %range_addr, i32 undef) #3
%tmp8 = call i32 @_ZNK5clang15CharSourceRange8getBeginEv(%struct.CharSourceRange* %range_addr) #3
%tmp10 = call zeroext i8 @_ZN5clang8Rewriter10RemoveTextENS_14SourceLocationEjNS0_14RewriteOptionsE(%struct.Rewriter* %this, i32 %tmp8, i32 %tmp7, i32 undef) #3
%tmp11 = and i8 %tmp10, 1
ret i8 %tmp11
}
declare i32 @_ZNK5clang8Rewriter12getRangeSizeERKNS_15CharSourceRangeENS0_14RewriteOptionsE(%struct.Rewriter*, %struct.CharSourceRange*, i32)
declare zeroext i8 @_ZN5clang8Rewriter10RemoveTextENS_14SourceLocationEjNS0_14RewriteOptionsE(%struct.Rewriter*, i32, i32, i32)
; Function Attrs: nounwind uwtable
define void @_ZN18RewritesApplicator6removeEN5clang15CharSourceRangeE(%struct.RewritesApplicator* %this, i64 %range.0, i64 %range.1) unnamed_addr #2 align 2 {
entry:
%removeOpts = alloca %struct.RewriteOptions, align 8
%tmp3 = trunc i64 %range.1 to i32
call void @_ZN5clang8Rewriter14RewriteOptionsC2Ev(%struct.RewriteOptions* %removeOpts) #3
%tmp5 = getelementptr inbounds %struct.RewriteOptions* %removeOpts, i64 0, i32 0
store i8 0, i8* %tmp5, align 8
%tmp6 = getelementptr inbounds %struct.RewriteOptions* %removeOpts, i64 0, i32 1
store i8 0, i8* %tmp6, align 1
%tmp7 = getelementptr inbounds %struct.RewriteOptions* %removeOpts, i64 0, i32 2
store i8 1, i8* %tmp7, align 2
%tmp8 = getelementptr inbounds %struct.RewritesApplicator* %this, i64 0, i32 1
%tmp9 = load %struct.Rewriter** %tmp8, align 8
%tmp14 = zext i32 %tmp3 to i64
%tmp15 = bitcast %struct.RewriteOptions* %removeOpts to i32*
%val1 = load i32* %tmp15, align 8
%tmp16 = call zeroext i8 @_ZN5clang8Rewriter10RemoveTextENS_15CharSourceRangeENS0_14RewriteOptionsE(%struct.Rewriter* %tmp9, i64 %range.0, i64 %tmp14, i32 %val1) #3
%tmp17 = and i8 %tmp16, 1
%not = icmp eq i8 %tmp17, 0
br i1 %not, label %"3", label %"5"
"3": ; preds = %entry
%tmp18 = getelementptr inbounds %struct.RewritesApplicator* %this, i64 0, i32 2
%tmp19 = load %struct.RewriteListener** %tmp18, align 8
%tmp20 = icmp eq %struct.RewriteListener* %tmp19, null
br i1 %tmp20, label %"5", label %"4"
"4": ; preds = %"3"
%tmp21 = getelementptr inbounds %struct.RewritesApplicator* %this, i64 0, i32 2
%tmp22 = load %struct.RewriteListener** %tmp21, align 8
%tmp23 = getelementptr inbounds %struct.RewriteListener* %tmp22, i64 0, i32 0
%tmp24 = load i32 (...)*** %tmp23, align 8
%tmp25 = getelementptr i32 (...)** %tmp24, i64 5
%tmp26 = load i32 (...)** %tmp25, align 8
%tmp27 = bitcast i32 (...)* %tmp26 to void (%struct.RewriteListener*, i64, i64)*
%tmp32 = zext i32 %tmp3 to i64
call void %tmp27(%struct.RewriteListener* %tmp22, i64 %range.0, i64 %tmp32) #3
br label %"5"
"5": ; preds = %"4", %"3", %entry
%tmp33 = getelementptr inbounds %struct.RewriteOptions* %removeOpts, i64 0, i32 0
call void @llvm.lifetime.end(i64 3, i8* %tmp33)
ret void
}
; Function Attrs: nounwind
declare void @llvm.lifetime.end(i64, i8* nocapture) #3
attributes #0 = { inlinehint nounwind readonly uwtable "no-frame-pointer-elim-non-leaf"="true" }
attributes #1 = { inlinehint nounwind uwtable "no-frame-pointer-elim-non-leaf"="true" }
attributes #2 = { nounwind uwtable "no-frame-pointer-elim-non-leaf"="true" }
attributes #3 = { nounwind }
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment