- Jul 29, 2010
-
-
Argyrios Kyrtzidis authored
DeclIsRequiredFunctionOrFileScopedVar. This is essentially a CodeGen predicate that is also needed by the PCH mechanism to determine whether a decl needs to be deserialized during PCH loading for codegen purposes. Since this logic is shared by CodeGen and the PCH mechanism, move it to the ASTContext, thus CodeGenModule's GetLinkageForFunction/GetLinkageForVariable and the GVALinkage enum is moved out of CodeGen. This fixes current (and avoids future) codegen-from-PCH bugs. llvm-svn: 109784
-
rdar://8251384Chris Lattner authored
end of a struct. This improves the case when the struct being passed contains 3 floats, either due to a struct or array of 3 things. Before we'd generate this IR for the testcase: define float @bar(double %X.coerce0, double %X.coerce1) nounwind { entry: %X = alloca %struct.foof, align 8 ; <%struct.foof*> [#uses=2] %0 = bitcast %struct.foof* %X to %1* ; <%1*> [#uses=2] %1 = getelementptr %1* %0, i32 0, i32 0 ; <double*> [#uses=1] store double %X.coerce0, double* %1 %2 = getelementptr %1* %0, i32 0, i32 1 ; <double*> [#uses=1] store double %X.coerce1, double* %2 %tmp = getelementptr inbounds %struct.foof* %X, i32 0, i32 2 ; <float*> [#uses=1] %tmp1 = load float* %tmp ; <float> [#uses=1] ret float %tmp1 } which compiled (with optimization) to: _bar: ## @bar ## BB#0: ## %entry movd %xmm1, %rax movd %eax, %xmm0 ret Now we produce: define float @bar(double %X.coerce0, float %X.coerce1) nounwind { entry: %X = alloca %struct.foof, align 8 ; <%struct.foof*> [#uses=2] %0 = bitcast %struct.foof* %X to %0* ; <%0*> [#uses=2] %1 = getelementptr %0* %0, i32 0, i32 0 ; <double*> [#uses=1] store double %X.coerce0, double* %1 %2 = getelementptr %0* %0, i32 0, i32 1 ; <float*> [#uses=1] store float %X.coerce1, float* %2 %tmp = getelementptr inbounds %struct.foof* %X, i32 0, i32 2 ; <float*> [#uses=1] %tmp1 = load float* %tmp ; <float> [#uses=1] ret float %tmp1 } and: _bar: ## @bar ## BB#0: ## %entry movaps %xmm1, %xmm0 ret llvm-svn: 109776
-
Eric Christopher authored
llvm-svn: 109775
-
John McCall authored
llvm-svn: 109774
-
Eli Friedman authored
if CExpr is a ConstantInt. llvm-svn: 109773
-
Owen Anderson authored
llvm-svn: 109772
-
Nate Begeman authored
llvm-svn: 109771
-
Nate Begeman authored
Add intrinsics __builtin_arm_qadd & __builtin_arm_qsub to allow access to the QADD & QSUB instructions. Behave identically to __qadd & __qsub RealView instruction intrinsics. llvm-svn: 109770
-
John McCall authored
message is properly contaminated with nonsense about timing passes that doesn't apply at all to this utility. :) llvm-svn: 109769
-
Chris Lattner authored
as <2 x float> instead of as double. The backend isn't ready yet, but infrastructure in the frontend can come up. llvm-svn: 109768
-
Benjamin Kramer authored
Plug the remaining MC leaks by giving MCObjectStreamer/MCAsmStreamer ownership of the TargetAsmBackend and the MCCodeEmitter. llvm-svn: 109767
-
Benjamin Kramer authored
llvm-svn: 109766
-
Dale Johannesen authored
llvm-svn: 109765
-
Jakob Stoklund Olesen authored
We do sometimes load from a too small stack slot when dealing with x86 arguments (varargs and smaller-than-32-bit args). It looks like we know what we are doing in those cases, so I am going to remove the assert instead of artifically enlarging stack slot sizes. The assert in storeRegToStackSlot stays in. We don't want to write beyond the bounds of a stack slot. llvm-svn: 109764
-
Chris Lattner authored
make it clear that this function should only return a type that the codegen will classify the same as an INTEGER type. llvm-svn: 109763
-
Chris Lattner authored
that Eli pointed out, rdar://8249586 llvm-svn: 109762
-
Chris Lattner authored
this will hopefully fix the osuosl clang-i686-darwin10 builder. llvm-svn: 109760
-
rdar://8250764Chris Lattner authored
return where the struct has a base but no fields. This was because the x86-64 abi logic was checking the wrong predicate in one place. This was introduced in r91874, which was a fix for PR5831, which lacked a CHECK line, so I verified and added it. llvm-svn: 109759
-
Fariborz Jahanian authored
variables to those in file scope (nonfragile-abi2). Fixes radar 8248681. llvm-svn: 109758
-
Douglas Gregor authored
with CK_NoOp. Fixes PR7727. llvm-svn: 109757
-
Peter Collingbourne authored
This patch uses the newly added Latest field of CommonBase to provide a getNextRedeclaration() implementation for RedeclarableTemplateDecl. llvm-svn: 109756
-
Peter Collingbourne authored
This patch adds a Latest field to RedeclarableTemplateDecl's CommonBase class which is used to store the latest redeclaration. llvm-svn: 109755
-
Peter Collingbourne authored
This patch refactors much of the common code in ClassTemplateDecl and FunctionTemplateDecl into a common base class RedeclarableTemplateDecl together with support functions in a template class RedeclarableTemplate. The patch also includes similar refactoring for these classes' PCH reader and writer implementations. llvm-svn: 109754
-
Douglas Gregor authored
one because we're referencing a variable of type NSString &), the resulting type is an ObjCObjectPointerType. llvm-svn: 109753
-
Daniel Dunbar authored
llvm-svn: 109752
-
Douglas Gregor authored
qualifiers) when checking a K&R function definition against a previous prototype. Fixes <rdar://problem/8193107>. llvm-svn: 109751
-
Howard Hinnant authored
llvm-svn: 109750
-
Douglas Gregor authored
before looking for conversions to pointer type. Fixes <rdar://problem/8248780>. llvm-svn: 109749
-
Douglas Gregor authored
Reword the empty struct/union warning in C to note that such structs and unions have size 0 in C, size 1 in C++. Put this warning under -Wc++-compat. llvm-svn: 109748
-
Rafael Espindola authored
memory when one of the original BB is destroyed. llvm-svn: 109747
-
Benjamin Kramer authored
llvm-svn: 109746
-
Benjamin Kramer authored
llvm-svn: 109745
-
John McCall authored
it establishes a context and does a complaining diff. Also make sure we unify the prelude and postlude of a diff after a block-diff call. llvm-svn: 109744
-
John McCall authored
structurally identical. llvm-svn: 109743
-
John McCall authored
any differences we see. This should only happen if there are "non-structural" differences between the instructions, i.e. differences which wouldn't cause diff to return true. llvm-svn: 109742
-
John McCall authored
in despite not ever incrementing any path costs, so that the only nonzero costs arose from the all-left path in the first column. Anyway. Perform the diff starting from the beginning of the block to avoid capturing (say) loads of allocas. Vastly improves diff results on code that hasn't been mem2reg'ed. llvm-svn: 109741
-
John McCall authored
llvm-svn: 109740
-
John McCall authored
diff of a function. There's a lot of cruft in the current version, and it's pretty far from perfect, but it's usable. Currently only capable of comparing functions. Currently ignores metadata. Currently ignores most attributes of functions and instructions. Patches welcome. llvm-svn: 109739
-
Chris Lattner authored
struct a { struct c { double x; int y; } x[1]; }; void foo(struct a A) { } into: define void @foo(double %A.coerce0, i32 %A.coerce1) nounwind { entry: %A = alloca %struct.a, align 8 ; <%struct.a*> [#uses=1] %0 = bitcast %struct.a* %A to %struct.c* ; <%struct.c*> [#uses=2] %1 = getelementptr %struct.c* %0, i32 0, i32 0 ; <double*> [#uses=1] store double %A.coerce0, double* %1 %2 = getelementptr %struct.c* %0, i32 0, i32 1 ; <i32*> [#uses=1] store i32 %A.coerce1, i32* %2 instead of: define void @foo(double %A.coerce0, i64 %A.coerce1) nounwind { entry: %A = alloca %struct.a, align 8 ; <%struct.a*> [#uses=1] %0 = bitcast %struct.a* %A to %0* ; <%0*> [#uses=2] %1 = getelementptr %0* %0, i32 0, i32 0 ; <double*> [#uses=1] store double %A.coerce0, double* %1 %2 = getelementptr %0* %0, i32 0, i32 1 ; <i64*> [#uses=1] store i64 %A.coerce1, i64* %2 I only do this now because I never want to look at this code again :) llvm-svn: 109738
-
Chris Lattner authored
small integer + padding as that small integer. On code like: struct c { double x; int y; }; void bar(struct c C) { } This means that we compile to: define void @bar(double %C.coerce0, i32 %C.coerce1) nounwind { entry: %C = alloca %struct.c, align 8 ; <%struct.c*> [#uses=2] %0 = getelementptr %struct.c* %C, i32 0, i32 0 ; <double*> [#uses=1] store double %C.coerce0, double* %0 %1 = getelementptr %struct.c* %C, i32 0, i32 1 ; <i32*> [#uses=1] store i32 %C.coerce1, i32* %1 instead of: define void @bar(double %C.coerce0, i64 %C.coerce1) nounwind { entry: %C = alloca %struct.c, align 8 ; <%struct.c*> [#uses=3] %0 = bitcast %struct.c* %C to %0* ; <%0*> [#uses=2] %1 = getelementptr %0* %0, i32 0, i32 0 ; <double*> [#uses=1] store double %C.coerce0, double* %1 %2 = getelementptr %0* %0, i32 0, i32 1 ; <i64*> [#uses=1] store i64 %C.coerce1, i64* %2 which gives SRoA heartburn. This implements rdar://5711709, a nice low number :) llvm-svn: 109737
-