<div dir="ltr"><div>It is tested on 3.5 on linux 64 platform.</div><br><div class="gmail_quote">---------- Forwarded message ----------<br>From: <b class="gmail_sendername">Peng Cheng</b> <span dir="ltr"><<a href="mailto:gm4cheng@gmail.com">gm4cheng@gmail.com</a>></span><br>Date: Mon, May 18, 2015 at 4:06 PM<br>Subject: "two address instruction invalid" assertion in TwoAddressInstructionPass<br>To: "<a href="mailto:LLVMdev@cs.uiuc.edu">LLVMdev@cs.uiuc.edu</a>" <<a href="mailto:LLVMdev@cs.uiuc.edu">LLVMdev@cs.uiuc.edu</a>><br><br><br><div dir="ltr">Here is a simple llvm ir at the end. When I ran "lli -O0" on it, I got:<div><br></div><div><div>lli: .../TwoAddressInstructionPass.cpp:1314: bool {anonymous}::TwoAddressInstructionPass::collectTiedOperands(llvm::MachineInstr*, {anonymous}::TwoAddressInstructionPass::TiedOperandMap&): Assertion `SrcReg && SrcMO.isUse() && "two address instruction invalid"' failed.</div></div><div><br></div><div>Is this an IR issue or bug somewhere?</div><div><br></div><div>Thanks,</div><div>-Peng</div><div><br><div><div><br></div><div>---- <begin> ----</div><div><div>; ModuleID = 'module_name'</div><div><br></div><div>%0 = type <{ double*, i1* }></div><div><br></div><div>define void @main(double*, %0* %t0) {</div><div>entry:</div><div> br label %1</div><div><br></div><div>; <label>:1 ; preds = %entry</div><div> %2 = getelementptr inbounds %0* %t0, i64 0, i32 1</div><div> %3 = load i1** %2, align 8</div><div> %4 = load i1* %3, align 1</div><div> %5 = getelementptr inbounds %0* %t0, i64 0, i32 0</div><div> %6 = load double** %5, align 8</div><div> %7 = load double* %6, align 8</div><div> %8 = fcmp ogt double %7, -1.000000e-01</div><div> %9 = select i1 %8, double 1.000000e+00, double 0.000000e+00</div><div> %10 = select i1 %4, double %9, double 1.000000e+00</div><div> store double %10, double* %0, align 8</div><div> ret void</div><div>}</div></div><div><br></div><div><div>---- <end> ----</div><div><br></div><div></div></div></div></div></div>
</div><br></div>