Test Failure: Transforms/InstCombine/bitcast-phi-uselistorder.ll

Test source: git

Comments: LLVM PR45152

Log:

Source: <stdin>

----------------------------------------
@Q = global 8 bytes, align 8

define double @test(i1 %c, ptr %p) {
%entry:
  br i1 %c, label %if, label %end

%if:
  %__constexpr_0 = bitcast ptr @Q to ptr
  %load = load i64, ptr %__constexpr_0, align 8
  br label %end

%end:
  %phi = phi i64 [ 0, %entry ], [ %load, %if ]
  store i64 %phi, ptr %p, align 8
  %cast = bitcast i64 %phi to double
  ret double %cast
}
=>
@Q = global 8 bytes, align 8

define double @test(i1 %c, ptr %p) {
%entry:
  br i1 %c, label %if, label %end

%if:
  %load1 = load double, ptr @Q, align 8
  br label %end

%end:
  %0 = phi double [ 0.000000, %entry ], [ %load1, %if ]
  %1 = bitcast ptr %p to ptr
  store double %0, ptr %1, align 8
  ret double %0
}
Transformation doesn't verify!
ERROR: Mismatch in memory

Example:
i1 %c = #x1 (1)
ptr %p = pointer(non-local, block_id=2, offset=48)

Source:
  >> Jump to %if
ptr %__constexpr_0 = pointer(non-local, block_id=1, offset=0)
i64 %load = #x7ff000000000a084 (9218868437227446404)
  >> Jump to %end
i64 %phi = #x7ff000000000a084 (9218868437227446404)
double %cast = NaN

SOURCE MEMORY STATE
===================
NON-LOCAL BLOCKS:
Block 0 >	size: 0	align: 8	alloc type: 0
Block 1 >	size: 8	align: 8	alloc type: 0
Block 2 >	size: 177	align: 64	alloc type: 0

Target:
  >> Jump to %if
double %load1 = NaN
  >> Jump to %end
double %0 = NaN
ptr %1 = pointer(non-local, block_id=2, offset=48)

Mismatch in pointer(non-local, block_id=2, offset=48)
Source value: #x7ff000000000a084
Target value: #x7ff0000000002004


------------------- SMT STATS -------------------
Num queries: 6
Num invalid: 0
Num skips:   0
Num trivial: 12 (66.7%)
Num timeout: 0 (0.0%)
Num errors:  0 (0.0%)
Num SAT:     4 (66.7%)
Num UNSAT:   2 (33.3%)
Alive2: Transform doesn't verify; aborting!

stderr:

+ : 'RUN: at line 2'
+ /home/nuno/alive2/build/opt-alive.sh -S -passes=instcombine
+ /home/nuno/llvm/build/bin/FileCheck /home/nuno/llvm/llvm/test/Transforms/InstCombine/bitcast-phi-uselistorder.ll

FileCheck error: '<stdin>' is empty.
FileCheck command line:  /home/nuno/llvm/build/bin/FileCheck /home/nuno/llvm/llvm/test/Transforms/InstCombine/bitcast-phi-uselistorder.ll

 

NOTE: This test would pass if undef didn't exist!

 

<-- Back