[LLVMdev] A quick update on FreeBSD support
Marcel Moolenaar
xcllnt at mac.com
Sun May 25 13:39:42 PDT 2008
On May 25, 2008, at 12:58 AM, Bill Wendling wrote:
> On May 24, 2008, at 4:25 PM, Marcel Moolenaar wrote:
>
>> On May 24, 2008, at 12:12 PM, Bill Wendling wrote:
>>
>>> Let us know if you would like extra eyes on the two PPC failures.
>>> Many
>>> of us have a lot of experience with C++. :-) Do you know where these
>>> allocations are?
>>
>> I don't mind if people help out, so here's some information:
>>
> Could you try this (massively hacky) patch out to see if it fixes your
> problem?
>
> Index: lib/Transforms/Scalar/PredicateSimplifier.cpp
> ===================================================================
> --- lib/Transforms/Scalar/PredicateSimplifier.cpp (revision 51554)
> +++ lib/Transforms/Scalar/PredicateSimplifier.cpp (working copy)
> @@ -674,6 +674,15 @@
> const_iterator begin() const { return Relations.begin(); }
> const_iterator end() const { return Relations.end(); }
>
> + Edge &operator[](unsigned Idx) {
> + return Relations[Idx];
> + }
> + const Edge &operator[](unsigned Idx) const {
> + return Relations[Idx];
> + }
> +
> + size_t size() const { return Relations.size(); }
> +
> iterator find(unsigned n, DomTreeDFS::Node *Subtree) {
> iterator E = end();
> for (iterator I = std::lower_bound(begin(), E, n);
> @@ -1599,18 +1608,23 @@
> for (SetVector<unsigned>::iterator I = Remove.begin(), E =
> Remove.end();
> I != E; ++I) {
> unsigned n = *I;
> - for (Node::iterator NI = IG.node(n)->begin(), NE =
> IG.node(n)->end();
> - NI != NE; ++NI) {
> - if (NI->Subtree->DominatedBy(Top)) {
> - if (NI->To == n1) {
> - assert((NI->LV & EQ_BIT) && "Node inequal to
> itself.");
> + Node *N = IG.node(n);
> + for (unsigned Size = N->size(), i = 0; i < Size; ++i) {
> + InequalityGraph::Edge *E = &(*N)[i];
> + if (E->Subtree->DominatedBy(Top)) {
> + if (E->To == n1) {
> + assert((E->LV & EQ_BIT) && "Node inequal to
> itself.");
> continue;
> }
> - if (Remove.count(NI->To))
> + if (Remove.count(E->To))
> continue;
>
> - IG.node(NI->To)->update(n1, reversePredicate(NI->LV),
> Top);
> - IG.node(n1)->update(NI->To, NI->LV, Top);
> + IG.node(E->To)->update(n1, reversePredicate(E->LV),
> Top);
> + E = &(*N)[i];
> + Size = N->size();
> + IG.node(n1)->update(E->To, E->LV, Top);
> + E = &(*N)[i];
> + Size = N->size();
> }
> }
> }
Alas, it didn't fix the problem:
...
gmake[3]: Entering directory `/nfs/llvm/obj/powerpc/lib/Transforms/
Scalar'
llvm[3]: Compiling PredicateSimplifier.cpp for Debug build
/nfs/llvm/src/llvm/lib/Transforms/Scalar/PredicateSimplifier.cpp: In
constructor '<unnamed>::InequalityGraph::Edge::Edge()':
/nfs/llvm/src/llvm/lib/Transforms/Scalar/PredicateSimplifier.cpp:607:
warning: format '%p' expects type 'void*', but argument 2 has type
'<unnamed>::InequalityGraph::Edge*'
llvm[3]: Building Debug Archive Library libLLVMScalarOpts.a
gmake[3]: Leaving directory `/nfs/llvm/obj/powerpc/lib/Transforms/
Scalar'
...
xserve% Debug/bin/opt -predsimplify -disable-output < x.bc
Assertion failed: (validPredicate(R) && "Invalid predicate."),
function update, file /nfs/llvm/src/llvm/lib/Transforms/Scalar/
PredicateSimplifier.cpp, line 711.
Abort (core dumped)
(gdb) bt
#0 0x2229ce08 in kill () from /lib/libc.so.7
#1 0x22000848 in raise () from /lib/libthr.so.3
#2 0x2229b6ec in abort () from /lib/libc.so.7
#3 0x22281d80 in __assert () from /lib/libc.so.7
#4 0x01c34b4c in update (this=0x200c940, n=1515870810, R=1515870810,
Subtree=0x20298c0) at /nfs/llvm/src/llvm/lib/Transforms/Scalar/
PredicateSimplifier.cpp:711
#5 0x01c3d224 in makeEqual (this=0x7fffd580, V1=0x2009730,
V2=0x2006624) at /nfs/llvm/src/llvm/lib/Transforms/Scalar/
PredicateSimplifier.cpp:1626
#6 0x01c3dc2c in solve (this=0x7fffd580) at /nfs/llvm/src/llvm/lib/
Transforms/Scalar/PredicateSimplifier.cpp:2165
#7 0x01c3fa70 in visitBranchInst (this=0x7fffd678, BI=@0x2006714) at /
nfs/llvm/src/llvm/lib/Transforms/Scalar/PredicateSimplifier.cpp:2461
#8 0x01c3fca4 in visitBr (this=0x7fffd678, I=@0x2006714) at
Instruction.def:98
#9 0x01c4014c in visit (this=0x7fffd678, I=@0x2006714) at
Instruction.def:98
#10 0x01c40bbc in visitInstruction (this=0x2006790, I=0x2006714,
DT=0x2029800) at /nfs/llvm/src/llvm/lib/Transforms/Scalar/
PredicateSimplifier.cpp:2390
#11 0x01c40d5c in visitBasicBlock (this=0x2006790, Node=0x2029800) at /
nfs/llvm/src/llvm/lib/Transforms/Scalar/PredicateSimplifier.cpp:2334
#12 0x01c411cc in runOnFunction (this=0x2006790, F=@0x2006510) at /nfs/
llvm/src/llvm/lib/Transforms/Scalar/PredicateSimplifier.cpp:2412
#13 0x01e84874 in llvm::FPPassManager::runOnFunction (this=0x2021080,
F=@0x2006510) at /nfs/llvm/src/llvm/lib/VMCore/PassManager.cpp:1178
#14 0x01e84aac in llvm::FPPassManager::runOnModule (this=0x2021080,
M=@0x20093a0) at /nfs/llvm/src/llvm/lib/VMCore/PassManager.cpp:1198
#15 0x01e8432c in llvm::MPPassManager::runOnModule (this=0x202c110,
M=@0x20093a0) at /nfs/llvm/src/llvm/lib/VMCore/PassManager.cpp:1248
#16 0x01e84588 in llvm::PassManagerImpl::run (this=0x201d100,
M=@0x20093a0) at /nfs/llvm/src/llvm/lib/VMCore/PassManager.cpp:1322
#17 0x01e84648 in llvm::PassManager::run (this=0x7fffdb40,
M=@0x20093a0) at /nfs/llvm/src/llvm/lib/VMCore/PassManager.cpp:1354
#18 0x01a70774 in main (argc=3, argv=0x7fffdbf8) at /nfs/llvm/src/llvm/
tools/opt/opt.cpp:431
(gdb) x /x E
0x2036390: 0x5a5a5a5a
(gdb) p n1
$1 = 5
(gdb) p *N
$2 = {_vptr$Node = 0x5a5a5a5a, Relations =
{<llvm::SmallVectorImpl<<unnamed>::InequalityGraph::Edge>> = {Begin =
0x5a5a5a5a, End = 0x5a5a5a5a, Capacity = 0x5a5a5a5a, FirstEl = 90
'Z'}, InlineElts = 'Z' <repeats 47 times>}}
FYI,
--
Marcel Moolenaar
xcllnt at mac.com
More information about the llvm-dev
mailing list