| Commit message (Collapse) | Author | Age | Files | Lines |
|
|
|
| |
llvm-svn: 362410
|
|
|
|
|
|
|
|
|
|
|
| |
This reverts commit 954ec09aed4f2be04bb5f4e10dbb4ea8bd19ef9a.
Reverting due to test failures as requested by Jennifer Yu.
Conflicts:
clang/test/CodeGen/asm-goto.c
llvm-svn: 362106
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Syntax:
asm [volatile] goto ( AssemblerTemplate
:
: InputOperands
: Clobbers
: GotoLabels)
https://gcc.gnu.org/onlinedocs/gcc/Extended-Asm.html
New llvm IR is "callbr" for inline asm goto instead "call" for inline asm
For:
asm goto("testl %0, %0; jne %l1;" :: "r"(cond)::label_true, loop);
IR:
callbr void asm sideeffect "testl $0, $0; jne ${1:l};", "r,X,X,~{dirflag},~{fpsr},~{flags}"(i32 %0, i8* blockaddress(@foo, %label_true), i8* blockaddress(@foo, %loop)) #1
to label %asm.fallthrough [label %label_true, label %loop], !srcloc !3
asm.fallthrough:
Compiler need to generate:
1> a dummy constarint 'X' for each label.
2> an unique fallthrough label for each asm goto stmt " asm.fallthrough%number".
Diagnostic
1> duplicate asm operand name are used in output, input and label.
2> goto out of scope.
llvm-svn: 362045
|
|
|
|
|
|
|
|
|
|
|
|
| |
statements.
If the assembler instruction is not generated and the delayed diagnostic
is emitted, we may end up with extra warning message for variables used
in the asm statement. Since the asm statement is not built, the
variables may be left non-referenced and it may produce a warning about
a use of the non-initialized variables.
llvm-svn: 354928
|
|
|
|
|
|
|
|
| |
Ignore ‘i’,’n’,’E’,’F’ as output constraints in inline assembly (gcc compatibility)
Differential Revision: https://reviews.llvm.org/D31383
llvm-svn: 306297
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
According to extended asm syntax, a case where the clobber list includes a variable from the inputs or outputs should be an error - conflict.
for example:
const long double a = 0.0;
int main()
{
char b;
double t1 = a;
__asm__ ("fucompp": "=a" (b) : "u" (t1), "t" (t1) : "cc", "st", "st(1)");
return 0;
}
This should conflict with the output - t1 which is st, and st which is st aswell.
The patch fixes it.
Commit on behald of Ziv Izhar.
Differential Revision: https://reviews.llvm.org/D15075
llvm-svn: 290539
|
|
|
|
|
|
|
|
|
| |
Defined the new AVX512 registers in clang inline asm.
Fixed a bug in the MC subtarget info creation during the parsing of MS asm statement - now it receives the actual CPU and target features information.
Differential Revision: http://reviews.llvm.org/D16757
llvm-svn: 259639
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Currently, when there is a global register variable in a program that
is bound to an invalid register, clang/llvm prints an error message that
is not very user-friendly.
This commit improves the diagnostic and moves the check that used to be
in the backend to Sema. In addition, it makes changes to error out if
the size of the register doesn't match the declared variable size.
e.g., volatile register int B asm ("rbp");
rdar://problem/23084219
Differential Revision: http://reviews.llvm.org/D13834
llvm-svn: 253405
|
|
|
|
|
|
|
| |
Several inputs may not refer to one output constraint in inline assembler
insertions, clang was failing on assertion on such test case.
llvm-svn: 248158
|
|
|
|
|
|
|
|
|
|
| |
in inline assembler.
Compiler crashed when vector elements / global register vars were used in inline assembler with "m" restriction. This patch fixes this.
Differential Revision: http://reviews.llvm.org/D10476
llvm-svn: 243870
|
|
|
|
|
|
|
|
|
|
|
|
| |
input / output with memory constraint.
One generally can't get address of a bit field, so the general solution is to
error on such cases. GCC does the same.
Patch by Andrey Bokhanko
Differential Revision: http://reviews.llvm.org/D10086
llvm-svn: 239153
|
|
|
|
| |
llvm-svn: 225942
|
|
|
|
|
|
|
| |
Clang would treat the digits in an "11m" input constraint separately as
if it was handling constraint 1 twice instead of constraint 11.
llvm-svn: 225606
|
|
|
|
|
|
|
|
|
| |
Input constraints like "0" and "[foo]" should be treated the same when
it comes to their corresponding output constraint.
This fixes PR21850.
llvm-svn: 225605
|
|
|
|
| |
llvm-svn: 225603
|
|
|
|
| |
llvm-svn: 225600
|
|
|
|
|
|
| |
Don't permit '+&m' to make it to CodeGen, it's invalid.
llvm-svn: 225586
|
|
|
|
|
|
| |
Verify that asm constraints have the same number of alternatives
llvm-svn: 224911
|
|
|
|
|
|
|
|
|
|
|
| |
Name might be empty again after we removed the '%' prefix
and Name[0] would assert.
Found on code like
register int foo asm("%" MACRO);
where MACRO was supposed to be defined in a header file that was not found.
llvm-svn: 215834
|
|
|
|
|
|
| |
<rdar://problem/17476689>
llvm-svn: 213428
|
|
|
|
|
|
|
|
|
|
| |
This patch adds support for pointer types in global named registers variables.
It'll be lowered as a pair of read/write_register and inttoptr/ptrtoint calls.
Also adds some early checks on types on SemaDecl to avoid the assert.
Tests changed accordingly. (PR19837)
llvm-svn: 210274
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
This patch implements global named registers in Clang, lowering to the just
created intrinsics in LLVM (@llvm.read/write_register). A new type of LValue
had to be created (Register), which just adds support to carry the metadata
node containing the name of the register. Two new methods to emit loads and
stores interoperate with another to emit the named metadata node.
No guarantees are being made and only non-allocatable global variable named
registers are being supported. Local named register support is unchanged.
llvm-svn: 209149
|
|
|
|
|
|
|
|
|
|
| |
An empty string for an ASM input constraint is invalid, and will crash
during clang CodeGen. Change TargetInfo::validateInputConstraint to
reject an empty string.
<rdar://problem/15552191>
llvm-svn: 197362
|
|
|
|
|
|
| |
Fixes PR15759.
llvm-svn: 179756
|
|
|
|
| |
llvm-svn: 178196
|
|
|
|
| |
llvm-svn: 178143
|
|
|
|
| |
llvm-svn: 178122
|
|
|
|
|
|
|
|
|
|
| |
pointer type.
If the ASM statement is dereferencing an incomplete pointer type, issue an error
instead of crashing.
<rdar://problem/12700799>
llvm-svn: 177915
|
|
|
|
|
|
|
|
| |
specifier is unsed in a declaration; as it may not make the symbol
local to linkage unit as intended. Suggest using "hidden" visibility
attribute instead. // rdar://7703982
llvm-svn: 162138
|
|
|
|
|
|
|
|
|
| |
and update the Sema testcase with a register that we won't hit for a while
I hope.
Fixes rdar://10510405
llvm-svn: 145671
|
|
|
|
|
|
|
|
| |
extra register.
Part of PR10299 and rdar://9740322
llvm-svn: 134657
|
|
|
|
|
|
| |
This fixes PR10223.
llvm-svn: 134183
|
|
|
|
|
|
| |
Fixes rdar://9281377
llvm-svn: 134016
|
|
|
|
| |
llvm-svn: 131170
|
|
|
|
| |
llvm-svn: 123236
|
|
|
|
| |
llvm-svn: 122670
|
|
|
|
|
|
| |
constraint it's invalid. Fixes PR3905.
llvm-svn: 118146
|
|
|
|
|
|
| |
constraint. Fixes PR3904.
llvm-svn: 118145
|
|
|
|
|
|
|
| |
which is should have done from the beginning. As usual, the most
fun with this sort of change is updating all the testcases.
llvm-svn: 113090
|
|
|
|
|
|
| |
"Fixes" rdar://problem/7574870
llvm-svn: 94458
|
|
|
|
|
|
|
|
|
| |
- This is designed to make it obvious that %clang_cc1 is a "test variable"
which is substituted. It is '%clang_cc1' instead of '%clang -cc1' because it
can be useful to redefine what gets run as 'clang -cc1' (for example, to set
a default target).
llvm-svn: 91446
|
|
|
|
|
|
| |
redundant with -triple.
llvm-svn: 72108
|
|
|
|
|
|
|
|
| |
number is not mentioned in the asm string, let it past sema.
Right now these are currently rejected by the llvm code generator
but this will be fixed next.
llvm-svn: 70670
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
input/output constraint mismatch
Before we emitted:
$ clang t.c -S -m64
llvm: error: Unsupported asm: input constraint with a matching output constraint of incompatible type!
Now we produce:
$ clang t.c -S -m64
t.c:5:40: error: unsupported inline asm: input with type 'unsigned long' matching output with type 'int'
asm volatile("foo " : "=a" (a) :"0" (b));
~~~ ~^~
llvm-svn: 70142
|
|
|
|
|
|
| |
Tests and drivers updated, still need to shuffle dirs.
llvm-svn: 67602
|
|
|
|
| |
llvm-svn: 66618
|
|
|
|
| |
llvm-svn: 66614
|
|
|
|
| |
llvm-svn: 66605
|
|
|
|
|
|
| |
same constraint info as the output constraint. Fixes PR3417
llvm-svn: 63127
|
|
|
|
| |
llvm-svn: 62923
|