[llvm] [SeparateConstOffsetFromGEP] Decompose constant xor operand if possible (PR #135788)
Sumanth Gundapaneni via llvm-commits
llvm-commits at lists.llvm.org
Thu Apr 24 06:32:54 PDT 2025
================
@@ -1162,6 +1167,179 @@ bool SeparateConstOffsetFromGEP::splitGEP(GetElementPtrInst *GEP) {
return true;
}
+bool SeparateConstOffsetFromGEP::decomposeXor(Function &F) {
+ bool FunctionChanged = false;
+ SmallVector<std::pair<Instruction *, Value *>, 16> ReplacementsToMake;
+
+ for (BasicBlock &BB : F) {
+ for (Instruction &I : BB) {
+ if (I.getOpcode() == Instruction::Xor) {
+ if (Value *Replacement = tryFoldXorToOrDisjoint(I)) {
+ ReplacementsToMake.push_back({&I, Replacement});
+ FunctionChanged = true;
----------------
sgundapa wrote:
Sure.
https://github.com/llvm/llvm-project/pull/135788
More information about the llvm-commits
mailing list