[llvm] [DirectX] Legalize i8 allocas (PR #137399)
Farzon Lotfi via llvm-commits
llvm-commits at lists.llvm.org
Tue Apr 29 11:15:30 PDT 2025
================
@@ -31,16 +32,17 @@ static void legalizeFreeze(Instruction &I,
ToRemove.push_back(FI);
}
-static void fixI8TruncUseChain(Instruction &I,
- SmallVectorImpl<Instruction *> &ToRemove,
- DenseMap<Value *, Value *> &ReplacedValues) {
+static void fixI8UseChain(Instruction &I,
+ SmallVectorImpl<Instruction *> &ToRemove,
+ DenseMap<Value *, Value *> &ReplacedValues) {
auto ProcessOperands = [&](SmallVector<Value *> &NewOperands) {
Type *InstrType = IntegerType::get(I.getContext(), 32);
for (unsigned OpIdx = 0; OpIdx < I.getNumOperands(); ++OpIdx) {
Value *Op = I.getOperand(OpIdx);
- if (ReplacedValues.count(Op))
+ if (ReplacedValues.count(Op) &&
+ ReplacedValues[Op]->getType()->isIntegerTy())
----------------
farzonl wrote:
Yes specificslly Load/Store had ptr types and I wanted to exclude ptrs. from the replacement value tracking and it didn't make sense to consider any other types like fp.
https://github.com/llvm/llvm-project/pull/137399
More information about the llvm-commits
mailing list