Displaying 3 results from an estimated 3 matches for "my_hook_fcn".
2019 Feb 12
2
[RFC] Potential extension to asm statement functionality
...d:
#include <stdint.h>
uint32_t f(uint32_t x);
uint32_t g(uint32_t x);
uint32_t f(uint32_t x) {
uint32_t returnValue = g(x);
if (returnValue > 0U) {
returnValue = 0x40000000;
}
else {
returnValue = 0x80000000;
}
__asm __volatile__ ("\t.global my_hook_fcn\nmy_hook_fcn:\n");
return returnValue;
}
uint32_t g(uint32_t x) {
return x >> 1U;
}
If the above definition of f() is compiled with optimization at level 1 or higher, the TailDuplication optimization pass will duplicate and move the asm statement and return up into the if block...
2019 Feb 12
3
[RFC] Potential extension to asm statement functionality
...d:
#include <stdint.h>
uint32_t f(uint32_t x);
uint32_t g(uint32_t x);
uint32_t f(uint32_t x) {
uint32_t returnValue = g(x);
if (returnValue > 0U) {
returnValue = 0x40000000;
}
else {
returnValue = 0x80000000;
}
__asm __volatile__ ("\t.global my_hook_fcn\nmy_hook_fcn:\n");
return returnValue;
}
uint32_t g(uint32_t x) {
return x >> 1U;
}
If the above definition of f() is compiled with optimization at level 1 or higher, the TailDuplication optimization pass will duplicate and move the asm statement and return up into the if block...
2019 Feb 14
3
[RFC] Potential extension to asm statement functionality
...o: 'paul.robinson at sony.com'; efriedma at quicinc.com
Cc: llvm-dev at lists.llvm.org
Subject: RE: [llvm-dev] [RFC] Potential extension to asm statement functionality
The proposed "lbl" constraint below:
__asm __volatile__ ("\t.global\t%0\n%0:\n" : "lbl" (my_hook_fcn));
is not quite a "No Touchie!" constraint, but it does allow the user to set the isNotDuplicable flag on the INLINEASM that comes out of the asm statement in order to circumvent optimizations like Tail Duplication. But setting the isNotDuplicable flag is not really enough. If the funct...