efriedma-quic wrote:

The way LLVM backend works in general is that if an integer is smaller than a 
register, when type legalization converts that to a larger integer, the high 
bits are undefined.  This generally doesn't cause any issues because nothing 
can actually observe those bits.  Your analysis that concludes "int" is special 
is probably wrong; I think you're just getting lucky with heuristics for 
lowering constants.

Some backends explicitly zero-extend or sign-extend function arguments to match 
ABI conventions, at least in some cases.  The BPF backend is one of those 
backends: BPFTargetLowering::LowerCall will sign-extend arguments marked 
"signext".

Sign-extending 32-bit integers is a choice you can make, I guess, but if you're 
not trying to conform to an external ABI specification, it doesn't really solve 
anything.

https://github.com/llvm/llvm-project/pull/84874
_______________________________________________
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to