[llvm-commits] [llvm] r62045 - /llvm/trunk/lib/Transforms/Scalar/InstructionCombining.cpp

Eli Friedman eli.friedman at gmail.com
Wed Jan 14 13:17:20 PST 2009


On Wed, Jan 14, 2009 at 8:01 AM, Nicolas Geoffray
<nicolas.geoffray at lip6.fr> wrote:
> Quick question folllowing this patch. Getting the size of a type is
> platform dependent, and since InstCombine makes lots of uses of
> getTypeSize, InstCombine is therefore platform dependent. Is this OK? I
> know this patch did not introduce the platform-dependency, but I was
> just curious if that's OK, and if LLVM considers transformation passes
> strongly platform dependent.

Some passes are target-dependent, and some passes aren't.  Passes
which depend on platform-specific stuff use something like
"AU.addRequired<TargetData>();" in getAnalysisUsage().  There hasn't
really been much need for target-independent optimization passes, so
InstCombine always requires TargetData even through it could do useful
stuff without it.  If you need a target-independent version of
InstCombine (or for another pass in a similar situation), a patch to
allow instantiating a version of InstCombine without the TargetData
dependency would probably be okay.

-Eli



More information about the llvm-commits mailing list