similar to: [LLVMdev] Implementing the hotpatch attribute for X86

Displaying 20 results from an estimated 1200 matches similar to: "[LLVMdev] Implementing the hotpatch attribute for X86"

2010 Oct 26
0
[LLVMdev] Implementing the hotpatch attribute for X86
On Tue, Oct 26, 2010 at 7:02 PM, Charles Davis <cdavis at mymail.mines.edu> wrote: > Hi, > > According to > http://blogs.msdn.com/b/freik/archive/2006/03/07/x64-hotpatchability.aspx, > 'hotpatchable' functions on x86 (and by extension, x86-64) are preceded > by six bytes of padding and start with a two byte instruction. The > problem is that, still being
2010 Oct 27
1
[LLVMdev] Implementing the hotpatch attribute for X86
> I don't know how GCC handles this case. They may do the padding in the > compiler. You are going to have to look at exactly what GCC does and > whatever hotpatch loader Wine uses to figure out what to do, but it > will most likely be incompatible with the Windows implementation. Why? I don't see how this might be incompatible with what MS linker does; in any case the end
2010 Oct 26
2
[LLVMdev] Implementing the hotpatch attribute for X86
On 10/26/10 5:24 PM, Michael Spencer wrote: > The linker adds the padding. Also, the first instruction just has to > be two bytes or longer. Not exactly two bytes. How then does the linker know to add the padding? I assume there's a PE-COFF attribute that will do that, but what about other file formats, like ELF or Mach-O? Bear in mind that I'm doing this for the Wine project, so
2010 Oct 26
0
[LLVMdev] Implementing the hotpatch attribute for X86
On Tue, Oct 26, 2010 at 7:27 PM, Charles Davis <cdavis at mymail.mines.edu> wrote: > On 10/26/10 5:24 PM, Michael Spencer wrote: >> The linker adds the padding. Also, the first instruction just has to >> be two bytes or longer. Not exactly two bytes. > How then does the linker know to add the padding? I assume there's a > PE-COFF attribute that will do that, Nope,
2016 Apr 06
7
RFC: New function attribute "patchable-prologue"="<kind>"
[Proposed langref entry] The "patchable-prologue" attribute on a function is a general mechanism to control the form of a function's prologue in ways that make it easy to patch at runtime. Currently only one value is supported: # "hotpatch-compact" If a function is marked with "patchable-prologue"="hotpatch-compact" then: 1. The first instruction
2010 Feb 12
0
[LLVMdev] Problems with custom calling convention on Mac OS X
David Terei wrote: > Hi all, > > I'm working on using LLVM as a back-end for the Haskell GHC compiler. As > part of that work I have modified LLVM to include a new custom calling > convention for performance reasons as outlined previously in a > conversation on this mailing list: > > http://nondot.org/sabre/LLVMNotes/GlobalRegisterVariables.txt > > This
2017 Oct 23
3
maximum value for alignstack function attribute?
I have this test case in my frontend, which is triggering an assert in llvm master branch: fn fnWithAlignedStack() -> i32 { @setAlignStack(1024); return 1234; } It sets alignstack=1024 in the function attributes (see http://llvm.org/docs/LangRef.html#function-attributes). It's tripping an assert: llvm/lib/IR/Attributes.cpp:134: static llvm::Attribute
2016 Mar 15
2
RFC: New IR attribute incoming-stack-align
I'm open to other suggestions. The problem is that these functions service an incoming abi stack alignment that differs from the host's abi alignment. An alternative would be to have the 'alignstack' IR attribute itself reduce the incoming stack alignment assumption. i.e. if it's specified then it's fair to assume that the incoming stack does not have the correct
2016 Mar 14
2
RFC: New IR attribute incoming-stack-align
Hi, I'm trying to fix an issue with clang's __force_align_arg_pointer__ attribute. The problem is described here: https://llvm.org/bugs/show_bug.cgi?id=26662 The problem is affecting Wine (https://www.winehq.org/) where we have a function that is an entry-point for the x86 Win32 abi. That function may then call functions in the host's (linux, OS/X, ...) abi. The issue is that the
2011 May 17
1
[LLVMdev] inline asm
Are there any examples for the inline assembler or more complete docs? Questions: * What are the syntax and semantics of constraints? * If I load up specific registers in the inline assembly, will llvm make sure that those registers are unassigned or should I save the registers and restore them? i.e. does llvm try and understand what is going on in the inline assembly, or is it a black box to
2010 Feb 12
3
[LLVMdev] Problems with custom calling convention on Mac OS X
Hi all, I'm working on using LLVM as a back-end for the Haskell GHC compiler. As part of that work I have modified LLVM to include a new custom calling convention for performance reasons as outlined previously in a conversation on this mailing list: http://nondot.org/sabre/LLVMNotes/GlobalRegisterVariables.txt This custom calling convention on x86-32 needs to handle just 4 parameters,
2017 Nov 05
2
calling va_arg functions on win32 seems to require explicit stack alignment?
target datalayout = "e-m:x-p:32:32-i64:64-f80:32-n8:16:32-a:0:32-S32" target triple = "i686-pc-windows-msvc" declare void @llvm.va_start(i8**) declare void @llvm.va_end(i8**) define i64 @foo(...) { %va = alloca i8*, i32 16 ; 4 words should be enough? call void @llvm.va_start(i8** %va) %x = va_arg i8** %va, i64 call void @llvm.va_end(i8** %va) ret i64 %x }
2012 Nov 20
0
[LLVMdev] [RFC] Passing Options to Different Parts of the Compiler Using Attributes
On Nov 13, 2012, at 12:20 AM, Bill Wendling wrote: > IR Changes > ---------- > > The attributes will be specified within the IR. This allows us to generate code > that the user wants. This also has the advantage that it will no longer be > necessary to specify all of the command line options when compiling the bit code > (via 'llc' or 'clang'). E.g.,
2012 Nov 26
3
[LLVMdev] [RFC] Passing Options to Different Parts of the Compiler Using Attributes
On Nov 20, 2012, at 11:03 AM, Meador Inge <meadori at codesourcery.com> wrote: > On Nov 13, 2012, at 12:20 AM, Bill Wendling wrote: > >> IR Changes >> ---------- >> >> The attributes will be specified within the IR. This allows us to generate code >> that the user wants. This also has the advantage that it will no longer be >> necessary to specify
2012 Nov 21
1
[LLVMdev] [RFC] Passing Options to Different Parts of the Compiler Using Attributes
On Tue, Nov 20, 2012 at 11:03 AM, Meador Inge <meadori at codesourcery.com> wrote: > > On Nov 13, 2012, at 12:20 AM, Bill Wendling wrote: > >> IR Changes >> ---------- >> >> The attributes will be specified within the IR. This allows us to generate code >> that the user wants. This also has the advantage that it will no longer be >> necessary to
2016 Apr 14
2
RFC: New function attribute "patchable-prologue"="<kind>"
I think most function redirection patching schemes are going to be mutually incompatible, so I'm not sure it makes sense to make this attribute a comma-separated list. I think Eric's and Dean's use case may be better addressed by a separate attribute. My recollection is that they want to add nop slides to the prologue and epilogue that can be hotpatched to enable and disable
2011 Jan 01
3
[LLVMdev] misaligned_stack_error caused by LLVM code on MacOS: how to fix?
llvm-generated code that runs fine on linux/i386 causes EXC_BAD_ACCESS with misaligned_stack_error_ on MacOS/i386. I read online that each function should have stack aligned by 16 on MacOS/i386 and such code should be used: Fn->addAttribute(~0U, llvm::Attribute::constructStackAlignmentFromInt(16)); But when I run clang on some C++ code I don't see alignstack instructions generated at
2011 Aug 12
1
[LLVMdev] Using sret AND thiscall calling convention
Hi all, I am trying to generate LLVM IR that calls an external C++ function returning a structure by copy: vec3 vec3::Cross(const vec3& iV) const; Here is the LLVM IR that I am generating for win32 ABI, which says that the first parameter should be a pointer to the return value: %vec3 = type <{ float, float, float }> define void @CPP_Return_Struct(%vec3* %v1, %vec3* %v2) inlinehint
2012 Dec 05
0
[LLVMdev] [RFC] Passing Options to Different Parts of the Compiler Using Attributes
On Nov 26, 2012, at 3:20 PM, Bill Wendling wrote: >> 4. Do we really want the attribute references limited to a number? Code will be more readable >> if you can use actual names that indicate the intent. For example: >> >> attrgroup #compile_options = { … } >> void @foo attrgroup(#compile_options) >> > The problem with this is it
2011 Aug 12
1
[LLVMdev] Using sret AND thiscall calling convention
On Fri, Aug 12, 2011 at 1:11 AM, Damien Gleizes <gleizesd at gmail.com> wrote: > > Hi all, > > I am trying to generate LLVM IR that calls an external C++ function > returning a structure by copy: > vec3 vec3::Cross(const vec3& iV) const; > > Here is the LLVM IR that I am generating for win32 ABI, which says that the > first parameter should be a pointer to the