Displaying 2 results from an estimated 2 matches for "acnpxy".
2020 Jul 28
2
_mm_lfence in both pathes of an if/else are hoisted by SimplfyCFG potentially breaking use as a speculation barrier
...6intrin.h>
void bar();
void baz();
void foo(int c) {
if (c) {
_mm_lfence();
bar();
} else {
_mm_lfence();
baz();
}
}
Alternatively, I also tried replacing the intrinsics with inline assembly.
SimplifyCFG still merged those. But gcc did not.
https://godbolt.org/z/acnPxY
void bar();
void baz();
void foo(int c) {
if (c) {
__asm__ __volatile ("lfence");
bar();
} else {
__asm__ __volatile ("lfence");
baz();
}
}
I believe the [[clang::nomerge]] attribute was recently extended to inline
assembly which can be used to p...
2020 Aug 09
2
_mm_lfence in both pathes of an if/else are hoisted by SimplfyCFG potentially breaking use as a speculation barrier
...> > bar();
> > } else {
> > _mm_lfence();
> > baz();
> > }
> > }
> >
> >
> > Alternatively, I also tried replacing the intrinsics with inline assembly. SimplifyCFG still merged those. But gcc did not. https://godbolt.org/z/acnPxY
> >
> > void bar();
> > void baz();
> >
> > void foo(int c) {
> > if (c) {
> > __asm__ __volatile ("lfence");
> > bar();
> > } else {
> > __asm__ __volatile ("lfence");
> > baz();
>...