[PATCH] D24104: Make GlobalsAA ignore dead constant expressions.

Eli Friedman via llvm-commits llvm-commits at lists.llvm.org
Fri Sep 30 13:04:10 PDT 2016


efriedma added inline comments.


> sanjoy wrote in GlobalsModRef.cpp:369
> How about pulling this out of the loop?  That is, do:
> 
>   if (auto *C = dyn_cast<Constant>(V))
>     if (!C->isConstantUsed())
>       return false;

That wouldn't work... say `V` is the global `@a` (with live loads and stores which access it), and `I` is a constant expression `ptrtoint @a to i32`.  We want to ignore `I` if it's dead; checking `V` is useless.

> sanjoy wrote in dead-uses.ll:11
> Some more context here will be helpful -- are you trying to check if the load was hoisted out of the loop?  If so, then a `CHECK: entry:` before the `load` will be nice (since there are two instances of `br label %for.inc`).

Yes; I'll change this to make that more clear.

Repository:
  rL LLVM

https://reviews.llvm.org/D24104





More information about the llvm-commits mailing list