[clang] [clang][codegen] Don't mark "int" TBAA on FP libcalls with indirect args (PR #108853)

via cfe-commits cfe-commits at lists.llvm.org
Wed Sep 18 18:56:54 PDT 2024


================
@@ -686,12 +686,31 @@ static Value *EmitSignBit(CodeGenFunction &CGF, Value *V) {
   return CGF.Builder.CreateICmpSLT(V, Zero);
 }
 
+/// Checks no arguments or results are passed indirectly in the ABI (i.e. via a
+/// hidden pointer). This is used to check annotating FP libcalls (that could
+/// set `errno`) with "int" TBAA metadata is safe. If any floating-point
+/// arguments are passed indirectly, setup for the call could be incorrectly
+/// optimized out.
+static bool HasNoIndirectArgumentsOrResults(CGFunctionInfo const &FnInfo) {
+  auto IsIndirect = [&](ABIArgInfo const &info) {
----------------
vfdff wrote:

May I ask why don't you determine whether the type of return and arguments is a pointer?  What's the difference?

https://github.com/llvm/llvm-project/pull/108853


More information about the cfe-commits mailing list