[PATCH] [GC] Turn {undef,null} transforms into strategy
Sanjoy Das
sanjoy at playingwithpointers.com
Sun Jan 4 16:23:44 PST 2015
> I'm just following what I think I understood from your comment: "There might be some weird collector this property does not hold for." -- so, I thought there should be a way to define a custom lowering pass for "relocate undef" or "relocate null" instead of turning them into "undef" and "null" everytime. Did I misunderstand? What are those TODO comments about?
In this context: "There might be some weird collector this property
does not hold for." == "This property holds for virtually every
production-grade garbage collector". It is better to defer this
complexity (of conditionally switching off the two optimizations) till
someone actually tries to get statepoints working with such a
collector.
> GCStrategy code is invoked on a gc "..." annotation, irrespective of whether it uses the gcroot mechanism, no?
relocate(null) == null is an optimization, similar to "add x 0 == x".
I don't think it should live in GCStrategy -- it is inaccurate for
this transform to be part of any "lowering" phase. Even from a
practical standpoint, it is better to run it interleaved with other
transforms done by instcombine.
-- Sanjoy
More information about the llvm-commits
mailing list