similar to: [LLVMdev] Using LLVM with clang for a homebrew kernel

Displaying 20 results from an estimated 30000 matches similar to: "[LLVMdev] Using LLVM with clang for a homebrew kernel"

2011 Feb 18
2
[LLVMdev] Structure Types and ABI sizes
Hi! I followed the discussion on structure types with the example struct I { int a; char b; }; struct J : I { char c; }; Dave said that this translates to %I = type { i32, i8, i16 } %J = type { %I, i8, i16 } because the frontend has to communicate the ABI to llvm since llvm is language agnostic. What I really wonder is why it isn't %I = type { i32, i8 } %J = type { %I, i16, i8
2011 Dec 30
3
[LLVMdev] InstCombine "pessimizes" trunc i8 to i1?
Am 29.12.2011 19:52, schrieb Reid Kleckner: > I think Chris is saying that the and is necessary because with your i1 > trunc you're ignoring all of the high bits. The and implements that. > If you don't want this behavior, don't generate the trunc in the > first place and just compare the full width to zero. But if a backend sees trunc from i8 to i1 it should know
2011 Feb 24
2
[LLVMdev] Structure Types and ABI sizes
> If %I is not a "POD for the purposes of layout" type, that it's tail > padding MUST be overlapped when inherited from. In this case, we > end up creating two types for %I, %I and %I' and use %I' as the > type when it is inherited from. > But this is the question why two types in this case. if %I = type { i32, i8 }; then %I has 8 bytes if used directly
2011 Feb 22
3
[LLVMdev] Structure Types and ABI sizes
>> What I really wonder is why it isn't >> >> %I = type { i32, i8 } >> %J = type { %I, i16, i8 } >> >> because llvm at least knows alignment rules by >> >> target datalayout = "e-p:64:64:64-i1:8:8-i8:8:8-i16:16:16... >> >> Therefore llvm has no other choice than assigning %I a size of 8 >> since an array may consist of %I
2010 Mar 03
5
[LLVMdev] folding x * 0 = 0
Hi! > sin/cos etc should already be handled by lib/Analysis/ConstantFolding.cpp. > Thanks for the hint and it works! Now I have a new Problem: I have this function: float foo(float a, float b) { float x = a * b * 0.0f; return cos(0.5) * sin(0.5) * x; }; after compiling it with clang (cpp mode) and renaming _ZSt3sinf to sin and _ZSt3cosf to cos I get the following: define
2010 Nov 25
2
[LLVMdev] request for windows unicode support
Hi! Of course nobody wants to implement unicode support for windows because windows should support an utf8-locale and windows is obsolete anyway ;-) But there is a simple solution: use boost::filesystem::path everywhere you use file names and paths, for example in clang::FileManager::getFile. With version 3 opening a file is easy: std::fstream file(path.c_str()). Internally
2011 Feb 24
2
[LLVMdev] Structure Types and ABI sizes
> If you're saying that: > > >> %I = type { i32, i8 }; >> > has size 5, yes, you're missing the alignment. > Ah, now I see. But I didn't say that %I = type { i32, i8 }; has 5 bytes (because it has 8) but I thought that it has 5 bytes when being a member of %J, i.e. %J = type { %I, i8 } In this case %I also has 8 bytes right? I was thinking
2011 Mar 04
2
[LLVMdev] Structure Types and ABI sizes
>> %I = type { i32, i8 }; // 5 bytes >> %I' = type { %I, tailpad}; // 8 bytes >> %J = type { %I, i8 } // 6 bytes >> > That would break C code (and whatever else relies on alignment). > why would it break C code? of course a C frontend should generate only tailpadded types. > I don't see a way of specifying two structures, but I like the idea of
2010 Nov 26
3
[LLVMdev] request for windows unicode support
On 25.11.2010 23:56, Michael Spencer wrote: > On Nov 25, 2010, at 5:01 PM, Jochen Wilhelmy <j.wilhelmy at arcor.de > <mailto:j.wilhelmy at arcor.de>> wrote: > >> Hi! >> >> Of course nobody wants to implement unicode support for windows >> because windows should support an utf8-locale and windows is obsolete >> anyway ;-) >> >> But
2010 Nov 25
0
[LLVMdev] request for windows unicode support
On Nov 25, 2010, at 5:01 PM, Jochen Wilhelmy <j.wilhelmy at arcor.de> wrote: > Hi! > > Of course nobody wants to implement unicode support for windows > because windows should support an utf8-locale and windows is obsolete > anyway ;-) > > But there is a simple solution: use boost::filesystem::path everywhere you > use file names and paths, for example in
2010 Oct 18
3
[LLVMdev] building only libs with cmake
Now I have -DLLVM_INCLUDE_EXAMPLES:BOOL=OFF but Kaleidoscope is still there and selected for build (-G "Visual Studio 9 2008") -Jochen
2011 Feb 18
2
[LLVMdev] Please add .o writer example to next release
Hi! Is it possible that you add an example how to write a .o with llvm? Just like examples/ModuleMaker but instead of printing to stdout writing a .o file as starting point for the new MC functionality. -Jochen
2010 Jun 24
3
[LLVMdev] DataTypes.h for Visual C
Hi! In DataTypes.h (generated from DataTypes.cmake) there is an extra code path for Visual C. This can produce macro redefinitions for INT8_MAX, INT8_MIN etc. since other headers may also define them. Therefore please protect the macros like INT8_C etc. Also it would be nice if the auto-generated HAVE_STDINT_H and HAVE_INTTYPES_H would be used also for Visual C since it is possible to add them
2010 Mar 03
0
[LLVMdev] folding x * 0 = 0
On 3 March 2010 11:56, Jochen Wilhelmy <j.wilhelmy at arcor.de> wrote: > > the sin and cos calls are folded, but not the mul by zero. > Is x*0 => 0 true if isnan(x)? And cos(x)*sin(x) makes me desperately want to fold it to sin(2*x)/2, but I suppose that's not allowed either.
2011 Dec 28
3
[LLVMdev] InstCombine "pessimizes" trunc i8 to i1?
>> Hi! >> >> before InstCombine (llvm::createInstructionCombiningPass()) I have >> a trunc from i8 to i1 and then a select: >> >> %45 = load i8* @myGlobal, align 1 >> %tobool = trunc i8 %45 to i1 >> %cond = select i1 %tobool, float 1.000000e+00, float -1.000000e+00 >> >> after instCombine I have: >> >> %29 = load i8*
2011 Mar 04
1
[LLVMdev] Structure Types and ABI sizes
>> why would it break C code? of course a C frontend should generate only >> tailpadded types. >> > It's not about the size, but the offset. If you had a char field in > the inherited class: > > %I' = type { %I, i8, tailpad}; > > The offset of that i8 has to be 8, not 5. If all structures are > packed, that would be 5, which is correct for
2018 May 22
2
Rewriting calls to varargs functions
Hello, A new patch: https://reviews.llvm.org/D47159 proposes transformations like: printf("Hello, %s %d", "world", 123) - > printf("Hello world 123") As Eli noted: "I'm not sure we can rewrite calls to varargs functions safely in general given the current state of the C ABI rules in LLVM. Sometimes clang does weird things to conform with the ABI
2018 May 22
4
Rewriting calls to varargs functions
Thanks. Yes, to substitute only some of the arguments. Formatting used by printf depends on the locale but only for double, float types I think - yes, I would not place double/float constants into the format string. Why? To reduce number of constants (some of them could be merged into the format string) and number of args when calling printf/fprintf/sprintf, etc.. 2018-05-22 16:22 GMT+02:00 Hal
2011 May 25
1
[LLVMdev] ms vc 10 warnings
Hi! when compiling projects using llvm 2.9 and ms vc 10 I get these warnings: 1>e:\Jochen\Lib\lib\include\llvm/Use.h(218): warning C4624: 'llvm::AugmentedUse' : destructor could not be generated because a base class destructor is inaccessible 1>C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\stdint.h(72): warning C4005: 'INT8_MIN' : macro redefinition
2010 Jul 20
2
[LLVMdev] [cfe-dev] conditional operator
Hello Jochen- Your expectation is incorrect, I'm afraid. Typically this would be expanded to something like this: … %cmp = … br i1 %cmp, label %ternary.true, label %ternary.false ternary.true: %truevalue = … br label %ternary.end ternary.false: %falsevalue = … br label %ternary.end ternary.end: %value = phi %type [%truevalue, %ternary.true], [%falsevalue,