[cfe-commits] r165816 - in /cfe/trunk: lib/CodeGen/TargetInfo.cpp test/CodeGen/ppc64-struct-onefloat.c
Argyrios Kyrtzidis
kyrtzidis at apple.com
Fri Oct 12 13:00:01 PDT 2012
The test you added is failing, please fix soon or revert.
> ******************** TEST 'Clang :: CodeGen/ppc64-struct-onefloat.c' FAILED ********************Script:
> --
> /Users/buildslave/zorg/buildbot/smooshlab/slave-0.8/build.clang-x86_64-darwin10-nobootstrap-RA/clang-build/Release+Asserts/bin/clang -cc1 -internal-isystem /Users/buildslave/zorg/buildbot/smooshlab/slave-0.8/build.clang-x86_64-darwin10-nobootstrap-RA/clang-build/Release+Asserts/bin/../lib/clang/3.2/include -O0 -triple powerpc64-unknown-linux-gnu -emit-llvm -o - /Users/buildslave/zorg/buildbot/smooshlab/slave-0.8/build.clang-x86_64-darwin10-nobootstrap-RA/clang.src/test/CodeGen/ppc64-struct-onefloat.c | FileCheck /Users/buildslave/zorg/buildbot/smooshlab/slave-0.8/build.clang-x86_64-darwin10-nobootstrap-RA/clang.src/test/CodeGen/ppc64-struct-onefloat.c
> --
> Exit Code: 1
> Command Output (stderr):
> --
> Assertion failed: (semantics.arithmeticOK && "Compile-time arithmetic does not support these semantics"), function assertArithmeticOK, file /Users/buildslave/zorg/buildbot/smooshlab/slave-0.8/build.clang-x86_64-darwin10-nobootstrap-RA/llvm/lib/Support/APFloat.cpp, line 122.
> 0 clang 0x00000001016c1d62 PrintStackTrace(void*) + 34
> 1 clang 0x00000001016c2244 SignalHandler(int) + 644
> 2 libSystem.B.dylib 0x00007fff853921ba _sigtramp + 26
> 3 libSystem.B.dylib 0x6c4650412f74726f _sigtramp + 2856014031
> 4 clang 0x00000001016c1fa6 abort + 22
> 5 clang 0x00000001016c1f81 __assert_rtn + 81
> 6 clang 0x000000010168301b llvm::APFloat::APFloat(llvm::fltSemantics const&) + 123
> 7 clang 0x00000001004692ff BuildFloatingLiteral(clang::Sema&, clang::NumericLiteralParser&, clang::QualType, clang::SourceLocation) + 79
> 8 clang 0x0000000100468598 clang::Sema::ActOnNumericConstant(clang::Token const&, clang::Scope*) + 1800
> 9 clang 0x00000001002dd0a0 clang::Parser::ParseCastExpression(bool, bool, bool&, clang::Parser::TypeCastState) + 496
> 10 clang 0x00000001002ddebe clang::Parser::ParseCastExpression(bool, bool, bool&, clang::Parser::TypeCastState) + 4110
> 11 clang 0x00000001002da527 clang::Parser::ParseAssignmentExpression(clang::Parser::TypeCastState) + 135
> 12 clang 0x00000001002f3e0b clang::Parser::ParseBraceInitializer() + 571
> 13 clang 0x00000001002be0ea clang::Parser::ParseDeclarationAfterDeclaratorAndAttributes(clang::Declarator&, clang::Parser::ParsedTemplateInfo const&) + 1370
> 14 clang 0x00000001002bca9d clang::Parser::ParseDeclGroup(clang::ParsingDeclSpec&, unsigned int, bool, clang::SourceLocation*, clang::Parser::ForRangeInit*) + 1693
> 15 clang 0x00000001002b9703 clang::Parser::ParseSimpleDeclaration(llvm::SmallVector<clang::Stmt*, 32u>&, unsigned int, clang::SourceLocation&, clang::Parser::ParsedAttributesWithRange&, bool, clang::Parser::ForRangeInit*) + 483
> 16 clang 0x00000001002b945c clang::Parser::ParseDeclaration(llvm::SmallVector<clang::Stmt*, 32u>&, unsigned int, clang::SourceLocation&, clang::Parser::ParsedAttributesWithRange&) + 924
> 17 clang 0x0000000100306791 clang::Parser::ParseStatementOrDeclarationAfterAttributes(llvm::SmallVector<clang::Stmt*, 32u>&, bool, clang::SourceLocation*, clang::Parser::ParsedAttributesWithRange&) + 2033
> 18 clang 0x0000000100305f0a clang::Parser::ParseStatementOrDeclaration(llvm::SmallVector<clang::Stmt*, 32u>&, bool, clang::SourceLocation*) + 154
> 19 clang 0x000000010030d3be clang::Parser::ParseCompoundStatementBody(bool) + 1598
> 20 clang 0x000000010030f01b clang::Parser::ParseFunctionStatementBody(clang::Decl*, clang::Parser::ParseScope&) + 171
> 21 clang 0x000000010031f03f clang::Parser::ParseFunctionDefinition(clang::ParsingDeclarator&, clang::Parser::ParsedTemplateInfo const&, llvm::SmallVector<clang::Parser::LateParsedAttribute*, 2u>*) + 2127
> 22 clang 0x00000001002bc9b1 clang::Parser::ParseDeclGroup(clang::ParsingDeclSpec&, unsigned int, bool, clang::SourceLocation*, clang::Parser::ForRangeInit*) + 1457
> 23 clang 0x000000010031e66b clang::Parser::ParseDeclOrFunctionDefInternal(clang::Parser::ParsedAttributesWithRange&, clang::ParsingDeclSpec&, clang::AccessSpecifier) + 667
> 24 clang 0x000000010031e0f1 clang::Parser::ParseDeclarationOrFunctionDefinition(clang::Parser::ParsedAttributesWithRange&, clang::ParsingDeclSpec*, clang::AccessSpecifier) + 337
> 25 clang 0x000000010031d643 clang::Parser::ParseExternalDeclaration(clang::Parser::ParsedAttributesWithRange&, clang::ParsingDeclSpec*) + 2867
> 26 clang 0x000000010031ca87 clang::Parser::ParseTopLevelDecl(clang::OpaquePtr<clang::DeclGroupRef>&) + 311
> 27 clang 0x00000001002af636 clang::ParseAST(clang::Sema&, bool, bool) + 454
> 28 clang 0x000000010027299e clang::CodeGenAction::ExecuteAction() + 206
> 29 clang 0x000000010006fd58 clang::FrontendAction::Execute() + 104
> 30 clang 0x000000010004487f clang::CompilerInstance::ExecuteAction(clang::FrontendAction&) + 991
> 31 clang 0x000000010000bc0e clang::ExecuteCompilerInvocation(clang::CompilerInstance*) + 3470
> 32 clang 0x000000010000121a cc1_main(char const**, char const**, char const*, void*) + 730
> 33 clang 0x000000010000843c main + 3388
> 34 clang 0x0000000100000f34 start + 52
> 35 clang 0x000000000000000b start + 4294963467
> Stack dump:
> 0. Program arguments: /Users/buildslave/zorg/buildbot/smooshlab/slave-0.8/build.clang-x86_64-darwin10-nobootstrap-RA/clang-build/Release+Asserts/bin/clang -cc1 -internal-isystem /Users/buildslave/zorg/buildbot/smooshlab/slave-0.8/build.clang-x86_64-darwin10-nobootstrap-RA/clang-build/Release+Asserts/bin/../lib/clang/3.2/include -O0 -triple powerpc64-unknown-linux-gnu -emit-llvm -o - /Users/buildslave/zorg/buildbot/smooshlab/slave-0.8/build.clang-x86_64-darwin10-nobootstrap-RA/clang.src/test/CodeGen/ppc64-struct-onefloat.c
> 1. /Users/buildslave/zorg/buildbot/smooshlab/slave-0.8/build.clang-x86_64-darwin10-nobootstrap-RA/clang.src/test/CodeGen/ppc64-struct-onefloat.c:41:15: current parser token '155.1l'
> 2. /Users/buildslave/zorg/buildbot/smooshlab/slave-0.8/build.clang-x86_64-darwin10-nobootstrap-RA/clang.src/test/CodeGen/ppc64-struct-onefloat.c:38:1: parsing function body 'foo'
> 3. /Users/buildslave/zorg/buildbot/smooshlab/slave-0.8/build.clang-x86_64-darwin10-nobootstrap-RA/clang.src/test/CodeGen/ppc64-struct-onefloat.c:38:1: in compound statement ('{}')
> FileCheck error: '-' is empty.
> --
>
> ********************
On Oct 12, 2012, at 12:26 PM, Bill Schmidt <wschmidt at linux.vnet.ibm.com> wrote:
> Author: wschmidt
> Date: Fri Oct 12 14:26:17 2012
> New Revision: 165816
>
> URL: http://llvm.org/viewvc/llvm-project?rev=165816&view=rev
> Log:
> This patch addresses PR13948.
>
> For 64-bit PowerPC SVR4, an aggregate containing only one
> floating-point field (float, double, or long double) must be passed in
> a register as though just that field were present. This patch
> addresses the issue during Clang code generation by specifying in the
> ABIArgInfo for the argument that the underlying type is passed
> directly in a register. The included test case verifies flat and
> nested structs for the three data types.
>
> Added:
> cfe/trunk/test/CodeGen/ppc64-struct-onefloat.c
> Modified:
> cfe/trunk/lib/CodeGen/TargetInfo.cpp
>
> Modified: cfe/trunk/lib/CodeGen/TargetInfo.cpp
> URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/CodeGen/TargetInfo.cpp?rev=165816&r1=165815&r2=165816&view=diff
> ==============================================================================
> --- cfe/trunk/lib/CodeGen/TargetInfo.cpp (original)
> +++ cfe/trunk/lib/CodeGen/TargetInfo.cpp Fri Oct 12 14:26:17 2012
> @@ -2602,13 +2602,31 @@
> public:
> PPC64_SVR4_ABIInfo(CodeGen::CodeGenTypes &CGT) : DefaultABIInfo(CGT) {}
>
> - // TODO: Could override computeInfo to model the ABI more completely if
> - // it would be helpful. Example: We might remove the byVal flag from
> - // aggregate arguments that fit in a register to avoid pushing them to
> - // memory on function entry. Note that this is a performance optimization,
> - // not a compliance issue. In general we prefer to keep ABI details in
> - // the back end where possible, but modifying an argument flag seems like
> - // a good thing to do before invoking the back end.
> + // TODO: We can add more logic to computeInfo to improve performance.
> + // Example: For aggregate arguments that fit in a register, we could
> + // use getDirectInReg (as is done below for structs containing a single
> + // floating-point value) to avoid pushing them to memory on function
> + // entry. This would require changing the logic in PPCISelLowering
> + // when lowering the parameters in the caller and args in the callee.
> + virtual void computeInfo(CGFunctionInfo &FI) const {
> + FI.getReturnInfo() = classifyReturnType(FI.getReturnType());
> + for (CGFunctionInfo::arg_iterator it = FI.arg_begin(), ie = FI.arg_end();
> + it != ie; ++it) {
> + // We rely on the default argument classification for the most part.
> + // One exception: An aggregate containing a single floating-point
> + // item must be passed in a register if one is available.
> + const Type *T = isSingleElementStruct(it->type, getContext());
> + if (T) {
> + const BuiltinType *BT = T->getAs<BuiltinType>();
> + if (BT && BT->isFloatingPoint()) {
> + QualType QT(T, 0);
> + it->info = ABIArgInfo::getDirectInReg(CGT.ConvertType(QT));
> + continue;
> + }
> + }
> + it->info = classifyArgumentType(it->type);
> + }
> + }
>
> virtual llvm::Value *EmitVAArg(llvm::Value *VAListAddr,
> QualType Ty,
>
> Added: cfe/trunk/test/CodeGen/ppc64-struct-onefloat.c
> URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/CodeGen/ppc64-struct-onefloat.c?rev=165816&view=auto
> ==============================================================================
> --- cfe/trunk/test/CodeGen/ppc64-struct-onefloat.c (added)
> +++ cfe/trunk/test/CodeGen/ppc64-struct-onefloat.c Fri Oct 12 14:26:17 2012
> @@ -0,0 +1,65 @@
> +// REQUIRES: ppc64-registered-target
> +// RUN: %clang_cc1 -O0 -triple powerpc64-unknown-linux-gnu -emit-llvm -o - %s | FileCheck %s
> +
> +typedef struct s1 { float f; } Sf;
> +typedef struct s2 { double d; } Sd;
> +typedef struct s3 { long double ld; } Sld;
> +typedef struct s4 { Sf fs; } SSf;
> +typedef struct s5 { Sd ds; } SSd;
> +typedef struct s6 { Sld lds; } SSld;
> +
> +void bar(Sf a, Sd b, Sld c, SSf d, SSd e, SSld f) {}
> +
> +// CHECK: define void @bar
> +// CHECK: %a = alloca %struct.s1, align 4
> +// CHECK: %b = alloca %struct.s2, align 8
> +// CHECK: %c = alloca %struct.s3, align 16
> +// CHECK: %d = alloca %struct.s4, align 4
> +// CHECK: %e = alloca %struct.s5, align 8
> +// CHECK: %f = alloca %struct.s6, align 16
> +// CHECK: %coerce.dive = getelementptr %struct.s1* %a, i32 0, i32 0
> +// CHECK: store float %a.coerce, float* %coerce.dive, align 1
> +// CHECK: %coerce.dive1 = getelementptr %struct.s2* %b, i32 0, i32 0
> +// CHECK: store double %b.coerce, double* %coerce.dive1, align 1
> +// CHECK: %coerce.dive2 = getelementptr %struct.s3* %c, i32 0, i32 0
> +// CHECK: store ppc_fp128 %c.coerce, ppc_fp128* %coerce.dive2, align 1
> +// CHECK: %coerce.dive3 = getelementptr %struct.s4* %d, i32 0, i32 0
> +// CHECK: %coerce.dive4 = getelementptr %struct.s1* %coerce.dive3, i32 0, i32 0
> +// CHECK: store float %d.coerce, float* %coerce.dive4, align 1
> +// CHECK: %coerce.dive5 = getelementptr %struct.s5* %e, i32 0, i32 0
> +// CHECK: %coerce.dive6 = getelementptr %struct.s2* %coerce.dive5, i32 0, i32 0
> +// CHECK: store double %e.coerce, double* %coerce.dive6, align 1
> +// CHECK: %coerce.dive7 = getelementptr %struct.s6* %f, i32 0, i32 0
> +// CHECK: %coerce.dive8 = getelementptr %struct.s3* %coerce.dive7, i32 0, i32 0
> +// CHECK: store ppc_fp128 %f.coerce, ppc_fp128* %coerce.dive8, align 1
> +// CHECK: ret void
> +
> +void foo(void)
> +{
> + Sf p1 = { 22.63f };
> + Sd p2 = { 19.47 };
> + Sld p3 = { -155.1l };
> + SSf p4 = { { 22.63f } };
> + SSd p5 = { { 19.47 } };
> + SSld p6 = { { -155.1l } };
> + bar(p1, p2, p3, p4, p5, p6);
> +}
> +
> +// CHECK: define void @foo
> +// CHECK: %coerce.dive = getelementptr %struct.s1* %p1, i32 0, i32 0
> +// CHECK: %{{[0-9]+}} = load float* %coerce.dive, align 1
> +// CHECK: %coerce.dive1 = getelementptr %struct.s2* %p2, i32 0, i32 0
> +// CHECK: %{{[0-9]+}} = load double* %coerce.dive1, align 1
> +// CHECK: %coerce.dive2 = getelementptr %struct.s3* %p3, i32 0, i32 0
> +// CHECK: %{{[0-9]+}} = load ppc_fp128* %coerce.dive2, align 1
> +// CHECK: %coerce.dive3 = getelementptr %struct.s4* %p4, i32 0, i32 0
> +// CHECK: %coerce.dive4 = getelementptr %struct.s1* %coerce.dive3, i32 0, i32 0
> +// CHECK: %{{[0-9]+}} = load float* %coerce.dive4, align 1
> +// CHECK: %coerce.dive5 = getelementptr %struct.s5* %p5, i32 0, i32 0
> +// CHECK: %coerce.dive6 = getelementptr %struct.s2* %coerce.dive5, i32 0, i32 0
> +// CHECK: %{{[0-9]+}} = load double* %coerce.dive6, align 1
> +// CHECK: %coerce.dive7 = getelementptr %struct.s6* %p6, i32 0, i32 0
> +// CHECK: %coerce.dive8 = getelementptr %struct.s3* %coerce.dive7, i32 0, i32 0
> +// CHECK: %{{[0-9]+}} = load ppc_fp128* %coerce.dive8, align 1
> +// CHECK: call void @bar(float inreg %{{[0-9]+}}, double inreg %{{[0-9]+}}, ppc_fp128 inreg %{{[0-9]+}}, float inreg %{{[0-9]+}}, double inreg %{{[0-9]+}}, ppc_fp128 inreg %{{[0-9]+}})
> +// CHECK: ret void
>
>
> _______________________________________________
> cfe-commits mailing list
> cfe-commits at cs.uiuc.edu
> http://lists.cs.uiuc.edu/mailman/listinfo/cfe-commits
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20121012/8eff7046/attachment.html>
More information about the cfe-commits
mailing list