In 32bit mode, attaching TBAA metadata to the store following the call to inline assembler results in describing the wrong type by making a fake lvalue(i.e., whatever the inline assembler happens to leave in EAX:EDX.) Even if inline assembler somehow describes the correct type, setting TBAA information on return type of call to inline assembler is likely not correct, since TBAA rules need not apply to inline assembler.
Details
Diff Detail
Event Timeline
When I try out the example on llvm-13, I get a 'omnipotent char' tbaa description. That should be ok in general. When I replace the 'float _Complex' with 'double', I do get the 'double' tbaa. That might be a better example for the testcase ?
clang/lib/CodeGen/CodeGenFunction.h | ||
---|---|---|
2511 | Looking at how a 'null tbaa'is produced in other places (grep for 'TBAAAccessInfo()', I would just do a 'TBAAAccessInfo()' here and omit the new ''returnNullTBAA' method. | |
clang/test/CodeGen/avoidTBAAonASMstore.cpp | ||
7 | Will this also work in release mode ? Maybe abstract away the %2 and %1. |
We're almost there. But the testcase is now not testing what it should be testing. Also the unused CHECK: must be adapted.
https://reviews.llvm.org/harbormaster/unit/view/1536685/
Test failure seems unrelated to this patch. Unable to reproduce locally.
clang/test/CodeGen/avoidTBAAonASMstore.cpp | ||
---|---|---|
4 | Shouldn't this be STORE-LINE-LABEL: ... ? |
Hi, the new test is failing on our arm/aarch64 quick bots. These build only the respective backend so you might need to add a requires x86 target.
https://lab.llvm.org/buildbot/#/builders/171/builds/7189
/home/tcwg-buildbot/worker/clang-armv7-quick/llvm/clang/test/CodeGen/avoidTBAAonASMstore.cpp:5:3: error: MS-style inline assembly is not available: No available targets are compatible with triple "i386-unknown-linux-gnu" __asm { fnstcw word ptr[ControlWord]} ^ 1 error generated.
Looking at how a 'null tbaa'is produced in other places (grep for 'TBAAAccessInfo()', I would just do a 'TBAAAccessInfo()' here and omit the new ''returnNullTBAA' method.