Test source: git
Source: <stdin> -- 1. ModuleToFunctionPassAdaptor -- 1. PassManager<Function> : Skipping NOP -- 2. GVNPass ---------------------------------------- define <4 x float> @ConvertVectors_ByRef(ptr %loc) { #0: %load_vec = load <4 x float>, ptr %loc, align 16 %shuf = shufflevector <4 x float> %load_vec, <4 x float> poison, 0, 4294967295, 4294967295, 4294967295 %gep1 = gep inbounds ptr %loc, 16 x i64 0, 4 x i64 1 %load1 = load float, ptr %gep1, align 4 %ins1 = insertelement <4 x float> %shuf, float %load1, i64 1 %gep2 = gep inbounds ptr %loc, 16 x i64 0, 4 x i64 2 %load2 = load float, ptr %gep2, align 8 %ins2 = insertelement <4 x float> %ins1, float %load2, i64 2 %ins3 = insertelement <4 x float> %ins2, float %load2, i64 3 ret <4 x float> %ins3 } Transformation seems to be correct! (syntactically equal) -- 3. GVNPass ---------------------------------------- define <4 x float> @ConvertVectors_ByRef(ptr %loc) { #0: %load_vec = load <4 x float>, ptr %loc, align 16 %shuf = shufflevector <4 x float> %load_vec, <4 x float> poison, 0, 4294967295, 4294967295, 4294967295 %gep1 = gep inbounds ptr %loc, 16 x i64 0, 4 x i64 1 %load1 = load float, ptr %gep1, align 4 %ins1 = insertelement <4 x float> %shuf, float %load1, i64 1 %gep2 = gep inbounds ptr %loc, 16 x i64 0, 4 x i64 2 %load2 = load float, ptr %gep2, align 8 %ins2 = insertelement <4 x float> %ins1, float %load2, i64 2 %ins3 = insertelement <4 x float> %ins2, float %load2, i64 3 ret <4 x float> %ins3 } => define <4 x float> @ConvertVectors_ByRef(ptr %loc) { #0: %load_vec = load <4 x float>, ptr %loc, align 16 %shuf = shufflevector <4 x float> %load_vec, <4 x float> poison, 0, 4294967295, 4294967295, 4294967295 %#1 = bitcast <4 x float> %load_vec to i128 %#2 = lshr i128 %#1, 32 %#3 = trunc i128 %#2 to i32 %#4 = bitcast i32 %#3 to float %ins1 = insertelement <4 x float> %shuf, float %#4, i64 1 %#5 = lshr i128 %#1, 64 %#6 = trunc i128 %#5 to i32 %#7 = bitcast i32 %#6 to float %ins2 = insertelement <4 x float> %ins1, float %#7, i64 2 %ins3 = insertelement <4 x float> %ins2, float %#7, i64 3 ret <4 x float> %ins3 } Transformation doesn't verify! (unsound) ERROR: Target is more poisonous than source Example: ptr %loc = pointer(non-local, block_id=1, offset=0) / Address=#x20 Source: <4 x float> %load_vec = < poison, #x00000000 (+0.0), #x00000000 (+0.0), poison > <4 x float> %shuf = < poison, poison, poison, poison > ptr %gep1 = pointer(non-local, block_id=1, offset=4) / Address=#x24 float %load1 = #x00000000 (+0.0) <4 x float> %ins1 = < poison, #x00000000 (+0.0), poison, poison > ptr %gep2 = pointer(non-local, block_id=1, offset=8) / Address=#x28 float %load2 = #x00000000 (+0.0) <4 x float> %ins2 = < poison, #x00000000 (+0.0), #x00000000 (+0.0), poison > <4 x float> %ins3 = < poison, #x00000000 (+0.0), #x00000000 (+0.0), #x00000000 (+0.0) > SOURCE MEMORY STATE =================== NON-LOCAL BLOCKS: Block 0 > size: 0 align: 4 alloc type: 0 alive: false address: 0 Block 1 > size: 32 align: 1 alloc type: 0 alive: true address: 32 Contents: 3: null, byte offset=0 1: #x00000000 2: #x00000000 *: poison Target: <4 x float> %load_vec = < poison, #x00000000 (+0.0), #x00000000 (+0.0), poison > <4 x float> %shuf = < poison, poison, poison, poison > i128 %#1 = poison i128 %#2 = poison i32 %#3 = poison float %#4 = poison <4 x float> %ins1 = < poison, poison, poison, poison > i128 %#5 = poison i32 %#6 = poison float %#7 = poison <4 x float> %ins2 = < poison, poison, poison, poison > <4 x float> %ins3 = < poison, poison, poison, poison > Source value: < poison, #x00000000 (+0.0), #x00000000 (+0.0), #x00000000 (+0.0) > Target value: < poison, poison, poison, poison > Pass: GVNPass Command line: '/home/nlopes/llvm/build/bin/opt' '-load=/home/nlopes/alive2/build/tv/tv.so' '-load-pass-plugin=/home/nlopes/alive2/build/tv/tv.so' '-tv-exit-on-error' '-passes=gvn' '-S' '-tv-smt-to=20000' '-tv-report-dir=/home/nlopes/alive2/build/logs' '-tv-smt-stats' Wrote bitcode to: "/home/nlopes/alive2/build/logs/in_MxkZtUOB_FX1U.bc" ------------------- SMT STATS ------------------- Num queries: 25 Num invalid: 0 Num skips: 0 Num trivial: 19 (43.2%) Num timeout: 0 (0.0%) Num errors: 0 (0.0%) Num SAT: 15 (60.0%) Num UNSAT: 10 (40.0%) Alive2: Transform doesn't verify; aborting!
RUN: at line 2: /home/nlopes/alive2/build/opt-alive.sh -passes=gvn -S < /bitbucket/nlopes/llvm/llvm/test/Transforms/GVN/pr63059.ll | /bitbucket/nlopes/llvm/build/bin/FileCheck /bitbucket/nlopes/llvm/llvm/test/Transforms/GVN/pr63059.ll + /home/nlopes/alive2/build/opt-alive.sh -passes=gvn -S + /bitbucket/nlopes/llvm/build/bin/FileCheck /bitbucket/nlopes/llvm/llvm/test/Transforms/GVN/pr63059.ll FileCheck error: '<stdin>' is empty. FileCheck command line: /bitbucket/nlopes/llvm/build/bin/FileCheck /bitbucket/nlopes/llvm/llvm/test/Transforms/GVN/pr63059.ll