[PATCH] D43716: [EarlyCSE] Exploit open ended invariant.start scopes

Anna Thomas via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Mar 12 10:49:28 PDT 2018


anna added inline comments.


================
Comment at: test/Transforms/EarlyCSE/invariant-loads.ll:99
+define void @test_false_negative_dse(i32* %p, i1 %cnd) {
+; CHECK-LABEL: @test_false_negative_dse
+; CHECK: store
----------------
reames wrote:
> anna wrote:
> > why are we not able to catch this case? `invariant.load` is more powerful than invariant.start and we unconditionally return true for `isOperatingOnInvariantMemAt`
> The way this works currently is that we're only creating invariant scopes for invariant.start calls.  I agree we could (and in the near future will) create them for invariant.load, but at the moment we're not.  Given that, the call advances the generation.  The unconditional "yes" for invariant_loads isn't triggered since we never pass in the load.  Instead, we see the store is not an invariant_load and fallback to the conservative logic.  
ah that makes sense! Thanks for the clarification.


https://reviews.llvm.org/D43716





More information about the llvm-commits mailing list