#include "InstCombine.h"
#include "llvm/ADT/Statistic.h"
-#include "llvm/Analysis/InstructionSimplify.h"
#include "llvm/Analysis/MemoryBuiltins.h"
#include "llvm/IR/DataLayout.h"
#include "llvm/Support/CallSite.h"
return &CI;
}
- CallSite CS(&CI);
- if (Value *V = SimplifyCall(CS.getCalledValue(), CS.arg_begin(), CS.arg_end(),
- TD))
- return ReplaceInstUsesWith(CI, V);
-
IntrinsicInst *II = dyn_cast<IntrinsicInst>(&CI);
if (!II) return visitCallSite(&CI);
ret void
; CHECK: @powi
; CHECK: %A = fdiv double 1.0{{.*}}, %V
-; CHECK: store volatile double %A,
-; CHECK: store volatile double 1.0
+; CHECK: store volatile double %A,
+; CHECK: store volatile double 1.0
; CHECK: store volatile double %V
}
; CHECK: @cttz_select
; CHECK: select i1 %tobool, i32 %cttz, i32 32
}
-
-; Test that SimplifyCall is getting invoked by InstCombine
-declare float @llvm.fabs.f32(float) nounwind readnone
-define float @simplify_idempotent(float %a) {
-; CHECK: @simplify_idempotent
-; CHECK: fabs
-; CHECK-NOT: fabs
- %a0 = call float @llvm.fabs.f32(float %a)
- %a1 = call float @llvm.fabs.f32(float %a0)
-
- ret float %a1
-}
\ No newline at end of file