diff --git a/llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp b/llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp index d4549b191737..c33efc2d741a 100644 --- a/llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp +++ b/llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp @@ -5443,6 +5443,7 @@ bool DAGCombiner::SearchForAndLoads(SDNode *N, } bool DAGCombiner::BackwardsPropagateMask(SDNode *N) { + return false; auto *Mask = dyn_cast(N->getOperand(1)); if (!Mask) return false; @@ -12368,6 +12369,7 @@ SDValue DAGCombiner::visitTRUNCATE(SDNode *N) { return DAG.getNode(ISD::TRUNCATE, SDLoc(N), VT, Shorter); } +#if 0 // fold (truncate (load x)) -> (smaller load x) // fold (truncate (srl (load x), c)) -> (smaller load (x+c/evtbits)) if (!LegalTypes || TLI.isTypeDesirableForOp(N0.getOpcode(), VT)) { @@ -12388,6 +12390,7 @@ SDValue DAGCombiner::visitTRUNCATE(SDNode *N) { } } } +#endif // fold (trunc (concat ... x ...)) -> (concat ..., (trunc x), ...)), // where ... are all 'undef'. diff --git a/llvm/lib/CodeGen/SelectionDAG/TargetLowering.cpp b/llvm/lib/CodeGen/SelectionDAG/TargetLowering.cpp index 0cc22a4e1087..3b38bef3b101 100644 --- a/llvm/lib/CodeGen/SelectionDAG/TargetLowering.cpp +++ b/llvm/lib/CodeGen/SelectionDAG/TargetLowering.cpp @@ -7595,7 +7595,6 @@ TargetLowering::expandUnalignedLoad(LoadSDNode *LD, SelectionDAG &DAG) const { auto Rem = DAG.getNode(ISD::UREM, dl, MVT::i256, Ptr, Const32); auto Base1 = DAG.getNode(ISD::SUB, dl, MVT::i256, Ptr, Rem); Rem = DAG.getNode(ISD::MUL, dl, MVT::i256, Rem, Const8); - auto PtrInfo = LD->getPointerInfo(); auto LoOrig = DAG.getExtLoad( ISD::NON_EXTLOAD, dl, MVT::i256, Chain, Base1, diff --git a/llvm/lib/Target/SyncVM/SyncVMCodegenPrepare.cpp b/llvm/lib/Target/SyncVM/SyncVMCodegenPrepare.cpp index 0024ed9726a0..93b1939a63c0 100644 --- a/llvm/lib/Target/SyncVM/SyncVMCodegenPrepare.cpp +++ b/llvm/lib/Target/SyncVM/SyncVMCodegenPrepare.cpp @@ -94,8 +94,9 @@ bool SyncVMCodegenPrepare::runOnFunction(Function &F) { case Instruction::LShr: case Instruction::Shl: { IRBuilder<> Builder(&BB, std::next(II)); - auto *Const0 = Builder.getInt(APInt(256, 0, false)); - auto *Const255 = Builder.getInt(APInt(256, 255, false)); + unsigned Size = II->getType()->getIntegerBitWidth(); + auto *Const0 = Builder.getInt(APInt(Size, 0, false)); + auto *Const255 = Builder.getInt(APInt(Size, 255, false)); auto *Icmp = Builder.CreateICmpUGT(I.getOperand(1), Const255); auto *Select = Builder.CreateSelect(Icmp, Const0, &I); I.replaceUsesWithIf(Select,