Skip to content

Instantly share code, notes, and snippets.

@cheshire

cheshire/bad_input_ir_opt Secret

Last active Feb 7, 2020
Embed
What would you like to do?
Bad input IR (opt)
; ModuleID = '__compute_module'
source_filename = "__compute_module"
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-grtev4-linux-gnu"
; Function Attrs: nounwind uwtable
define void @EntryModule(i8* nocapture readnone %retval, i8* noalias %run_options, i8** noalias nocapture readnone %params, i8** noalias nocapture readonly %buffer_table, i64* noalias nocapture readnone %prof_counters) local_unnamed_addr #0 {
entry:
%0 = getelementptr inbounds i8*, i8** %buffer_table, i64 2
%1 = bitcast i8** %0 to i64**
%2 = load i64*, i64** %1, align 8, !invariant.load !0, !dereferenceable !1, !align !1
%3 = load i8*, i8** %buffer_table, align 8, !invariant.load !0, !dereferenceable !2, !align !1
%4 = load i64, i64* %2, align 8, !invariant.load !0, !noalias !3
%5 = insertelement <4 x i64> undef, i64 %4, i32 0
%6 = shufflevector <4 x i64> %5, <4 x i64> undef, <4 x i32> zeroinitializer
%7 = bitcast i8* %3 to <4 x i64>*
store <4 x i64> %6, <4 x i64>* %7, align 8, !alias.scope !8, !noalias !9
%8 = getelementptr inbounds i8*, i8** %buffer_table, i64 3
%9 = bitcast i8** %8 to [2 x [2 x double]]**
%10 = load [2 x [2 x double]]*, [2 x [2 x double]]** %9, align 8, !invariant.load !0, !dereferenceable !10, !align !1
%11 = getelementptr inbounds [2 x [2 x double]], [2 x [2 x double]]* %10, i64 0, i64 0, i64 0
%12 = bitcast i8* %3 to double*
tail call void @__xla_cpu_runtime_EigenMatMulF64(i8* %run_options, double* %11, double* %12, double* %12, i64 2, i64 2, i64 2, i32 1, i32 0)
%13 = getelementptr inbounds i8*, i8** %buffer_table, i64 1
%14 = bitcast i8** %13 to [3 x [3 x double]]**
%15 = load [3 x [3 x double]]*, [3 x [3 x double]]** %14, align 8, !invariant.load !0, !dereferenceable !11, !align !1
%16 = bitcast i64 %4 to double
%17 = fcmp fast one double %16, 0.000000e+00
%18 = uitofp i1 %17 to double
%19 = tail call fast double @llvm.copysign.f64(double %18, double %16)
%20 = fmul fast double %19, %19
%21 = insertelement <4 x double> undef, double %20, i32 0
%22 = shufflevector <4 x double> %21, <4 x double> undef, <4 x i32> zeroinitializer
%23 = insertelement <2 x double> undef, double %20, i32 0
%24 = shufflevector <2 x double> %23, <2 x double> undef, <2 x i32> zeroinitializer
%25 = getelementptr inbounds [3 x [3 x double]], [3 x [3 x double]]* %15, i64 0, i64 0, i64 0
%26 = load double, double* %25, align 8, !invariant.load !0, !noalias !12
%27 = bitcast [2 x [2 x double]]* %10 to <2 x double>*
%28 = load <2 x double>, <2 x double>* %27, align 8, !alias.scope !9, !noalias !13
%shuffle = shufflevector <2 x double> %28, <2 x double> undef, <4 x i32> <i32 0, i32 undef, i32 undef, i32 undef>
%29 = insertelement <4 x double> undef, double %26, i32 0
%30 = fmul fast <4 x double> %29, %shuffle
%31 = fmul fast <4 x double> %22, %30
%32 = shufflevector <4 x double> %31, <4 x double> <double undef, double 0.000000e+00, double 0.000000e+00, double 0.000000e+00>, <4 x i32> <i32 0, i32 5, i32 6, i32 7>
%33 = bitcast i8* %3 to <4 x double>*
store <4 x double> %32, <4 x double>* %33, align 8, !alias.scope !14, !noalias !9
%34 = getelementptr inbounds i8, i8* %3, i64 32
%35 = bitcast i8* %34 to <2 x double>*
store <2 x double> zeroinitializer, <2 x double>* %35, align 8, !alias.scope !14, !noalias !9
%36 = getelementptr inbounds i8, i8* %3, i64 48
%37 = getelementptr inbounds [3 x [3 x double]], [3 x [3 x double]]* %15, i64 0, i64 1, i64 1
%38 = bitcast double* %37 to <2 x double>*
%39 = load <2 x double>, <2 x double>* %38, align 8, !invariant.load !0, !noalias !12
%40 = bitcast [2 x [2 x double]]* %10 to <2 x double>*
%41 = load <2 x double>, <2 x double>* %40, align 8, !alias.scope !9, !noalias !13
%42 = fmul fast <2 x double> %39, %41
%43 = shufflevector <2 x double> %42, <2 x double> undef, <4 x i32> <i32 undef, i32 0, i32 undef, i32 undef>
%44 = fmul fast <4 x double> %22, %43
%45 = shufflevector <4 x double> <double 0.000000e+00, double undef, double 0.000000e+00, double 0.000000e+00>, <4 x double> %44, <4 x i32> <i32 0, i32 5, i32 2, i32 3>
%46 = bitcast i8* %36 to <4 x double>*
store <4 x double> %45, <4 x double>* %46, align 8, !alias.scope !14, !noalias !9
%47 = getelementptr inbounds i8, i8* %3, i64 80
%48 = bitcast i8* %47 to <2 x double>*
store <2 x double> zeroinitializer, <2 x double>* %48, align 8, !alias.scope !14, !noalias !9
%49 = getelementptr inbounds i8, i8* %3, i64 96
%50 = getelementptr inbounds [3 x [3 x double]], [3 x [3 x double]]* %15, i64 0, i64 2, i64 1
%51 = bitcast double* %50 to <2 x double>*
%52 = load <2 x double>, <2 x double>* %51, align 8, !invariant.load !0, !noalias !12
%53 = bitcast [2 x [2 x double]]* %10 to <2 x double>*
%54 = load <2 x double>, <2 x double>* %53, align 8, !alias.scope !9, !noalias !13
%shuffle.2 = shufflevector <2 x double> %54, <2 x double> undef, <4 x i32> <i32 undef, i32 undef, i32 0, i32 undef>
%55 = shufflevector <2 x double> %52, <2 x double> undef, <4 x i32> <i32 undef, i32 undef, i32 1, i32 undef>
%56 = fmul fast <4 x double> %55, %shuffle.2
%57 = fmul fast <4 x double> %22, %56
%58 = shufflevector <4 x double> <double 0.000000e+00, double 0.000000e+00, double undef, double 0.000000e+00>, <4 x double> %57, <4 x i32> <i32 0, i32 1, i32 6, i32 3>
%59 = bitcast i8* %49 to <4 x double>*
store <4 x double> %58, <4 x double>* %59, align 8, !alias.scope !14, !noalias !9
%60 = getelementptr inbounds i8, i8* %3, i64 128
%61 = bitcast i8* %60 to <2 x double>*
store <2 x double> zeroinitializer, <2 x double>* %61, align 8, !alias.scope !14, !noalias !9
%62 = getelementptr inbounds [2 x [2 x double]], [2 x [2 x double]]* %10, i64 0, i64 1, i64 0
%63 = getelementptr inbounds [3 x [3 x double]], [3 x [3 x double]]* %15, i64 0, i64 0, i64 0
%64 = load double, double* %63, align 8, !invariant.load !0, !noalias !12
%65 = getelementptr inbounds i8, i8* %3, i64 144
%66 = bitcast double* %62 to <2 x double>*
%67 = load <2 x double>, <2 x double>* %66, align 8, !alias.scope !9, !noalias !13
%shuffle.3 = shufflevector <2 x double> %67, <2 x double> undef, <4 x i32> <i32 undef, i32 undef, i32 undef, i32 1>
%68 = insertelement <4 x double> undef, double %64, i32 3
%69 = fmul fast <4 x double> %68, %shuffle.3
%70 = fmul fast <4 x double> %22, %69
%71 = shufflevector <4 x double> <double 0.000000e+00, double 0.000000e+00, double 0.000000e+00, double undef>, <4 x double> %70, <4 x i32> <i32 0, i32 1, i32 2, i32 7>
%72 = bitcast i8* %65 to <4 x double>*
store <4 x double> %71, <4 x double>* %72, align 8, !alias.scope !14, !noalias !9
%73 = getelementptr inbounds i8, i8* %3, i64 176
%74 = bitcast i8* %73 to <2 x double>*
store <2 x double> zeroinitializer, <2 x double>* %74, align 8, !alias.scope !14, !noalias !9
%75 = getelementptr inbounds [2 x [2 x double]], [2 x [2 x double]]* %10, i64 0, i64 1, i64 0
%76 = getelementptr inbounds i8, i8* %3, i64 192
%77 = getelementptr inbounds [3 x [3 x double]], [3 x [3 x double]]* %15, i64 0, i64 1, i64 1
%78 = bitcast double* %77 to <2 x double>*
%79 = load <2 x double>, <2 x double>* %78, align 8, !invariant.load !0, !noalias !12
%80 = bitcast double* %75 to <2 x double>*
%81 = load <2 x double>, <2 x double>* %80, align 8, !alias.scope !9, !noalias !13
%82 = bitcast i8* %76 to <4 x double>*
store <4 x double> zeroinitializer, <4 x double>* %82, align 8, !alias.scope !14, !noalias !9
%83 = getelementptr inbounds i8, i8* %3, i64 224
%84 = shufflevector <2 x double> %81, <2 x double> undef, <2 x i32> <i32 1, i32 undef>
%85 = fmul fast <2 x double> %79, %84
%86 = fmul fast <2 x double> %24, %85
%87 = insertelement <2 x double> %86, double 0.000000e+00, i32 1
%88 = bitcast i8* %83 to <2 x double>*
store <2 x double> %87, <2 x double>* %88, align 8, !alias.scope !14, !noalias !9
%89 = getelementptr inbounds [2 x [2 x double]], [2 x [2 x double]]* %10, i64 0, i64 1, i64 0
%90 = getelementptr inbounds i8, i8* %3, i64 240
%91 = getelementptr inbounds [3 x [3 x double]], [3 x [3 x double]]* %15, i64 0, i64 2, i64 1
%92 = bitcast double* %91 to <2 x double>*
%93 = load <2 x double>, <2 x double>* %92, align 8, !invariant.load !0, !noalias !12
%94 = bitcast double* %89 to <2 x double>*
%95 = load <2 x double>, <2 x double>* %94, align 8, !alias.scope !9, !noalias !13
%96 = bitcast i8* %90 to <4 x double>*
store <4 x double> zeroinitializer, <4 x double>* %96, align 8, !alias.scope !14, !noalias !9
%97 = getelementptr inbounds i8, i8* %3, i64 272
%98 = fmul fast <2 x double> %93, %95
%99 = fmul fast <2 x double> %24, %98
%100 = insertelement <2 x double> %99, double 0.000000e+00, i32 0
%101 = bitcast i8* %97 to <2 x double>*
store <2 x double> %100, <2 x double>* %101, align 8, !alias.scope !14, !noalias !9
ret void
}
; Function Attrs: argmemonly nounwind
declare void @__xla_cpu_runtime_EigenMatMulF64(i8*, double*, double*, double*, i64, i64, i64, i32, i32) local_unnamed_addr #1
; Function Attrs: nounwind readnone speculatable willreturn
declare double @llvm.copysign.f64(double, double) #2
attributes #0 = { nounwind uwtable "denormal-fp-math"="preserve-sign" "no-frame-pointer-elim"="false" }
attributes #1 = { argmemonly nounwind }
attributes #2 = { nounwind readnone speculatable willreturn }
!0 = !{}
!1 = !{i64 8}
!2 = !{i64 288}
!3 = !{!4, !6, !7}
!4 = !{!"buffer: {index:0, offset:0, size:32}", !5}
!5 = !{!"XLA global AA domain"}
!6 = !{!"buffer: {index:0, offset:0, size:288}", !5}
!7 = !{!"buffer: {index:3, offset:0, size:32}", !5}
!8 = !{!4}
!9 = !{!7}
!10 = !{i64 32}
!11 = !{i64 72}
!12 = !{!6, !7}
!13 = !{!4, !6}
!14 = !{!6}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment