Skip to content
This repository has been archived by the owner on Jun 10, 2024. It is now read-only.

How to translate GLSL file to LLVM's .bc file? #71

Open
SakuraXiaMF opened this issue Sep 7, 2019 · 4 comments
Open

How to translate GLSL file to LLVM's .bc file? #71

SakuraXiaMF opened this issue Sep 7, 2019 · 4 comments

Comments

@SakuraXiaMF
Copy link

Hey,I am asking question again~~

My LLVM version is LLVM-4.0
Initially,I saved 130.frag.out file's bottom IR part as a.ll file.
Then, I use llvm-as to translate a.ll file to a.bc file,
but I get an error :"error: expected comma after load's type %0 = load i32 addrspace(1)* @sampc, !gla.uniform !50"

Then I saved 130.frag.out file's Top IR part as b.ll file.Next,I use llvm-as to translate b.ll file to b.bc file,I get an error again: "error: expected comma after getelementptr's type
%1 = call i32 @cudaSetupArgument(i8* %0, i64 ptrtoint (i32* getelementptr (i32* null, i32 1) to i64), i64 0)"

So,our program how to translate GLSL file to LLVM's .bc file??

@SakuraXiaMF
Copy link
Author

This is Top IR
@o = global <4 x float> zeroinitializer
@samp2D = external addrspace(1) constant i32
@samp2DA = external addrspace(1) constant i32
@samp2DR = external addrspace(1) constant i32
@samp2DS = external addrspace(1) constant i32
@io = global <3 x i32> zeroinitializer
@sca = external addrspace(1) constant i32
@i = global <4 x float> zeroinitializer
@Isca = external addrspace(1) constant i32
@uo = global <4 x i32> zeroinitializer
@USCA = external addrspace(1) constant i32
@A = internal global <3 x float> zeroinitializer
@SCAS = external addrspace(1) constant i32
@S2dR = external addrspace(1) constant i32
@v2 = external addrspace(2) constant <2 x float>
@V3 = external addrspace(2) constant <3 x float>
@v4 = external addrspace(2) constant <4 x float>
@s2DRS = external addrspace(1) constant i32
@s1d = external addrspace(1) constant i32
@f = external addrspace(2) constant float
@S2D = external addrspace(1) constant i32
@S2DS = external addrspace(1) constant i32
@sampc = external addrspace(1) constant i32
@gl_ClipDistance = global [4 x float] zeroinitializer
@b = internal global float 0.000000e+00
@FFlat = global float 0.000000e+00
@fSmooth = global float 0.000000e+00
@fnop = global float 0.000000e+00
@gl_Color = global <4 x float> zeroinitializer
@bounds = external addrspace(1) constant i32

define fastcc void @main() {
entry:
%ai = alloca [3 x i32]
br label %mainBody

mainBody: ; preds = %entry
%0 = load i32 addrspace(1)* @sampc, !gla.uniform !50
%o = call <4 x float> @llvm.gla.fTexelGather.v4f32.v3f32(i32 4, i32 %0, i32 64, <3 x float> <float 0x3FC99999A0000000, float 0x3FC99999A0000000, float 0x3FC99999A0000000>, i32 undef, float undef)
store <4 x float> %o, <4 x float>* @o
%1 = load float* getelementptr inbounds ([4 x float]* @gl_ClipDistance, i32 0, i32 3)
%2 = load <4 x float>* @o
%o1 = insertelement <4 x float> %2, float %1, i32 1
store <4 x float> %o1, <4 x float>* @o
call void @"bar3("()
call void @"bar4("()
call void @"bar5("()
call void @"bar6("()
call void @"bar7("()
br label %stage-epilogue

stage-epilogue: ; preds = %mainBody
br label %stage-exit

stage-exit: ; preds = %stage-epilogue
ret void
}

; Function Attrs: alwaysinline
define internal fastcc void @"bar3("() #0 {
entry:
%0 = load i32 addrspace(1)* @samp2D, !gla.uniform !6
%o = call <4 x float> @llvm.gla.fTexelGatherOffset.v4f32.v2f32(i32 2, i32 %0, i32 320, <2 x float> <float 0x3FD3333340000000, float 0x3FD3333340000000>, i32 undef, float undef, <2 x i32> <i32 1, i32 1>)
%1 = load <4 x float>* @o
%o1 = fadd <4 x float> %1, %o
store <4 x float> %o1, <4 x float>* @o
%2 = load i32 addrspace(1)* @samp2DA, !gla.uniform !9
%o2 = call <4 x float> @llvm.gla.fTexelGatherOffset.v4f32.v3f32(i32 2, i32 %2, i32 336, <3 x float> <float 0x3FD3333340000000, float 0x3FD3333340000000, float 0x3FD3333340000000>, i32 undef, float undef, <2 x i32> <i32 1, i32 1>)
%3 = load <4 x float>* @o
%o3 = fadd <4 x float> %3, %o2
store <4 x float> %o3, <4 x float>* @o
ret void
}

; Function Attrs: alwaysinline
define internal fastcc void @"bar4("() #0 {
entry:
%0 = load i32 addrspace(1)* @samp2DR, !gla.uniform !12
%o = call <4 x float> @llvm.gla.fTexelGatherOffset.v4f32.v2f32(i32 5, i32 %0, i32 320, <2 x float> <float 0x3FD3333340000000, float 0x3FD3333340000000>, i32 undef, float undef, <2 x i32> <i32 1, i32 1>)
%1 = load <4 x float>* @o
%o1 = fadd <4 x float> %1, %o
store <4 x float> %o1, <4 x float>* @o
%2 = load i32 addrspace(1)* @samp2DS, !gla.uniform !15
%o2 = call <4 x float> @llvm.gla.fTexelGatherOffset.v4f32.v2f32(i32 2, i32 %2, i32 2376, <2 x float> <float 0x3FD3333340000000, float 0x3FD3333340000000>, i32 undef, float 0x3FF4CCCCC0000000, <2 x i32> <i32 1, i32 1>)
%3 = load <4 x float>* @o
%o3 = fadd <4 x float> %3, %o2
store <4 x float> %o3, <4 x float>* @o
%4 = load i32 addrspace(1)* @samp2D, !gla.uniform !6
%o4 = call <4 x float> @llvm.gla.fTexelGatherOffset.v4f32.v2f32(i32 2, i32 %4, i32 1344, <2 x float> <float 0x3FD3333340000000, float 0x3FD3333340000000>, i32 2, float undef, <2 x i32> <i32 1, i32 1>)
%5 = load <4 x float>* @o
%o5 = fadd <4 x float> %5, %o4
store <4 x float> %o5, <4 x float>* @o
ret void
}

; Function Attrs: alwaysinline
define internal fastcc void @"bar5("() #0 {
entry:
%o11 = alloca <4 x float>
%c = alloca <4 x i32>
%f = alloca float
%0 = load i32 addrspace(1)* @sca, !gla.uniform !18
%io = call <3 x i32> @llvm.gla.queryTextureSize.v3i32(i32 4, i32 %0, i32 3)
store <3 x i32> %io, <3 x i32>* @io
%1 = load i32 addrspace(1)* @sca, !gla.uniform !18
%2 = load <4 x float>* @i
%o = call <4 x float> @llvm.gla.fTextureSample.v4f32.v4f32(i32 4, i32 %1, i32 16, <4 x float> %2)
%3 = load <4 x float>* @o
%o1 = fadd <4 x float> %3, %o
store <4 x float> %o1, <4 x float>* @o
%4 = load i32 addrspace(1)* @Isca, !gla.uniform !21
%5 = load <4 x float>* @i
%io2 = call <4 x i32> @llvm.gla.textureSampleLodRefZ.v4i32.v4f32(i32 4, i32 %4, i32 146, <4 x float> %5, float 0x3FE6666660000000, float undef)
%6 = extractelement <4 x i32> %io2, i32 0
%7 = insertelement <3 x i32> undef, i32 %6, i32 0
%8 = extractelement <4 x i32> %io2, i32 1
%9 = insertelement <3 x i32> %7, i32 %8, i32 1
%10 = extractelement <4 x i32> %io2, i32 2
%11 = insertelement <3 x i32> %9, i32 %10, i32 2
%12 = load <3 x i32>* @io
%io3 = add <3 x i32> %12, %11
store <3 x i32> %io3, <3 x i32>* @io
%13 = load i32 addrspace(1)* @USCA, !gla.uniform !24
%14 = load <4 x float>* @i
%uo = call <4 x i32> @llvm.gla.textureSample.v4i32.v4f32(i32 4, i32 %13, i32 16, <4 x float> %14)
store <4 x i32> %uo, <4 x i32>* @uo
%15 = load i32 addrspace(1)* @sca, !gla.uniform !18
%16 = load <4 x float>* @i
%o4 = call <4 x float> @llvm.gla.fTextureSampleLodRefZ.v4f32.v4f32(i32 4, i32 %15, i32 148, <4 x float> %16, float 0x3FFB333340000000, float undef)
%17 = load <4 x float>* @o
%o5 = fadd <4 x float> %17, %o4
store <4 x float> %o5, <4 x float>* @o
%18 = load i32 addrspace(1)* @SCAS, !gla.uniform !27
%a = call <3 x i32> @llvm.gla.queryTextureSize.v3i32(i32 4, i32 %18, i32 3)
%a6 = sitofp <3 x i32> %a to <3 x float>
store <3 x float> %a6, <3 x float>* @A
%19 = load i32 addrspace(1)* @SCAS, !gla.uniform !27
%20 = load <4 x float>* @i
%21 = load <4 x float>* @i
%22 = extractelement <4 x float> %21, i32 1
%f8 = call float @llvm.gla.fTextureSampleLodRefZ.f32.v4f32(i32 4, i32 %19, i32 154, <4 x float> %20, float %22, float undef)
store float %f8, float* %f
%23 = load i32 addrspace(1)* @Isca, !gla.uniform !21
%24 = load <4 x float>* @i
%c10 = call <4 x i32> @llvm.gla.textureSampleLodRefZOffsetGrad.v4i32.v4f32.i32.v3f32.v3f32(i32 4, i32 %23, i32 16, <4 x float> %24, float undef, float undef, i32 undef, <3 x float> <float 0x3FB99999A0000000, float 0x3FB99999A0000000, float 0x3FB99999A0000000>, <3 x float> <float 0x3FC99999A0000000, float 0x3FC99999A0000000, float 0x3FC99999A0000000>)
store <4 x i32> %c10, <4 x i32>* %c
%25 = load <3 x float>* @A
%26 = load float* %f
%27 = load <4 x i32>* %c
%28 = sitofp <4 x i32> %27 to <4 x float>
%29 = insertelement <4 x float> undef, float %26, i32 0
%30 = insertelement <4 x float> %29, float %26, i32 1
%31 = insertelement <4 x float> %30, float %26, i32 2
%32 = insertelement <4 x float> %31, float %26, i32 3
%33 = fadd <4 x float> %32, %28
%34 = load <4 x float>* %o11
%35 = extractelement <3 x float> %25, i32 0
%36 = insertelement <4 x float> %34, float %35, i32 0
%37 = extractelement <3 x float> %25, i32 1
%38 = insertelement <4 x float> %36, float %37, i32 1
%39 = extractelement <3 x float> %25, i32 2
%40 = insertelement <4 x float> %38, float %39, i32 2
%41 = extractelement <4 x float> %33, i32 0
%42 = insertelement <4 x float> %40, float %41, i32 3
%43 = load <4 x float>* @o
%o12 = fadd <4 x float> %43, %42
store <4 x float> %o12, <4 x float>* @o
ret void
}

; Function Attrs: alwaysinline
define internal fastcc void @"bar6("() #0 {
entry:
%b = alloca float
%m43 = alloca [4 x <3 x float>]
%a1 = alloca float
%0 = getelementptr [4 x <3 x float>]* %m43, i32 0, i32 3
%1 = load <3 x float>* %0
%a11 = extractelement <3 x float> %1, i32 1
store float %a11, float* %a1
%2 = load float* %a1
%b2 = fmul float 2.000000e+00, %2
store float %b2, float* %b
ret void
}

; Function Attrs: alwaysinline
define internal fastcc void @"bar7("() #0 {
entry:
%v = alloca <4 x float>
%0 = load i32 addrspace(1)* @S2dR, !gla.uniform !30
%1 = load <2 x float> addrspace(2)* @v2, !gla.uniform !33
%o = call <4 x float> @llvm.gla.fTextureSample.v4f32.v2f32(i32 5, i32 %0, i32 0, <2 x float> %1)
%2 = load <4 x float>* @o
%o1 = fadd <4 x float> %2, %o
store <4 x float> %o1, <4 x float>* @o
%3 = load i32 addrspace(1)* @S2dR, !gla.uniform !30
%4 = load <3 x float> addrspace(2)* @V3, !gla.uniform !35
%o2 = call <4 x float> @llvm.gla.fTextureSample.v4f32.v3f32(i32 5, i32 %3, i32 1, <3 x float> %4)
%5 = load <4 x float>* @o
%o3 = fadd <4 x float> %5, %o2
store <4 x float> %o3, <4 x float>* @o
%6 = load i32 addrspace(1)* @S2dR, !gla.uniform !30
%7 = load <4 x float> addrspace(2)* @v4, !gla.uniform !36
%o4 = call <4 x float> @llvm.gla.fTextureSample.v4f32.v4f32(i32 5, i32 %6, i32 1, <4 x float> %7)
%8 = load <4 x float>* @o
%o5 = fadd <4 x float> %8, %o4
store <4 x float> %o5, <4 x float>* @o
%9 = load i32 addrspace(1)* @s2DRS, !gla.uniform !37
%10 = load <3 x float> addrspace(2)* @V3, !gla.uniform !35
%o6 = call <4 x float> @llvm.gla.fTextureSampleLodRefZ.v4f32.v3f32(i32 5, i32 %9, i32 8, <3 x float> %10, float undef, float undef)
%11 = load <4 x float>* @o
%o7 = fadd <4 x float> %11, %o6
store <4 x float> %o7, <4 x float>* @o
%12 = load i32 addrspace(1)* @s2DRS, !gla.uniform !37
%13 = load <4 x float> addrspace(2)* @v4, !gla.uniform !36
%o8 = call <4 x float> @llvm.gla.fTextureSampleLodRefZ.v4f32.v4f32(i32 5, i32 %12, i32 9, <4 x float> %13, float undef, float undef)
%14 = load <4 x float>* @o
%o9 = fadd <4 x float> %14, %o8
store <4 x float> %o9, <4 x float>* @o
%15 = load i32 addrspace(1)* @s1d, !gla.uniform !40
%16 = load float addrspace(2)* @f, !gla.uniform !43
%17 = load float addrspace(2)* @f, !gla.uniform !43
%18 = load float addrspace(2)* @f, !gla.uniform !43
%o10 = call <4 x float> @llvm.gla.fTextureSampleLodRefZOffsetGrad.v4f32.f32.i32.f32.f32(i32 1, i32 %15, i32 0, float %16, float undef, float undef, i32 undef, float %17, float %18)
%19 = load <4 x float>* @o
%o11 = fadd <4 x float> %19, %o10
store <4 x float> %o11, <4 x float>* @o
%20 = load i32 addrspace(1)* @S2D, !gla.uniform !44
%21 = load <4 x float>* %v
%22 = load <2 x float> addrspace(2)* @v2, !gla.uniform !33
%23 = load <2 x float> addrspace(2)* @v2, !gla.uniform !33
%o12 = call <4 x float> @llvm.gla.fTextureSampleLodRefZOffsetGrad.v4f32.v4f32.i32.v2f32.v2f32(i32 2, i32 %20, i32 1, <4 x float> %21, float undef, float undef, i32 undef, <2 x float> %22, <2 x float> %23)
%24 = load <4 x float>* @o
%o13 = fadd <4 x float> %24, %o12
store <4 x float> %o13, <4 x float>* @o
%25 = load i32 addrspace(1)* @S2DS, !gla.uniform !47
%26 = load <4 x float>* %v
%27 = load <2 x float> addrspace(2)* @v2, !gla.uniform !33
%28 = load <2 x float> addrspace(2)* @v2, !gla.uniform !33
%o14 = call <4 x float> @llvm.gla.fTextureSampleLodRefZOffsetGrad.v4f32.v4f32.i32.v2f32.v2f32(i32 2, i32 %25, i32 9, <4 x float> %26, float undef, float undef, i32 undef, <2 x float> %27, <2 x float> %28)
%29 = load <4 x float>* @o
%o15 = fadd <4 x float> %29, %o14
store <4 x float> %o15, <4 x float>* @o
%30 = load i32 addrspace(1)* @s2DRS, !gla.uniform !37
%31 = load <4 x float>* %v
%32 = load <2 x float> addrspace(2)* @v2, !gla.uniform !33
%33 = load <2 x float> addrspace(2)* @v2, !gla.uniform !33
%o16 = call <4 x float> @llvm.gla.fTextureSampleLodRefZOffsetGrad.v4f32.v4f32.i32.v2f32.v2f32(i32 5, i32 %30, i32 9, <4 x float> %31, float undef, float undef, i32 undef, <2 x float> %32, <2 x float> %33)
%34 = load <4 x float>* @o
%o17 = fadd <4 x float> %34, %o16
store <4 x float> %o17, <4 x float>* @o
ret void
}

; Function Attrs: nounwind readnone
declare <4 x float> @llvm.gla.fTexelGatherOffset.v4f32.v2f32(i32, i32, i32, <2 x float>, i32, float, <2 x i32>) #1

; Function Attrs: nounwind readnone
declare <4 x float> @llvm.gla.fTexelGatherOffset.v4f32.v3f32(i32, i32, i32, <3 x float>, i32, float, <2 x i32>) #1

; Function Attrs: nounwind readnone
declare <3 x i32> @llvm.gla.queryTextureSize.v3i32(i32, i32, i32) #1

; Function Attrs: nounwind readnone
declare <4 x float> @llvm.gla.fTextureSample.v4f32.v4f32(i32, i32, i32, <4 x float>) #1

; Function Attrs: nounwind readnone
declare <4 x i32> @llvm.gla.textureSampleLodRefZ.v4i32.v4f32(i32, i32, i32, <4 x float>, float, float) #1

; Function Attrs: nounwind readnone
declare <4 x i32> @llvm.gla.textureSample.v4i32.v4f32(i32, i32, i32, <4 x float>) #1

; Function Attrs: nounwind readnone
declare <4 x float> @llvm.gla.fTextureSampleLodRefZ.v4f32.v4f32(i32, i32, i32, <4 x float>, float, float) #1

; Function Attrs: nounwind readnone
declare float @llvm.gla.fTextureSampleLodRefZ.f32.v4f32(i32, i32, i32, <4 x float>, float, float) #1

; Function Attrs: nounwind readnone
declare <4 x i32> @llvm.gla.textureSampleLodRefZOffsetGrad.v4i32.v4f32.i32.v3f32.v3f32(i32, i32, i32, <4 x float>, float, float, i32, <3 x float>, <3 x float>) #1

; Function Attrs: nounwind readnone
declare <4 x float> @llvm.gla.fTextureSample.v4f32.v2f32(i32, i32, i32, <2 x float>) #1

; Function Attrs: nounwind readnone
declare <4 x float> @llvm.gla.fTextureSample.v4f32.v3f32(i32, i32, i32, <3 x float>) #1

; Function Attrs: nounwind readnone
declare <4 x float> @llvm.gla.fTextureSampleLodRefZ.v4f32.v3f32(i32, i32, i32, <3 x float>, float, float) #1

; Function Attrs: nounwind readnone
declare <4 x float> @llvm.gla.fTextureSampleLodRefZOffsetGrad.v4f32.f32.i32.f32.f32(i32, i32, i32, float, float, float, i32, float, float) #1

; Function Attrs: nounwind readnone
declare <4 x float> @llvm.gla.fTextureSampleLodRefZOffsetGrad.v4f32.v4f32.i32.v2f32.v2f32(i32, i32, i32, <4 x float>, float, float, i32, <2 x float>, <2 x float>) #1

; Function Attrs: nounwind readnone
declare <4 x float> @llvm.gla.fTexelGather.v4f32.v3f32(i32, i32, i32, <3 x float>, i32, float) #1

attributes #0 = { alwaysinline }
attributes #1 = { nounwind readnone }

!gla.outputs = !{!0, !2, !4}
!gla.uniforms = !{!6, !9, !12, !15, !18, !21, !24, !27, !30, !33, !35, !36, !37, !40, !43, !44, !47, !50, !53}
!gla.inputs = !{!56, !58, !60, !62, !64, !66}
!gla.entrypoint = !{!68}
!gla.noStaticUse = !{!60, !62, !64, !66, !53}

!0 = metadata !{metadata !"o", i32 9, <4 x float>* @o_typeProxy, metadata !1}
!1 = metadata !{i32 0, i32 0, i32 1024, null, i32 0, i32 0, i32 -1, i32 0, i32 -1}
!2 = metadata !{metadata !"io", i32 9, <3 x i32>* @io_typeProxy, metadata !3}
!3 = metadata !{i32 0, i32 0, i32 1025, null, i32 0, i32 0, i32 -1, i32 0, i32 -1}
!4 = metadata !{metadata !"uo", i32 9, <4 x i32>* @uo_typeProxy, metadata !5}
!5 = metadata !{i32 1, i32 0, i32 1027, null, i32 0, i32 0, i32 -1, i32 0, i32 -1}
!6 = metadata !{metadata !"samp2D", i32 14, i32* @samp2D_typeProxy, metadata !7}
!7 = metadata !{i32 5, i32 0, i32 1024, metadata !8, i32 -1, i32 0, i32 -1, i32 0, i32 -1}
!8 = metadata !{i32 0, i32* @samp2D_typeProxy, i32 1, i1 false, i1 false, i32 0}
!9 = metadata !{metadata !"samp2DA", i32 14, i32* @samp2DA_typeProxy, metadata !10}
!10 = metadata !{i32 5, i32 0, i32 1024, metadata !11, i32 -1, i32 0, i32 -1, i32 0, i32 -1}
!11 = metadata !{i32 0, i32* @samp2DA_typeProxy, i32 1, i1 true, i1 false, i32 0}
!12 = metadata !{metadata !"samp2DR", i32 14, i32* @samp2DR_typeProxy, metadata !13}
!13 = metadata !{i32 5, i32 0, i32 1024, metadata !14, i32 -1, i32 0, i32 -1, i32 0, i32 -1}
!14 = metadata !{i32 0, i32* @samp2DR_typeProxy, i32 4, i1 false, i1 false, i32 0}
!15 = metadata !{metadata !"samp2DS", i32 14, i32* @samp2DS_typeProxy, metadata !16}
!16 = metadata !{i32 5, i32 0, i32 1024, metadata !17, i32 -1, i32 0, i32 -1, i32 0, i32 -1}
!17 = metadata !{i32 0, i32* @samp2DS_typeProxy, i32 1, i1 false, i1 true, i32 0}
!18 = metadata !{metadata !"Sca", i32 14, i32* @Sca_typeProxy, metadata !19}
!19 = metadata !{i32 5, i32 0, i32 1024, metadata !20, i32 -1, i32 0, i32 -1, i32 0, i32 -1}
!20 = metadata !{i32 0, i32* @Sca_typeProxy, i32 3, i1 true, i1 false, i32 0}
!21 = metadata !{metadata !"Isca", i32 14, i32* @Isca_typeProxy, metadata !22}
!22 = metadata !{i32 5, i32 0, i32 1024, metadata !23, i32 -1, i32 0, i32 -1, i32 0, i32 -1}
!23 = metadata !{i32 0, i32* @Isca_typeProxy, i32 3, i1 true, i1 false, i32 1}
!24 = metadata !{metadata !"Usca", i32 14, i32* @Usca_typeProxy, metadata !25}
!25 = metadata !{i32 5, i32 0, i32 1024, metadata !26, i32 -1, i32 0, i32 -1, i32 0, i32 -1}
!26 = metadata !{i32 0, i32* @Usca_typeProxy, i32 3, i1 true, i1 false, i32 2}
!27 = metadata !{metadata !"Scas", i32 14, i32* @Scas_typeProxy, metadata !28}
!28 = metadata !{i32 5, i32 0, i32 1024, metadata !29, i32 -1, i32 0, i32 -1, i32 0, i32 -1}
!29 = metadata !{i32 0, i32* @Scas_typeProxy, i32 3, i1 true, i1 true, i32 0}
!30 = metadata !{metadata !"s2DR", i32 14, i32* @s2DR_typeProxy, metadata !31}
!31 = metadata !{i32 5, i32 0, i32 1024, metadata !32, i32 -1, i32 0, i32 -1, i32 0, i32 -1}
!32 = metadata !{i32 0, i32* @s2DR_typeProxy, i32 4, i1 false, i1 false, i32 0}
!33 = metadata !{metadata !"v2", i32 14, <2 x float>* @v2_typeProxy, metadata !34}
!34 = metadata !{i32 0, i32 0, i32 1024, null, i32 -1, i32 0, i32 -1, i32 0, i32 -1}
!35 = metadata !{metadata !"v3", i32 14, <3 x float>* @v3_typeProxy, metadata !34}
!36 = metadata !{metadata !"v4", i32 14, <4 x float>* @v4_typeProxy, metadata !34}
!37 = metadata !{metadata !"s2DRS", i32 14, i32* @s2DRS_typeProxy, metadata !38}
!38 = metadata !{i32 5, i32 0, i32 1024, metadata !39, i32 -1, i32 0, i32 -1, i32 0, i32 -1}
!39 = metadata !{i32 0, i32* @s2DRS_typeProxy, i32 4, i1 false, i1 true, i32 0}
!40 = metadata !{metadata !"s1D", i32 14, i32* @s1D_typeProxy, metadata !41}
!41 = metadata !{i32 5, i32 0, i32 1024, metadata !42, i32 -1, i32 0, i32 -1, i32 0, i32 -1}
!42 = metadata !{i32 0, i32* @s1D_typeProxy, i32 0, i1 false, i1 false, i32 0}
!43 = metadata !{metadata !"f", i32 14, float* @f_typeProxy, metadata !34}
!44 = metadata !{metadata !"s2D", i32 14, i32* @s2D_typeProxy, metadata !45}
!45 = metadata !{i32 5, i32 0, i32 1024, metadata !46, i32 -1, i32 0, i32 -1, i32 0, i32 -1}
!46 = metadata !{i32 0, i32* @s2D_typeProxy, i32 1, i1 false, i1 false, i32 0}
!47 = metadata !{metadata !"s2DS", i32 14, i32* @s2DS_typeProxy, metadata !48}
!48 = metadata !{i32 5, i32 0, i32 1024, metadata !49, i32 -1, i32 0, i32 -1, i32 0, i32 -1}
!49 = metadata !{i32 0, i32* @s2DS_typeProxy, i32 1, i1 false, i1 true, i32 0}
!50 = metadata !{metadata !"sampC", i32 14, i32* @sampC_typeProxy, metadata !51}
!51 = metadata !{i32 5, i32 0, i32 1024, metadata !52, i32 -1, i32 0, i32 -1, i32 0, i32 -1}
!52 = metadata !{i32 0, i32* @sampC_typeProxy, i32 3, i1 false, i1 false, i32 0}
!53 = metadata !{metadata !"bounds", i32 14, i32* @bounds_typeProxy, metadata !54}
!54 = metadata !{i32 5, i32 0, i32 1024, metadata !55, i32 -1, i32 0, i32 0, i32 0, i32 -1}
!55 = metadata !{i32 0, i32* @bounds_typeProxy, i32 1, i1 false, i1 false, i32 0}
!56 = metadata !{metadata !"i", i32 1, <4 x float>* @i_typeProxy, metadata !57}
!57 = metadata !{i32 0, i32 0, i32 1026, null, i32 1, i32 0, i32 -1, i32 0, i32 -1}
!58 = metadata !{metadata !"gl_ClipDistance", i32 1, [4 x float]* @gl_ClipDistance_typeProxy, metadata !59}
!59 = metadata !{i32 0, i32 0, i32 1028, null, i32 1, i32 12, i32 -1, i32 0, i32 -1}
!60 = metadata !{metadata !"fflat", i32 1, float* @fflat_typeProxy, metadata !61}
!61 = metadata !{i32 0, i32 0, i32 1032, null, i32 0, i32 0, i32 -1, i32 0, i32 -1}
!62 = metadata !{metadata !"fsmooth", i32 1, float* @fsmooth_typeProxy, metadata !63}
!63 = metadata !{i32 0, i32 0, i32 1033, null, i32 1, i32 0, i32 -1, i32 0, i32 -1}
!64 = metadata !{metadata !"fnop", i32 1, float* @fnop_typeProxy, metadata !65}
!65 = metadata !{i32 0, i32 0, i32 1034, null, i32 2, i32 0, i32 -1, i32 0, i32 -1}
!66 = metadata !{metadata !"gl_Color", i32 1, <4 x float>* @gl_Color_typeProxy, metadata !67}
!67 = metadata !{i32 0, i32 0, i32 1035, null, i32 0, i32 38, i32 -1, i32 0, i32 -1}
!68 = metadata !{metadata !"main", i32 17}

@johnkslang
Copy link
Contributor

This sounds like it might be mixing versions. Possibly independent point is that I don't think LunarGLASS has been ported to LLVM 4.x.

@SakuraXiaMF
Copy link
Author

Thank you very much for your response!
I use /LunarGLASS/Core/LLVM/llvm-3.4/build/install/usr/local/bin/llvm-as to translate a.ll file to a.bc file (the file is the same with my last comment).I get the same error.(error: use of undefined value '@Isca_typeProxy'
!21 = metadata !{metadata !"Isca", i32 14, i32* @Isca_typeProxy, metadata !22}
)

@SakuraXiaMF
Copy link
Author

Can you add some program operation description? Just like "how to transform a.frag file to a.frag.out file?" I know your program is very powerful,it have a lots of useful functions.But,I don't know how to use it in a right operate way.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants