Open Quuxplusone opened 7 years ago
The initial support was merged upstream. I'll keep this open for a while as an umbrella for all the NewGVN issues.
FAIL: "The instructions for these memory operations should have been in the same congruence class"
You are probably already aware of this, but the test-suite fails with '-mllvm -enable-newgvn'. I am posting this here for other users sake who might also follow Davide's suggestion and run the test-suite on some target.
I ran the test-suite on SystemZ with NewGVN, and found then this crash. I then checked on X86 to also find the same fail there.
test-suite/MultiSource/Benchmarks/mafft/io.c:
clang-4.0: /home/jonas/llvm/llvm-dev/lib/Transforms/Scalar/NewGVN.cpp:1427: void NewGVN::verifyMemoryCongruency(): Assertion `ValueToClass.lookup(FirstMUD->getMemoryInst()) == ValueToClass.lookup(SecondMUD->getMemoryInst()) && "The instructions for these memory operations should have been in " "the same congruence class"' failed.
I used llvm/trunk@290872, cfe/trunk@290887 and test-suite/trunk@290894.
Options: -O3 -mllvm -enable-newgvn
/Jonas
Thanks Jonas, going to reduce/debug this soon =)
Jonas, do you mind to try ToT? Danny fixed all the remaining unknown issues.
(In reply to comment #4)
> Jonas, do you mind to try ToT? Danny fixed all the remaining unknown issues.
*known, even.
Sorry, but I haven't even opened the NewGVN.cpp file. My idea was to contribute by running the test-suite on SystemZ, which I did. I was expecting the author(s) of the code would then take the time to fix any issues.
(and yes, the crash I found is still there as far as I can see)
(In reply to comment #6)
> Sorry, but I haven't even opened the NewGVN.cpp file. My idea was to
> contribute by running the test-suite on SystemZ, which I did. I was
> expecting the author(s) of the code would then take the time to fix any
> issues.
I did =) https://llvm.org/bugs/show_bug.cgi?id=31573
Ah, great :-)
I tried to apply the attached patch, but it did not apply cleanly anymore, at least not in my repo with latest changes.
Let me know when the test-suite passes on X86, and I will gladly run it on SystemZ.
/Jonas
(In reply to comment #9)
> Ah, great :-)
>
> I tried to apply the attached patch, but it did not apply cleanly anymore,
> at least not in my repo with latest changes.
>
> Let me know when the test-suite passes on X86, and I will gladly run it on
> SystemZ.
>
> /Jonas
LLVM passes test-suite on X86 now, so I think we're in a good shape to try on
other platforms if you want to take a look.
(In reply to comment #10)
> (In reply to comment #9)
> > Ah, great :-)
> >
> > I tried to apply the attached patch, but it did not apply cleanly anymore,
> > at least not in my repo with latest changes.
> >
> > Let me know when the test-suite passes on X86, and I will gladly run it on
> > SystemZ.
> >
> > /Jonas
>
> LLVM passes test-suite on X86 now, so I think we're in a good shape to try
> on other platforms if you want to take a look.
damn, s/LLVM/LLVM with NewGVN/
Attached newgvn_fail.ll
(63518 bytes, application/octet-stream): reduced test case for opt with newgvn crash
Huh, I got still another fail today on SystemZ with
llvm/trunk@292353
cfe/trunk@292343
test-suite/trunk@292129
NewGVN.cpp:1084: void NewGVN::moveValueToNewCongruenceClass(llvm::Instruction*,
CongruenceClass*, CongruenceClass*): Assertion `(!isa<Instruction>(NewClass-
>RepLeader) || !NewClass->RepLeader || I == NewClass->RepLeader || !DT-
>properlyDominates( I->getParent(), cast<Instruction>(NewClass->RepLeader)-
>getParent())) && "New class for instruction should not be dominated by
instruction"' failed.
/bin/opt -O3 -enable-newgvn -S ./newgvn_fail.ll
I postedthe reduced test-case above.
(In reply to comment #13)
> Huh, I got still another fail today on SystemZ with
> llvm/trunk@292353
> cfe/trunk@292343
> test-suite/trunk@292129
>
> NewGVN.cpp:1084: void
> NewGVN::moveValueToNewCongruenceClass(llvm::Instruction*, CongruenceClass*,
> CongruenceClass*): Assertion `(!isa<Instruction>(NewClass->RepLeader) ||
> !NewClass->RepLeader || I == NewClass->RepLeader || !DT->properlyDominates(
> I->getParent(), cast<Instruction>(NewClass->RepLeader)->getParent())) &&
> "New class for instruction should not be dominated by instruction"' failed.
>
> /bin/opt -O3 -enable-newgvn -S ./newgvn_fail.ll
>
> I postedthe reduced test-case above.
Thank you very much. I'll reduce/investigate this. For the future, do you mind
to open a new issue and link it here? It would make our tracking much easier =)
newgvn_fail.ll
(63518 bytes, application/octet-stream)Meta ticket covering the addition of the NewGVN pass.
WIP Patch: https://reviews.llvm.org/D26224