[PATCH] D155023: Don't assert on a non-pointer value being used for a "p" inline asm constraint.

Amara Emerson via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Jul 13 10:46:23 PDT 2023


This revision was landed with ongoing or failed builds.
This revision was automatically updated to reflect the committed changes.
Closed by commit rG432338a673c8: Don't assert on a non-pointer value being used for a "p" inline asm constraint. (authored by aemerson).

Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D155023/new/

https://reviews.llvm.org/D155023

Files:
  llvm/lib/CodeGen/SelectionDAG/SelectionDAGBuilder.cpp
  llvm/test/CodeGen/X86/inline-asm-p-constraint.ll


Index: llvm/test/CodeGen/X86/inline-asm-p-constraint.ll
===================================================================
--- llvm/test/CodeGen/X86/inline-asm-p-constraint.ll
+++ llvm/test/CodeGen/X86/inline-asm-p-constraint.ll
@@ -15,3 +15,12 @@
   ret ptr %1
 ; CHECK-NEXT: retq
 }
+
+define void @intptr() {
+; Don't assert on a non-ptr operand, existing code & gcc accept these.
+entry:
+; CHECK-LABEL: intptr:
+; CHECK: ud1l 49150(%eax), %eax
+  call void asm "ud1l $0(%eax), %eax", "p,~{dirflag},~{fpsr},~{flags}"(i32 49150)
+  unreachable
+}
Index: llvm/lib/CodeGen/SelectionDAG/SelectionDAGBuilder.cpp
===================================================================
--- llvm/lib/CodeGen/SelectionDAG/SelectionDAGBuilder.cpp
+++ llvm/lib/CodeGen/SelectionDAG/SelectionDAGBuilder.cpp
@@ -9370,10 +9370,6 @@
       }
 
       if (OpInfo.ConstraintType == TargetLowering::C_Address) {
-        assert(InOperandVal.getValueType() ==
-                   TLI.getPointerTy(DAG.getDataLayout()) &&
-               "Address operands expect pointer values");
-
         unsigned ConstraintID =
             TLI.getInlineAsmMemConstraint(OpInfo.ConstraintCode);
         assert(ConstraintID != InlineAsm::Constraint_Unknown &&


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D155023.540107.patch
Type: text/x-patch
Size: 1229 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20230713/256fb9d7/attachment.bin>


More information about the llvm-commits mailing list