From c93e10fcbb84f3a9e350104828f8c75bc02a7d51 Mon Sep 17 00:00:00 2001 From: Vitaly Buka Date: Mon, 18 Jul 2016 19:44:01 +0000 Subject: [PATCH] Revert "[ARM] Skip inline asm memory operands in DAGToDAGISel" Breaks asan, see https://reviews.llvm.org/D22103 This reverts commit r275776. llvm-svn: 275890 --- llvm/lib/Target/ARM/ARMISelDAGToDAG.cpp | 11 ----------- llvm/test/CodeGen/ARM/inlineasm3.ll | 11 ----------- 2 files changed, 22 deletions(-) diff --git a/llvm/lib/Target/ARM/ARMISelDAGToDAG.cpp b/llvm/lib/Target/ARM/ARMISelDAGToDAG.cpp index 20db3d39bcae..c5e1d976bbb5 100644 --- a/llvm/lib/Target/ARM/ARMISelDAGToDAG.cpp +++ b/llvm/lib/Target/ARM/ARMISelDAGToDAG.cpp @@ -4264,17 +4264,6 @@ bool ARMDAGToDAGISel::tryInlineAsm(SDNode *N){ if (Changed && InlineAsm::isUseOperandTiedToDef(Flag, DefIdx)) IsTiedToChangedOp = OpChanged[DefIdx]; - // Memory operands to inline asm in the SelectionDAG are modeled with two - // operands: a constant of value InlineAsm::Kind_Mem followed by the input - // operand. If we get here and we have a Kind_Mem, skip the next operand (so - // it doesn't get misinterpreted), and continue. We do this here because - // it's important to update the OpChanged array correctly before moving on. - if (Kind == InlineAsm::Kind_Mem) { - SDValue op = N->getOperand(++i); - AsmNodeOperands.push_back(op); - continue; - } - if (Kind != InlineAsm::Kind_RegUse && Kind != InlineAsm::Kind_RegDef && Kind != InlineAsm::Kind_RegDefEarlyClobber) continue; diff --git a/llvm/test/CodeGen/ARM/inlineasm3.ll b/llvm/test/CodeGen/ARM/inlineasm3.ll index 59706c4e4180..eb7ba59b69bf 100644 --- a/llvm/test/CodeGen/ARM/inlineasm3.ll +++ b/llvm/test/CodeGen/ARM/inlineasm3.ll @@ -121,14 +121,3 @@ entry: %0 = tail call <4 x i32> asm "vld1.s32 {${0:e}[], ${0:f}[]}, [$1]", "=w,r"(i32* %p) nounwind ret <4 x i32> %0 } - -; Bugzilla PR26038 - -define i32 @fn1() local_unnamed_addr nounwind { -; CHECK-LABEL: fn1 -entry: -; CHECK: mov [[addr:r[0-9]+]], #5 -; CHECK: ldrh {{.*}}[[addr]] - %0 = tail call i32 asm "ldrh $0, $1", "=r,*Q"(i8* inttoptr (i32 5 to i8*)) nounwind - ret i32 %0 -}