[PATCH] D105901: [InstCombine] Fold (select C, (gep Ptr, Idx), Ptr) -> (gep Ptr, (select C, Idx, 0)) (PR50183)
Philip Reames via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Tue Jul 13 09:53:55 PDT 2021
- Previous message: [PATCH] D105901: [InstCombine] Fold (select C, (gep Ptr, Idx), Ptr) -> (gep Ptr, (select C, Idx, 0)) (PR50183)
- Next message: [PATCH] D105901: [InstCombine] Fold (select C, (gep Ptr, Idx), Ptr) -> (gep Ptr, (select C, Idx, 0)) (PR50183)
- Messages sorted by:
[ date ]
[ thread ]
[ subject ]
[ author ]
reames accepted this revision.
reames added a comment.
This revision is now accepted and ready to land.
LGTM w/minor comment
================
Comment at: llvm/lib/Transforms/InstCombine/InstCombineSelect.cpp:2942
+ Type *ElementType = Gep->getResultElementType();
+ if (Gep->getNumOperands() == 2 && Gep->getPointerOperand() == Base &&
+ Gep->hasOneUse()) {
----------------
Please use early return to reduce nesting.
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D105901/new/
https://reviews.llvm.org/D105901
- Previous message: [PATCH] D105901: [InstCombine] Fold (select C, (gep Ptr, Idx), Ptr) -> (gep Ptr, (select C, Idx, 0)) (PR50183)
- Next message: [PATCH] D105901: [InstCombine] Fold (select C, (gep Ptr, Idx), Ptr) -> (gep Ptr, (select C, Idx, 0)) (PR50183)
- Messages sorted by:
[ date ]
[ thread ]
[ subject ]
[ author ]
More information about the llvm-commits
mailing list