Find def operand that corresponds to matching constraint and
tie input to that operand.
Details
Diff Detail
- Repository
- rG LLVM Github Monorepo
Event Timeline
Added tests for matching constraints that involve sgpr. Also added one more test file with comparison between 'register class constraint' and 'matching constraint' in final asm output.
This is causing libcxx test failures in AArch64 -O0. Reduced testcase (the inline asm ultimately comes from DoNotOptimize in libcxx/test/support/test_macros.h):
target triple = "aarch64-none-eabi" define void @fn() { entry: %ap = alloca i8*, align 8 %0 = load i8*, i8** %ap, align 8 call void asm sideeffect "", "=*r|m,0,~{memory}"(i8** %ap, i8* %0) ret void }
llc -O0 results in the assertion failure "Register class not set, wrong accessor" coming from the call to MRI->getRegClass(Def) at line 414.
I see. I expected that reg class was already determined when previous operand was processed. I will take a look, first operand should have probably asked TargetRegisterInfo for PointerRegClass.
Another AArch64 failure from this (bugpointed from a failure in http://green.lab.llvm.org/green/job/test-suite-verify-machineinstrs-aarch64-O0-g)
Given the following:
define void @main() { %1 = call i16 asm sideeffect "", "=r,0"(i16 undef) unreachable }
Compile with:
llc -global-isel -mtriple aarch64-apple-ios -verify-machineinstrs
And you'll get the following error:
# After IRTranslator # Machine code for function main: IsSSA, TracksLiveness bb.1 (%ir-block.0): %1:_(s16) = G_IMPLICIT_DEF %2:gpr32common = COPY %1:_(s16) INLINEASM &"" [sideeffect] [attdialect], $0:[regdef:GPR32common], def %0:gpr32common, $1:[reguse tiedto:$0], %2:gpr32common(tied-def 3) %4:_(s32) = COPY %0:gpr32common %3:_(s16) = G_TRUNC %4:_(s32) # End machine code for function main. *** Bad machine code: Copy Instruction is illegal with mismatching sizes *** - function: main - basic block: %bb.1 (0x7fdea2021d40) - instruction: %2:gpr32common = COPY %1:_(s16) Def Size = 32, Src Size = 16 LLVM ERROR: Found 1 machine code errors.
const reference