[llvm-commits] [llvm] r47122 - in /llvm/trunk: include/llvm/Target/TargetLowering.h lib/CodeGen/SelectionDAG/LegalizeDAG.cpp lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp lib/CodeGen/SelectionDAG/TargetLowering.cpp lib/Target/ARM/ARMISelLowering.cpp lib/Target/Alpha/AlphaISelLowering.cpp lib/Target/Alpha/AlphaISelLowering.h lib/Target/IA64/IA64ISelLowering.cpp lib/Target/IA64/IA64ISelLowering.h lib/Target/Sparc/SparcISelDAGToDAG.cpp lib/Target/X86/X86ISelLowering.cpp

Duncan Sands baldrick at free.fr
Thu Feb 14 23:54:53 PST 2008


Hi Evan,

> > Finally, when doing libcalls, set isZExt on
> > a parameter if it is "unsigned".  Currently
> > isSExt is set when signed, and nothing is
> > set otherwise.  This should be right for all
> > calls to standard library routines.
> 
> I am not sure I totally understand the reason for this. Is it because  
> these libcalls are implicitly defined?

in what seems to be a hang-over from the days when
types were signed or unsigned, all places that generate
calls to library functions (whether via ExpandLibCall
or via a direct call to LowerCallTo, used a lot for memcpy
and friends) only ever set isSExt on arguments, they
never set isZExt.  Since library calls are to C
functions, and C integer arguments are always either
zero extended or sign extended (and should never be
any extended) [*] then that means that we should be
setting isZExt when not setting isSExt.  This does
result in isZExt being set for pointers, but that should
be harmless.

Note that ExpandLibCall now sets either isSExt or
isZExt for return values, for the same reason.

Ciao,

Duncan.

[*] I don't know much about C so I could be wrong here.



More information about the llvm-commits mailing list