[PATCH] D99051: [InstCombine] Stop folding inttoptr+bitcast if multiple uses
Matt Arsenault via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Mon Mar 22 11:27:19 PDT 2021
arsenm added inline comments.
================
Comment at: llvm/lib/Transforms/InstCombine/InstCombineCasts.cpp:279
+ //
+ // %p1 = inttoptr %addr to i32 *
+ // %i = load i32, i32 * %p1
----------------
Remove the spaces between the type and * throughout the comment
================
Comment at: llvm/lib/Transforms/InstCombine/InstCombineCasts.cpp:295-296
+ // are consecutive, thus fail to vectorize the two loads.
+ if (firstOp == Instruction::IntToPtr && Res == Instruction::IntToPtr &&
+ !CI1->hasOneUse())
+ Res = 0;
----------------
This feels like the wrong place. This is isEliminableCastPair, and the cast can be eliminated. Can the hasOneUse check go to some specific combine?
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D99051/new/
https://reviews.llvm.org/D99051
More information about the llvm-commits
mailing list