[llvm-commits] FW: DAG type Legalizer bug?

Guo, Xiaoyi Xiaoyi.Guo at amd.com
Tue Apr 3 11:38:49 PDT 2012

Please review the attached patch which fixes a bug as described below. Our test case fails on amdil backend. I failed to create a test case with one of the backends built-in to llvm. So I couldn't add a test case to the unit test suite.


From: llvmdev-bounces at cs.uiuc.edu [mailto:llvmdev-bounces at cs.uiuc.edu] On Behalf Of Guo, Xiaoyi
Sent: Friday, March 23, 2012 8:11 PM
To: LLVM Developers Mailing List
Subject: [LLVMdev] DAG type Legalizer bug?

The following looks like a bug in the legalizer to me.

DAGTypeLegalizer::SplitRes_MERGE_VALUES(SDNode*N, unsigned ResNo, SDValue& Lo, SDValue& Hi) {
  SDValue Op = DisintegrateMERGE_VALUES(N, ResNo);
  GetSplitOp(Op, Lo, Hi);

DisintegrateMERGE_VALUE() returns SDValue(N, ResNo), where N is the MERGE_VALUE node itself.
Then GetSplitOp() tries to retrieve split result for N from the SplitVectors cache and hit assert because split result is for N is not in the cache yet.

Seems to me that DisintegrateMERGE_VALUES() should return the corresponding operand for the given ResNo, not the defined value.

Please confirm if it's a bug, or if I'm missing something.

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20120403/7f56d9f2/attachment.html>
-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: ATT00001.txt
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20120403/7f56d9f2/attachment.txt>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: LegalizeTypes.patch
Type: application/octet-stream
Size: 565 bytes
Desc: LegalizeTypes.patch
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20120403/7f56d9f2/attachment.obj>

More information about the llvm-commits mailing list