[llvm-dev] LoopIdiomRegognize vs Preserved

Haicheng Wu via llvm-dev llvm-dev at lists.llvm.org
Mon Feb 8 08:50:02 PST 2016

Hi Mikael,

What is your compilation command to trig the assert?  I am trying to reproduce your problem.

Thank you,


-----Original Message-----
From: llvm-dev [mailto:llvm-dev-bounces at lists.llvm.org] On Behalf Of Mikael Holmén via llvm-dev
Sent: Monday, February 08, 2016 4:33 AM
To: llvm-dev at lists.llvm.org
Subject: [llvm-dev] LoopIdiomRegognize vs Preserved


I'm having problems with the LoopIdiomRegognizer crashing on me with

An asserting value handle still pointed to this value!
UNREACHABLE executed at ../lib/IR/Value.cpp:695!

If I remove




everything goes well.

The C-code triggering this is

void foo(int a[10][10])
     int	i, j, k;

     for (i = 0; i < 1; i++) {
         for (j = 0; j < 2; j++) {
             for (k = 0; k < 10; k++) {
                 a[j][k] = 42;

First LoopIdiomRecognize replaces the store in the inner loop with a memset in the outer loop, and later, when examining the outer loop it tries to replace that memset with an even bigger memset in the outermost loop. But then, when removing the "old" memset, the assert blows.

I don't know LoopIdiomRecognize very well at all, is it obvious that AAResultsWrapperPass and/or LoopInfoWrapperPass should not be preserved here?

LLVM Developers mailing list
llvm-dev at lists.llvm.org

More information about the llvm-dev mailing list