[LLVMdev] llvm.meta (was Rotated loop identification)

Rafael EspĂ­ndola rafael.espindola at gmail.com
Tue Feb 18 13:24:56 PST 2014


> A value invariant is quite different because we're *only* constraining the
> value itself at that point in the CFG, not the semantics of the data pointed
> to at other places in the CFG. The question is, can RAUW change the value?
> I've been assuming the answer is "no". It seems like a terrible thing to do,
> but there's no rule against it and no way to verify.

Just an interesting bug that is an example of this: http://llvm.org/pr14893

I have added a helper function (dropUnknownMetadata) to make it easier
to drop unknown metadata, but it is still easier to introduce
miscompilations with metadata than I would like.

Maybe a reasonable experiment for comparing the two general
possibilities that Chandler mentioned would be to transition from the
range metadata to a range predicate function that causes an actual
use. That would require benchmarking to find cases where that use
would prevent optimizations and fixing them. In particular,
-fstrict-enum should not degrade performance :-)

If we can create a set of utility functions that allow a pass to
easily ignore uses it knows are safe, I would probably prefer that to
metadata alternative where we always have to remember to use something
like dropUnknownMetadata to avoid miscompilations.

Cheers,
Rafael



More information about the llvm-dev mailing list