[LLVMdev] FileCheck for instructions of indeterminate order?

Rafael EspĂ­ndola rafael.espindola at gmail.com
Wed Oct 3 19:58:47 PDT 2012

On 19 September 2012 13:06, William J. Schmidt
<wschmidt at linux.vnet.ibm.com> wrote:
> To test some recent changes, I need to verify that seven instructions
> are generated.  However, the order of those instructions doesn't matter
> (they are all independent loads from memory).  Is there a way to tell
> FileCheck to reset its scan position rather than assuming all CHECK:
> instructions must be in the given order?
> My initial version of the test was to use -O0, attempting to ensure that
> the instructions weren't rescheduled.  Although this gave a reproducible
> order on my PowerPC machine, various buildbots of other architectures
> produced codegen in a different order when cross-compiling to PowerPC.
> Needless to say, the test is XFAILed until I can figure a way to test
> this more safely.
> All help appreciated!

The order should be deterministic, even if arbitrary. The most common
source of problem is some code iterating over a hash.

> Thanks,
> Bill


More information about the llvm-dev mailing list