Skip to content

Commit

Permalink
[Will be squashed] Disable backward mask propagation
Browse files Browse the repository at this point in the history
  • Loading branch information
akiramenai committed Oct 25, 2021
1 parent 37f6f16 commit 3ee8375
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 3 deletions.
3 changes: 3 additions & 0 deletions llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -5443,6 +5443,7 @@ bool DAGCombiner::SearchForAndLoads(SDNode *N,
}

bool DAGCombiner::BackwardsPropagateMask(SDNode *N) {
return false;
auto *Mask = dyn_cast<ConstantSDNode>(N->getOperand(1));
if (!Mask)
return false;
Expand Down Expand Up @@ -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)) {
Expand All @@ -12388,6 +12390,7 @@ SDValue DAGCombiner::visitTRUNCATE(SDNode *N) {
}
}
}
#endif

// fold (trunc (concat ... x ...)) -> (concat ..., (trunc x), ...)),
// where ... are all 'undef'.
Expand Down
1 change: 0 additions & 1 deletion llvm/lib/CodeGen/SelectionDAG/TargetLowering.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
5 changes: 3 additions & 2 deletions llvm/lib/Target/SyncVM/SyncVMCodegenPrepare.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down

0 comments on commit 3ee8375

Please sign in to comment.