Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[SelectionDAG] treat X constrained labels as i for asm
Completely rework how we handle X constrained labels for inline asm. X should really be treated as i. Then existing tests can be moved to use i D115410 and clang can just emit i D115311. (D115410 and D115311 are callbr, but this can be done for label inputs, too). Coincidentally, this simplification solves an ICE uncovered by D87279 based on assumptions made during D69868. This is the third approach considered. See also discussions v1 (D114895) and v2 (D115409). Reported-by: kernel test robot <lkp@intel.com> Fixes: ClangBuiltLinux/linux#1512 Reviewed By: void, jyknight Differential Revision: https://reviews.llvm.org/D115688
- Loading branch information
1 parent
dfd0708
commit 4edb998
Showing
6 changed files
with
69 additions
and
44 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
; RUN: not llc -mtriple=x86_64-linux-gnu -o - %s 2>&1 | FileCheck %s | ||
|
||
; Test that the blockaddress with X, i, or s constraint is printed as an | ||
; immediate (.Ltmp0). | ||
; Test that blockaddress with n constraint is an error. | ||
define void @test1() { | ||
; CHECK: error: constraint 'n' expects an integer constant expression | ||
; CHECK-LABEL: test1: | ||
; CHECK: # %bb.0: # %entry | ||
; CHECK-NEXT: .Ltmp0: # Block address taken | ||
; CHECK-NEXT: # %bb.1: # %b | ||
; CHECK-NEXT: #APP | ||
; CHECK-NEXT: # .Ltmp0 .Ltmp0 .Ltmp0 | ||
; CHECK-NEXT: #NO_APP | ||
; CHECK-NEXT: retq | ||
entry: | ||
br label %b | ||
b: | ||
call void asm "# $0 $1 $2", "X,i,s"(i8* blockaddress(@test1, %b), i8* blockaddress(@test1, %b), i8* blockaddress(@test1, %b)) | ||
call void asm "# $0", "n"(i8* blockaddress(@test1, %b)) | ||
ret void | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters