projects
/
oota-llvm.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
9c6cd87
)
Adds cast to 64-bit integers and set fake conditional branch insert point to proper...
author
Peizhao Ou
<peizhaoo@uci.edu>
Wed, 7 Mar 2018 20:21:46 +0000
(12:21 -0800)
committer
Peizhao Ou
<peizhaoo@uci.edu>
Wed, 7 Mar 2018 20:21:46 +0000
(12:21 -0800)
lib/CodeGen/CodeGenPrepare.cpp
patch
|
blob
|
history
diff --git
a/lib/CodeGen/CodeGenPrepare.cpp
b/lib/CodeGen/CodeGenPrepare.cpp
index 5f22c14f90fbb79e8f649e50a3d26f2032c46947..5b1f8a064befb5fd5bbebe9ac5f8bef8d1d747bf 100644
(file)
--- a/
lib/CodeGen/CodeGenPrepare.cpp
+++ b/
lib/CodeGen/CodeGenPrepare.cpp
@@
-791,19
+791,20
@@
void TaintRelaxedLoads(Instruction* UsageInst, Instruction* InsertPoint) {
auto* BB = UsageInst->getParent();
if (InsertPoint == nullptr) {
InsertPoint = UsageInst->getNextNode();
auto* BB = UsageInst->getParent();
if (InsertPoint == nullptr) {
InsertPoint = UsageInst->getNextNode();
- while (dyn_cast<PHINode>(InsertPoint)) {
- InsertPoint = InsertPoint->getNextNode();
- }
+ }
+ // Insert instructions after PHI nodes.
+ while (dyn_cast<PHINode>(InsertPoint)) {
+ InsertPoint = InsertPoint->getNextNode();
}
// First thing is to cast 'UsageInst' to an integer type if necessary.
Value* AndTarget = nullptr;
}
// First thing is to cast 'UsageInst' to an integer type if necessary.
Value* AndTarget = nullptr;
- if (IntegerType::classof(UsageInst->getType())) {
+ Type* TargetIntegerType =
+ IntegerType::get(UsageInst->getContext(),
+ BB->getModule()->getDataLayout().getPointerSizeInBits());
+ if (UsageInst->getType() == TargetIntegerType) {
AndTarget = UsageInst;
} else {
AndTarget = UsageInst;
} else {
- Type* TargetIntegerType = IntegerType::get(
- UsageInst->getContext(),
- BB->getModule()->getDataLayout().getPointerSizeInBits());
- IRBuilder<true, NoFolder> Builder(UsageInst->getNextNode());
+ IRBuilder<true, NoFolder> Builder(InsertPoint);
AndTarget = createCast(Builder, UsageInst, TargetIntegerType);
}
AndTarget = createCast(Builder, UsageInst, TargetIntegerType);
}