diff --git a/llvm/lib/CodeGen/SelectionDAG/LegalizeDAG.cpp b/llvm/lib/CodeGen/SelectionDAG/LegalizeDAG.cpp index bb8b81a42fcb..d83faa1c74d8 100644 --- a/llvm/lib/CodeGen/SelectionDAG/LegalizeDAG.cpp +++ b/llvm/lib/CodeGen/SelectionDAG/LegalizeDAG.cpp @@ -3766,7 +3766,7 @@ bool SelectionDAGLegalize::ExpandNode(SDNode *Node) { // illegal; expand it into a SELECT_CC. EVT VT = Node->getValueType(0); int TrueValue; - switch (TLI.getBooleanContents(Tmp1->getValueType(0))) { + switch (TLI.getBooleanContents(Tmp1.getValueType())) { case TargetLowering::ZeroOrOneBooleanContent: case TargetLowering::UndefinedBooleanContent: TrueValue = 1; diff --git a/llvm/test/CodeGen/ARM/2018-02-13-PR36079.ll b/llvm/test/CodeGen/ARM/2018-02-13-PR36079.ll new file mode 100644 index 000000000000..04585b194ddf --- /dev/null +++ b/llvm/test/CodeGen/ARM/2018-02-13-PR36079.ll @@ -0,0 +1,23 @@ +; RUN: llc -mtriple=arm-eabi -mattr=+neon < %s -o - | FileCheck %s + +@c = global [4 x i32] [i32 3, i32 3, i32 3, i32 3], align 4 +@d = common global i32 0, align 4 + +define void @foo() local_unnamed_addr nounwind norecurse { +entry: + %0 = load <4 x i32>, <4 x i32>* bitcast ([4 x i32]* @c to <4 x i32>*), align 4 + %1 = and <4 x i32> %0, + + store <4 x i32> %1, <4 x i32>* bitcast ([4 x i32]* @c to <4 x i32>*), align 4 + ret void +; CHECK-NOT: mvnne +; CHECK: movne r{{[0-9]+}}, #1 +; CHECK-NOT: mvnne +; CHECK: movne r{{[0-9]+}}, #1 +; CHECK-NOT: mvnne +; CHECK: movne r{{[0-9]+}}, #1 +; CHECK-NOT: mvnne +}