|
LLVM 24.0.0git
|
Expand non-8-bit and non-16-bit shift instructions (shl, lshr, ashr) to inline loops, just like avr-gcc. More...
#include "AVR.h"#include "llvm/IR/Analysis.h"#include "llvm/IR/IRBuilder.h"#include "llvm/IR/InstIterator.h"#include "llvm/IR/PassManager.h"Go to the source code of this file.
Functions | |
| INITIALIZE_PASS (AVRShiftExpandLegacy, "avr-shift-expand", "AVR Shift Expansion", false, false) Pass *llvm | |
| static void | expandBinaryOperator (BinaryOperator *BI) |
| static bool | expandShiftsInFunction (Function &F) |
Expand non-8-bit and non-16-bit shift instructions (shl, lshr, ashr) to inline loops, just like avr-gcc.
This must be done in IR because otherwise the type legalizer will turn 32-bit shifts into (non-existing) library calls such as __ashlsi3.
Definition in file AVRShiftExpand.cpp.
|
static |
Definition at line 49 of file AVRShiftExpand.cpp.
References llvm::PHINode::addIncoming(), llvm::BasicBlock::back(), llvm::cast(), llvm::BasicBlock::Create(), llvm::Instruction::eraseFromParent(), F, llvm::Value::getContext(), llvm::Type::getInt8Ty(), llvm::BinaryOperator::getOpcode(), llvm::User::getOperand(), llvm::BasicBlock::getParent(), llvm::ilist_detail::node_parent_access< NodeTy, ParentTy >::getParent(), llvm_unreachable, llvm::Value::replaceAllUsesWith(), and llvm::BasicBlock::splitBasicBlock().
Referenced by expandShiftsInFunction().
Definition at line 123 of file AVRShiftExpand.cpp.
References llvm::cast(), expandBinaryOperator(), F, llvm::Type::getInt16Ty(), llvm::Type::getInt8Ty(), I, instructions, llvm::isa(), llvm::SmallVectorTemplateBase< T, bool >::push_back(), and llvm::SmallVectorTemplateCommon< T, typename >::size().
Referenced by llvm::AVRShiftExpandPass::run().
| INITIALIZE_PASS | ( | AVRShiftExpandLegacy | , |
| "avr-shift-expand" | , | ||
| "AVR Shift Expansion" | , | ||
| false | , | ||
| false | ) |
Definition at line 42 of file AVRShiftExpand.cpp.
References llvm::createAVRShiftExpandLegacyPass().