diff options
author | Florian Hahn <flo@fhahn.com> | 2020-11-19 09:31:54 +0000 |
---|---|---|
committer | Florian Hahn <flo@fhahn.com> | 2020-11-19 09:31:54 +0000 |
commit | 1983acce7c4da01d8fb33b3b3465619f973edd49 (patch) | |
tree | 70d99c19abc313328faa4fd535d4efa2674edb90 /llvm/lib/Object/XCOFFObjectFile.cpp | |
parent | 515105f46b7e0037fe49a6fa8e469823c3f8433e (diff) | |
download | llvm-1983acce7c4da01d8fb33b3b3465619f973edd49.zip llvm-1983acce7c4da01d8fb33b3b3465619f973edd49.tar.gz llvm-1983acce7c4da01d8fb33b3b3465619f973edd49.tar.bz2 |
[SelDAGBuilder] Do not require simple VTs for constraints.
In some cases, the values passed to `asm sideeffect` calls cannot be
mapped directly to simple MVTs. Currently, we crash in the backend if
that happens. An example can be found in the @test_vector_too_large_r_m
test case, where we pass <9 x float> vectors. In practice, this can
happen in cases like the simple C example below.
using vec = float __attribute__((ext_vector_type(9)));
void f1 (vec m) {
asm volatile("" : "+r,m"(m) : : "memory");
}
One case that use "+r,m" constraints for arbitrary data types in
practice is google-benchmark's DoNotOptimize.
This patch updates visitInlineAsm so that it use MVT::Other for
constraints with complex VTs. It looks like the rest of the backend
correctly deals with that and properly legalizes the type.
And we still report an error if there are no registers to satisfy the
constraint.
Reviewed By: arsenm
Differential Revision: https://reviews.llvm.org/D91710
Diffstat (limited to 'llvm/lib/Object/XCOFFObjectFile.cpp')
0 files changed, 0 insertions, 0 deletions