similar to: Cast between struct

Displaying 20 results from an estimated 2000 matches similar to: "Cast between struct"

2020 May 07
2
Cast between struct
> On May 6, 2020, at 21:53, Krzysztof Parzyszek <kparzysz at quicinc.com> wrote: > > You can > 1. extract individual elements of {i8*, i64}, > 2. bitcast the first to some_struct*, > 3. insert them into a new struct of type {some_struct*, i64}. Thanks for the help. I’m thinking the same way. Now I’m stuck with how to create a struct; I know how to create a
2019 Mar 25
3
How to use bugpoint for backend native code generation?
Hello, I’m writing machine function passes for programs running with ARMv7-M ISA. My pass adds some instructions to the original code, and now I got fatal error: error in backend: out of range pc-relative fixup value when llvm generates native code after running the transformation pass. I think it’s because my transformation pass increases the size of the original code and thus some branch
2020 Jan 07
3
Best way of implement a fat pointer for C
Dear All, I’m working on a project that extends C. I’m adding a new type of pointer that is a fat pointer. It has some metadata about the pointed object besides the starting address of the object. Currently I implemented this pointer as an llvm:StructType. In llvm::Type generation function llvm::Type *CodeGenTypes::ConvertType(QualType T) in the case for clang::Type::Pointer, instead of creating
2019 Apr 14
2
[A bug?] Failed to use BuildMI to add R7 - R12 registers for tADDi8 and tPUSH of ARM
Hi Craig, Thanks for the information. Can you point to the source that specifies tGPR to be R0 - R7? I tried to search in ARMInstrThumb.td but couldn’t find it. Thanks, - Jie On Apr 14, 2019, at 15:28, Craig Topper <craig.topper at gmail.com<mailto:craig.topper at gmail.com>> wrote: I believe there is probably a separate instruction in LLVM for thumb2 add. Probably starting with t2
2019 Apr 14
2
[A bug?] Failed to use BuildMI to add R7 - R12 registers for tADDi8 and tPUSH of ARM
Sorry for not being specific enough. ARMv7-M includes Thumb and Thumb2. It has 12 regular registers (R0 - R12), and R8 - R12 are used. I can generate mov instruction that from/ R8-R12 to/from R0-R6. From this ARM page http://infocenter.arm.com/help/index.jsp?topic=/com.arm.doc.dui0068b/ch03s03s01.html R9 - R12 have their conventional usage, but I don’t if this is the reason we cannot use them
2019 Oct 20
3
How to configure cmake to not rebuild .inc (tablegen) files?
Dear all, I’m developing Clang&LLVM on MacOS Catalina 10.15. Now every time I "make clang", the building systems rebuilds all the .inc files generated by cmake, which essentially rebuilds all the tablegen files in llvm, although I did not change any of the tablegen files. The building is unnecessary and slow, especially when it builds the X86GenSubtargetInfo.inc. Is there a way to
2015 Nov 24
3
Functions have two types, one can be mutated but not the other
Function has its own FunctionType* member as well as a Type* member that it inherits from GlobalValue. The latter can be mutated but not the former, leading to potential strange inconsistencies. While I realize using mutateType is probably going to trigger a bunch of "you're doing it wrong" replies, it seems like mutateType, as a necessary evil, should be virtual and do the right
2017 Mar 24
2
Problem about API difference between LLVM3.5 and LLVM3.9
Hi all, Recently I have implemented a transformation pass based on LLVM3.5 and its function is to duplicate the function's argument list in a bytecode file and replace all use of original function with modified function. In LLVM3.5, the pass can work properly. However, when I tried to transplant the pass to LLVM3.9, the error "Argument value does not match function argument type!"
2019 Apr 14
3
[A bug?] Failed to use BuildMI to add R7 - R12 registers for tADDi8 and tPUSH of ARM
Hi all, I’m trying to insert some add/sub and push/pop instructions in a MachineFunction pass for ARMv7-M. However, I encountered something weird. For an add, when I use BuildMI(….., TII->get(ARM::tADDi8), reg).addReg(reg).addReg(reg).addImm(imm). if reg is R0 - R7, everything is fine: I would get something like adds r1, 4 But if I use R8 - R12 as the reg in the BuildMI, I wouldn’t get
2012 Feb 27
2
[LLVMdev] mapping types from a bitcode module
Hi Clemens - thanks for your response. Clemens Hammacher wrote: > Hi Michael, > > since noone of the experts answered, let me share our experiences. We > recently had exactly the same problem, I posted on this list on January > 31st. > I didn't follow Duncans advice to "just use the linker", since for > several reasons we wanted to have unique struct types
2012 Feb 27
0
[LLVMdev] mapping types from a bitcode module
Hi Michael, since noone of the experts answered, let me share our experiences. We recently had exactly the same problem, I posted on this list on January 31st. I didn't follow Duncans advice to "just use the linker", since for several reasons we wanted to have unique struct types even in the separate modules. > 1) duplicate the LinkModule internal code and copy the module we
2012 Feb 28
0
[LLVMdev] mapping types from a bitcode module
On 2/27/12 8:27 PM, Michael Muller wrote: >>> 3) destructively convert all of the types in the imported module to our >>> existing types. >> >> That's what we actually implemented, following the idea I described in >> the mentioned post. We don't identify identical struct types by their >> name, since even in the new type system, names don't
2012 Mar 06
2
[LLVMdev] Work with CallSites
Hi. I have a test program: class A { int A; public: virtual void test ( int x ) = 0; }; class B : public A { int B; public: void test ( int x ) {}; }; int main() { A *a = new B(); a->test(1); } We have call site CS: "a->test(1);". CS.getCalledFunction() - return NULL, so we can say that this call site is virtual. My optimization determines, that in this call site
2012 Feb 02
2
[LLVMdev] Disjoint types after reading several modules
Hi Chris, thanks for your answer! On 2/2/12 1:15 AM, Chris Lattner wrote: > The linker has to solve the exact same problem (read multiple .bc files and unify types across them). This is the impetus behind TypeMapTy in lib/Linker/LinkModules.cpp. You'll probably need to do something like that. I already looked into that. The linker is using the GlobalValues of both modules to identify
2018 Sep 03
2
Replacing a function from one module into another one
Thank you Ahmad, I figured out that, although the type of both p(oInst) and p(nInst) were the same, I had to: for (unsigned int i = 0; i < callOInst->getNumArgOperands(); i++) { callOInst->getArgOperand(i)->mutateType(callNInst->getArgOperand(i)->getType()); } that solves the issue at the calling instruction in the main function, but now I see that *linkModules* does not work
2018 Apr 22
2
Difference between "byval" and actually passing by value?
There appears to be a difference between passing by value:     call void @foo(%some_struct %v) And using the `byval` attribute on a pointer:     call void @foo(%some_struct* byval %v) They are not compatible with each other yet logically do the same thing.  The second form is the one that appears to work with the ABI on linux, and the first one not. What is the reason for the difference? --
2020 Sep 14
2
[PATCH v2] i2c: virtio: add a virtio i2c frontend driver
On Mon, Sep 14, 2020 at 05:48:07PM +0300, Dan Carpenter wrote: > Hi Jie, > > url: https://github.com/0day-ci/linux/commits/Jie-Deng/i2c-virtio-add-a-virtio-i2c-frontend-driver/20200911-115013 > base: https://git.kernel.org/pub/scm/linux/kernel/git/wsa/linux.git i2c/for-next > config: parisc-randconfig-m031-20200913 (attached as .config) > compiler: hppa-linux-gcc (GCC)
2020 Sep 14
2
[PATCH v2] i2c: virtio: add a virtio i2c frontend driver
On Mon, Sep 14, 2020 at 05:48:07PM +0300, Dan Carpenter wrote: > Hi Jie, > > url: https://github.com/0day-ci/linux/commits/Jie-Deng/i2c-virtio-add-a-virtio-i2c-frontend-driver/20200911-115013 > base: https://git.kernel.org/pub/scm/linux/kernel/git/wsa/linux.git i2c/for-next > config: parisc-randconfig-m031-20200913 (attached as .config) > compiler: hppa-linux-gcc (GCC)
2020 Sep 11
6
[PATCH v2] i2c: virtio: add a virtio i2c frontend driver
Add an I2C bus driver for virtio para-virtualization. The controller can be emulated by the backend driver in any device model software by following the virtio protocol. This driver communicates with the backend driver through a virtio I2C message structure which includes following parts: - Header: i2c_msg addr, flags, len. - Data buffer: the pointer to the I2C msg data. - Status: the
2020 Sep 11
6
[PATCH v2] i2c: virtio: add a virtio i2c frontend driver
Add an I2C bus driver for virtio para-virtualization. The controller can be emulated by the backend driver in any device model software by following the virtio protocol. This driver communicates with the backend driver through a virtio I2C message structure which includes following parts: - Header: i2c_msg addr, flags, len. - Data buffer: the pointer to the I2C msg data. - Status: the