From 59a01a958a55c75af4076e35ba67e2a4a38d8dce Mon Sep 17 00:00:00 2001 From: Ulrich Weigand Date: Tue, 19 Sep 2017 20:50:05 +0000 Subject: [SystemZ] Fix truncstore + bswap codegen bug SystemZTargetLowering::combineSTORE contains code to transform a combination of STORE + BSWAP into a STRV type instruction. This transformation is correct for regular stores, but not for truncating stores. The routine neglected to check for that case. Fixes a miscompilation of llvm-objcopy with clang, which caused test suite failures in the SystemZ multistage build bot. llvm-svn: 313669 --- llvm/lib/Target/SystemZ/SystemZISelLowering.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'llvm/lib/Target/SystemZ/SystemZISelLowering.cpp') diff --git a/llvm/lib/Target/SystemZ/SystemZISelLowering.cpp b/llvm/lib/Target/SystemZ/SystemZISelLowering.cpp index 1900a00ef26..9e24a3b9548 100644 --- a/llvm/lib/Target/SystemZ/SystemZISelLowering.cpp +++ b/llvm/lib/Target/SystemZ/SystemZISelLowering.cpp @@ -5225,7 +5225,8 @@ SDValue SystemZTargetLowering::combineSTORE( } // Combine STORE (BSWAP) into STRVH/STRV/STRVG // See comment in combineBSWAP about volatile accesses. - if (!SN->isVolatile() && + if (!SN->isTruncatingStore() && + !SN->isVolatile() && Op1.getOpcode() == ISD::BSWAP && Op1.getNode()->hasOneUse() && (Op1.getValueType() == MVT::i16 || -- cgit v1.2.3