[llvm-commits] [llvm] r146357 - in /llvm/trunk: include/llvm/Intrinsics.td lib/Analysis/ConstantFolding.cpp lib/Transforms/Scalar/SimplifyLibCalls.cpp lib/VMCore/AutoUpgrade.cpp

Chris Lattner clattner at apple.com
Mon Dec 12 15:47:36 PST 2011


On Dec 12, 2011, at 2:07 AM, Duncan Sands wrote:
> Hi Chandler, don't listen to that Chris guy, what does he know?! :)  Given the
> amount of codegen ugliness (i.e. either duplicating the set of CTTZ etc nodes,
> one for each flag version, or modifying a ton of patterns to expect more than
> one argument) hopefully Chris will accept the simpler version of your patch in
> which there is only the "undef" form of the intrinsics.  Someone can wlays add
> a flag later if there proves to be a really compelling need for it such as
> codegen finding it too hard to get rid of pointless comparisons of the argument
> with zero on platforms with always-well-defined bit counting instructions.

We discussed that option on the list.  The feeling was that it regresses on useful functionality: a frontend may want "defined at zero semantics" and codegen should be able to legalize in a select if needed.  Having the undef bit also allows the optimizer to infer that the input can't be zero, allowing potentially cheaper instruction sequences to be synthesized by codegen etc.

-Chris




More information about the llvm-commits mailing list