[clang] [TBAA] Emit "omnipotent char" for intrinsics with type cast (PR #107793)
via cfe-commits
cfe-commits at lists.llvm.org
Tue Sep 10 18:22:46 PDT 2024
huhu233 wrote:
> I'll need to look to see if the TBAA metadata we're adding matches what we initially envisaged but my gut feeling matches @arsenm.
>
> I'm assuming the original code emitted an error, something along the lines of "no version of svst1 available for long long*", which you've "fixed" by introducing a cast that breaks strict aliasing rules.
>
> I recall warnings relating to strict aliasing violations being hit and miss? but perhaps we can do better.
Hi, @paulwalker-arm, ACLE allows users to do instruction-level development, but mixing intrinsic and regular C code may break some of the rules set by the compiler. For example, in this case, the explict cast causes `res2` to have different tbaa in different contexts. The compiler needs to detect these behaviors and provide some hints, or work around them to avoid a series of wrong optimizations that follow.
https://github.com/llvm/llvm-project/pull/107793
More information about the cfe-commits
mailing list