[llvm] 83e2710 - [AVR] Remove an assertion that causes generic CodeGen tests to fail

Dylan McKay via llvm-commits llvm-commits at lists.llvm.org
Thu Feb 4 05:06:17 PST 2021


Author: Dylan McKay
Date: 2021-02-05T02:05:23+13:00
New Revision: 83e2710eb014c9a7fcb764b0270077e4f00cdab6

URL: https://github.com/llvm/llvm-project/commit/83e2710eb014c9a7fcb764b0270077e4f00cdab6
DIFF: https://github.com/llvm/llvm-project/commit/83e2710eb014c9a7fcb764b0270077e4f00cdab6.diff

LOG: [AVR] Remove an assertion that causes generic CodeGen tests to fail

It was discussed a few years ago and agreed that it makes sense to
remove this assertion as other targets do not perform similar register
size checking in inline assembly constraint logic, so the check just
adds a needless barrier on AVR.

This patch removes the assertion and removes 'XFAIL' from two Generic
CodeGen tests for AVR as a result.

Added: 
    

Modified: 
    llvm/lib/Target/AVR/AVRISelLowering.cpp
    llvm/test/CodeGen/Generic/2007-04-08-MultipleFrameIndices.ll
    llvm/test/CodeGen/Generic/inline-asm-mem-clobber.ll

Removed: 
    


################################################################################
diff  --git a/llvm/lib/Target/AVR/AVRISelLowering.cpp b/llvm/lib/Target/AVR/AVRISelLowering.cpp
index 2085acb7f23c..eb719415395b 100644
--- a/llvm/lib/Target/AVR/AVRISelLowering.cpp
+++ b/llvm/lib/Target/AVR/AVRISelLowering.cpp
@@ -1938,7 +1938,6 @@ AVRTargetLowering::getRegForInlineAsmConstraint(const TargetRegisterInfo *TRI,
       if (VT == MVT::i8)
         return std::make_pair(0U, &AVR::GPR8RegClass);
 
-      assert(VT == MVT::i16 && "inline asm constraint too large");
       return std::make_pair(0U, &AVR::DREGSRegClass);
     case 't': // Temporary register: r0.
       return std::make_pair(unsigned(AVR::R0), &AVR::GPR8RegClass);

diff  --git a/llvm/test/CodeGen/Generic/2007-04-08-MultipleFrameIndices.ll b/llvm/test/CodeGen/Generic/2007-04-08-MultipleFrameIndices.ll
index e961ea764ec2..cb0951dec448 100644
--- a/llvm/test/CodeGen/Generic/2007-04-08-MultipleFrameIndices.ll
+++ b/llvm/test/CodeGen/Generic/2007-04-08-MultipleFrameIndices.ll
@@ -4,7 +4,6 @@
 ; PR1557
 
 ; Bug: PR31336
-; XFAIL: avr
 
 define i32 @stuff(i32, ...) {
         %foo = alloca i8*

diff  --git a/llvm/test/CodeGen/Generic/inline-asm-mem-clobber.ll b/llvm/test/CodeGen/Generic/inline-asm-mem-clobber.ll
index 6184f803b71f..be1e0a39b3b0 100644
--- a/llvm/test/CodeGen/Generic/inline-asm-mem-clobber.ll
+++ b/llvm/test/CodeGen/Generic/inline-asm-mem-clobber.ll
@@ -1,8 +1,5 @@
 ; RUN: llc -O2 -no-integrated-as < %s | FileCheck %s
 
-; Test uses 32-bit registers which aren't supported on AVR.
-; XFAIL: avr
-
 @G = common global i32 0, align 4
 
 define i32 @foo(i8* %p) nounwind uwtable {


        


More information about the llvm-commits mailing list