Skip to content

TableGen generates different output on different platforms #2962

@llvmbot

Description

@llvmbot
Bugzilla Link 2590
Resolution FIXED
Resolved on Mar 01, 2010 16:09
Version trunk
OS NetBSD
Reporter LLVM Bugzilla Contributor
CC @asl,@lattner

Extended Description

Running the the llvm testsuite on different platforms shows differences for tests that should give identical result. For example llvm/test/CodeGen/Alpha/add.ll fails on i386-unknown-netbsdelf4.99.69 but works on x86_64-unknown-netbsd4.99.69. This is because TableGen generates different output on different platforms.

The problem is that TableGen keeps some information sorted by pointer values, and the output is generated by iterating over the list.

I tried to provide a custom ordering operator (that ordered the records by the Record::Name) to

std::map<Record*, DAGInstruction> Instructions;

in CodeGenDAGPatterns.h , and that gave me the same testsuite result on the two machines, but there are still differences between the TableGen-generated files, so there are probably more maps that should be updated. But there are several such candidate variables in CodeGenDAGPatterns.h, e.g.:

std::map<Record*, SDNodeInfo> SDNodes;
std::map<Record*, std::pair<Record*, std::string> > SDNodeXForms;
std::map<Record*, ComplexPattern> ComplexPatterns;
std::map<Record*, TreePattern*> PatternFragments;
std::map<Record*, DAGDefaultOperand> DefaultOperands;

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions